[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v3 41/85] i386/apic: Add hint on boot failure because of disabling
From: |
Michael S. Tsirkin |
Subject: |
[PULL v3 41/85] i386/apic: Add hint on boot failure because of disabling x2APIC |
Date: |
Wed, 3 Jul 2024 18:47:26 -0400 |
From: Zhao Liu <zhao1.liu@intel.com>
Currently, the Q35 supports up to 4096 vCPUs (since v9.0), but for TCG
cases, if x2APIC is not actively enabled to boot more than 255 vCPUs (
e.g., qemu-system-i386 -M pc-q35-9.0 -smp 666), the following error is
reported:
Unexpected error in apic_common_set_id() at ../hw/intc/apic_common.c:449:
qemu-system-i386: APIC ID 255 requires x2APIC feature in CPU
Aborted (core dumped)
This error can be resolved by setting x2apic=on in -cpu. In order to
better help users deal with this scenario, add the error hint to
instruct users on how to enable the x2apic feature. Then, the error
report becomes the following:
Unexpected error in apic_common_set_id() at ../hw/intc/apic_common.c:448:
qemu-system-i386: APIC ID 255 requires x2APIC feature in CPU
Try x2apic=on in -cpu.
Aborted (core dumped)
Note since @errp is &error_abort, error_append_hint() can't be applied
on @errp. And in order to separate the exact error message from the
(perhaps effectively) hint, adding a hint via error_append_hint() is
also necessary. Therefore, introduce @local_error in
apic_common_set_id() to handle both the error message and the error
hint.
Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Message-Id: <20240606140858.2157106-1-zhao1.liu@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/intc/apic_common.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c
index d8fc1e2815..c13cdd7994 100644
--- a/hw/intc/apic_common.c
+++ b/hw/intc/apic_common.c
@@ -433,6 +433,7 @@ static void apic_common_set_id(Object *obj, Visitor *v,
const char *name,
APICCommonState *s = APIC_COMMON(obj);
DeviceState *dev = DEVICE(obj);
uint32_t value;
+ Error *local_err = NULL;
if (dev->realized) {
qdev_prop_set_after_realize(dev, name, errp);
@@ -444,7 +445,11 @@ static void apic_common_set_id(Object *obj, Visitor *v,
const char *name,
}
if (value >= 255 && !cpu_has_x2apic_feature(&s->cpu->env)) {
- error_setg(errp, "APIC ID %d requires x2APIC feature in CPU", value);
+ error_setg(&local_err,
+ "APIC ID %d requires x2APIC feature in CPU",
+ value);
+ error_append_hint(&local_err, "Try x2apic=on in -cpu.\n");
+ error_propagate(errp, local_err);
return;
}
--
MST
- [PULL v3 31/85] hw/misc/pvpanic: centralize definition of supported events, (continued)
- [PULL v3 31/85] hw/misc/pvpanic: centralize definition of supported events, Michael S. Tsirkin, 2024/07/03
- [PULL v3 32/85] tests/qtest/pvpanic: use centralized definition of supported events, Michael S. Tsirkin, 2024/07/03
- [PULL v3 33/85] hw/misc/pvpanic: add support for normal shutdowns, Michael S. Tsirkin, 2024/07/03
- [PULL v3 35/85] tests/qtest/pvpanic: add tests for pvshutdown event, Michael S. Tsirkin, 2024/07/03
- [PULL v3 34/85] pvpanic: Emit GUEST_PVSHUTDOWN QMP event on pvpanic shutdown signal, Michael S. Tsirkin, 2024/07/03
- [PULL v3 36/85] Revert "docs/specs/pvpanic: mark shutdown event as not implemented", Michael S. Tsirkin, 2024/07/03
- [PULL v3 37/85] virtio-pci: Fix the failure process in kvm_virtio_pci_vector_use_one(), Michael S. Tsirkin, 2024/07/03
- [PULL v3 38/85] hw/cxl: Fix read from bogus memory, Michael S. Tsirkin, 2024/07/03
- [PULL v3 39/85] virtio-pci: implement No_Soft_Reset bit, Michael S. Tsirkin, 2024/07/03
- [PULL v3 40/85] vhost-user-test: no set non-blocking for cal fd less than 0., Michael S. Tsirkin, 2024/07/03
- [PULL v3 41/85] i386/apic: Add hint on boot failure because of disabling x2APIC,
Michael S. Tsirkin <=
- [PULL v3 42/85] hw/virtio: Free vqs after vhost_dev_cleanup(), Michael S. Tsirkin, 2024/07/03
- [PULL v3 43/85] virtio-iommu: add error check before assert, Michael S. Tsirkin, 2024/07/03
- [PULL v3 44/85] vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests, Michael S. Tsirkin, 2024/07/03
- [PULL v3 45/85] hw/net/virtio-net.c: fix crash in iov_copy(), Michael S. Tsirkin, 2024/07/03
- [PULL v3 46/85] qapi: clarify that the default is backend dependent, Michael S. Tsirkin, 2024/07/03
- [PULL v3 47/85] libvhost-user: set msg.msg_control to NULL when it is empty, Michael S. Tsirkin, 2024/07/03
- [PULL v3 48/85] libvhost-user: fail vu_message_write() if sendmsg() is failing, Michael S. Tsirkin, 2024/07/03
- [PULL v3 49/85] libvhost-user: mask F_INFLIGHT_SHMFD if memfd is not supported, Michael S. Tsirkin, 2024/07/03
- [PULL v3 50/85] vhost-user-server: do not set memory fd non-blocking, Michael S. Tsirkin, 2024/07/03
- [PULL v3 51/85] contrib/vhost-user-blk: fix bind() using the right size of the address, Michael S. Tsirkin, 2024/07/03