qemu/hw
Vasant Hegde 0f178860df hw/i386/amd_iommu: Fix xtsup when vcpus < 255
If vCPUs > 255 then x86 common code (x86_cpus_init()) call kvm_enable_x2apic().
But if vCPUs <= 255 then the common code won't calls kvm_enable_x2apic().

This is because commit 8c6619f3e6 ("hw/i386/amd_iommu: Simplify non-KVM
checks on XTSup feature") removed the call to kvm_enable_x2apic when xtsup
is "on", which break things when guest is booted with x2apic mode and
there are <= 255 vCPUs.

Fix this by adding back kvm_enable_x2apic() call when xtsup=on.

Fixes: 8c6619f3e6 ("hw/i386/amd_iommu: Simplify non-KVM checks on XTSup feature")
Reported-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Tested-by: Tested-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Cc: Philippe Mathieu-Daudé <philmd@linaro.org>
Cc: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Signed-off-by: Sairaj Kodilkar <sarunkod@amd.com>
Message-Id: <20250516100535.4980-3-sarunkod@amd.com>
Fixes: 8c6619f3e6 ("hw/i386/amd_iommu: Simplify non-KVM checks on XTSup feature")
Reported-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Tested-by: Tested-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Cc: Philippe Mathieu-Daudé <philmd@linaro.org>
Cc: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Signed-off-by: Sairaj Kodilkar <sarunkod@amd.com>
2025-06-01 06:38:53 -04:00
..
9pfs 9pfs: fix 'total_open_fd' decrementation 2025-05-05 11:28:29 +02:00
acpi trivial patches for 2025-05-09 2025-05-12 11:11:27 -04:00
adc qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
alpha qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
arm hw/arm/fby35: Map BMC memory into system memory 2025-05-25 23:39:11 +02:00
audio hw/audio/asc: replace g_malloc0() with g_malloc() 2025-05-25 11:28:28 +02:00
avr qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
block vhost-user: return failure if backend crash when live migration 2025-05-14 05:39:15 -04:00
char vhost-user: return failure if backend crash when live migration 2025-05-14 05:39:15 -04:00
core scsi-disk: Advertise FUA support by default 2025-05-21 18:52:17 +02:00
cpu qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
cxl hw/cxl/cxl-mailbox-utils: CXL CCI Get/Set alert config commands 2025-05-14 05:39:14 -04:00
display virtio,pci,pc: fixes, features 2025-05-15 13:41:56 -04:00
dma hw/arm: Replace TABs for spaces in OMAP board and device code 2025-05-14 14:29:47 +01:00
fsi qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
gpio hw/arm: Replace TABs for spaces in OMAP board and device code 2025-05-14 14:29:47 +01:00
hppa qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
hyperv hw/hyperv/hyperv: common compilation unit 2025-05-08 14:22:12 +02:00
i2c hw/arm: Replace TABs for spaces in OMAP board and device code 2025-05-14 14:29:47 +01:00
i386 hw/i386/amd_iommu: Fix xtsup when vcpus < 255 2025-06-01 06:38:53 -04:00
ide qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
input vhost-user: return failure if backend crash when live migration 2025-05-14 05:39:15 -04:00
intc hw/intc/aspeed Fix coding style 2025-05-25 23:39:11 +02:00
ipack qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
ipmi qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
isa hw/isa/ich9: Remove stray empty comment 2025-05-09 23:49:26 +03:00
loongarch hw/loongarch/boot: Adjust the loading position of the initrd 2025-05-14 15:57:23 +08:00
m68k qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
mem hw/cxl/cxl-mailbox-utils: CXL CCI Get/Set alert config commands 2025-05-14 05:39:14 -04:00
microblaze hw/microblaze: Evaluate TARGET_BIG_ENDIAN at compile time 2025-04-25 17:09:58 +02:00
mips hw/mips: Evaluate TARGET_BIG_ENDIAN at compile time 2025-04-25 17:09:58 +02:00
misc hw/misc/aspeed_hace: Support to dump plaintext and digest for better debugging 2025-05-25 23:39:11 +02:00
net virtio,pci,pc: fixes, features 2025-05-15 13:41:56 -04:00
nubus qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
nvme hw/nvme: fix nvme hotplugging 2025-05-15 12:18:06 +02:00
nvram qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
openrisc qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
pci hw/pci-host: Remove unused pci_host_data_be_ops 2025-05-20 08:04:18 +02:00
pci-bridge qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
pci-host hw/pci-host/gt64120: Fix endianness handling 2025-05-20 08:04:18 +02:00
ppc include: Remove 'exec/exec-all.h' 2025-04-30 12:45:05 -07:00
remote qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
riscv target/riscv: store RISCVCPUDef struct directly in the class 2025-05-20 08:18:53 +02:00
rtc hw/rtc/mc146818rtc: Drop pre-v3 migration stream support 2025-04-30 20:44:20 +02:00
rx qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
s390x qapi: make s390x specific CPU commands unconditionally available 2025-05-28 18:56:08 +02:00
scsi scsi-disk: Advertise FUA support by default 2025-05-21 18:52:17 +02:00
sd qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
sensor qom: Constify TypeInfo::class_data 2025-04-25 17:00:41 +02:00
sh4 include: Remove 'exec/exec-all.h' 2025-04-30 12:45:05 -07:00
smbios ipmi: add fwinfo to pci ipmi devices 2025-04-11 10:50:42 -05:00
sparc qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
sparc64 qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
ssi hw/ssi/aspeed_smc: Allow 64-bit wide flash accesses 2025-05-05 09:38:55 +02:00
timer hw/arm: Replace TABs for spaces in OMAP board and device code 2025-05-14 14:29:47 +01:00
tpm qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
tricore qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
uefi qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
ufs qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
usb hw/usb/hcd-xhci: Unmap canceled packet 2025-04-25 17:00:42 +02:00
vfio system/runstate: add VM state change cb with return value 2025-05-14 05:39:14 -04:00
virtio virtio: check for validity of indirect descriptors 2025-06-01 06:38:53 -04:00
vmapple qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
watchdog qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
xen trivial patches for 2025-05-09 2025-05-12 11:11:27 -04:00
xenpv hw/boards: Do not create unusable default if=sd drives 2025-02-16 14:25:08 +01:00
xtensa qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
Kconfig Misc HW patches 2025-03-05 21:54:58 +08:00
meson.build Misc HW patches 2025-03-05 21:54:58 +08:00