@samitouri / QOSamiQemu / commits / c906c23370

hw: i386: vapic: restore IRQ polling for non-kernel irqchip backends

69dfc078 extended vAPIC handling for WHPX with user-mode irqchip, but it also changed vapic_write() case 4 in a way that excludes TCG from apic_poll_irq(). Before that change, IRQ polling happened whenever no in-kernel irqchip was active. After the change, it only happened for KVM or WHPX with a user-mode irqchip. Under TCG, both kvm_enabled() and whpx_enabled() are false, so the poll never happens. This regresses 32-bit Windows XP guests on a Windows host with -machine pc-i440fx-10.0,accel=tcg, causing a STOP 0x0000000A during boot. Fix it by making the decision depend on whether KVM or WHPX is using an in-kernel irqchip, instead of whether either accelerator is enabled. Fixes: 69dfc078a6f0 ("hw: i386: vapic: enable on WHPX with user-mode irqchip") Signed-off-by: rickgcn <rickgcn@gmail.com> Link: https://lore.kernel.org/r/20260418061429.16898-1-rickgcn@gmail.com Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

rickgcn committed Apr 18, 2026 at 14:14 UTC c906c2337058bd467e6ac0176c2966d1eeb6f8f5
1 file changed +1 -2
hw/i386/vapic.c
+1 -2
@@ -716,8 +716,7 @@ static void vapic_write(void *opaque, hwaddr addr, uint64_t data,
716 break;
717 default:
718 case 4:
719 - if ((kvm_enabled() && !kvm_irqchip_in_kernel())
720 - || (whpx_enabled() && !whpx_irqchip_in_kernel())) {
719 + if (!kvm_irqchip_in_kernel() && !whpx_irqchip_in_kernel()) {
720 apic_poll_irq(cpu->apic_state);
721 }
722 break;