hw/i386/vapic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
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>
---
hw/i386/vapic.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/hw/i386/vapic.c b/hw/i386/vapic.c
index 41e5ca26df..1acb9f91b2 100644
--- a/hw/i386/vapic.c
+++ b/hw/i386/vapic.c
@@ -716,8 +716,7 @@ static void vapic_write(void *opaque, hwaddr addr, uint64_t data,
break;
default:
case 4:
- if ((kvm_enabled() && !kvm_irqchip_in_kernel())
- || (whpx_enabled() && !whpx_irqchip_in_kernel())) {
+ if (!kvm_irqchip_in_kernel() && !whpx_irqchip_in_kernel()) {
apic_poll_irq(cpu->apic_state);
}
break;
--
2.53.0
> On 18. Apr 2026, at 08:14, rickgcn <rickgcn@gmail.com> wrote:
>
> 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>
> ---
> hw/i386/vapic.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/hw/i386/vapic.c b/hw/i386/vapic.c
> index 41e5ca26df..1acb9f91b2 100644
> --- a/hw/i386/vapic.c
> +++ b/hw/i386/vapic.c
> @@ -716,8 +716,7 @@ static void vapic_write(void *opaque, hwaddr addr, uint64_t data,
> break;
> default:
> case 4:
> - if ((kvm_enabled() && !kvm_irqchip_in_kernel())
> - || (whpx_enabled() && !whpx_irqchip_in_kernel())) {
> + if (!kvm_irqchip_in_kernel() && !whpx_irqchip_in_kernel()) {
Hi,
I think we want to keep the kvm_enabled/whpx_enabled checks.
How does this sound?
if (!(kvm_enabled() && kvm_irqchip_in_kernel())
|| !(whpx_enabled() && whpx_irqchip_in_kernel())) {
Or
if ((kvm_enabled() && !kvm_irqchip_in_kernel())
|| (whpx_enabled() && !whpx_irqchip_in_kernel())
|| tcg_enabled()) {
Thank you,
On Sun, Apr 19, 2026 at 1:14 AM Mohamed Mediouni
<mohamed@unpredictable.fr> wrote:
>
>
>
> > On 18. Apr 2026, at 08:14, rickgcn <rickgcn@gmail.com> wrote:
> >
> > 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>
> > ---
> > hw/i386/vapic.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/hw/i386/vapic.c b/hw/i386/vapic.c
> > index 41e5ca26df..1acb9f91b2 100644
> > --- a/hw/i386/vapic.c
> > +++ b/hw/i386/vapic.c
> > @@ -716,8 +716,7 @@ static void vapic_write(void *opaque, hwaddr addr, uint64_t data,
> > break;
> > default:
> > case 4:
> > - if ((kvm_enabled() && !kvm_irqchip_in_kernel())
> > - || (whpx_enabled() && !whpx_irqchip_in_kernel())) {
> > + if (!kvm_irqchip_in_kernel() && !whpx_irqchip_in_kernel()) {
>
> Hi,
>
> I think we want to keep the kvm_enabled/whpx_enabled checks.
No, it's not needed. If kvm_enabled() is false either the checks are
compiled out or the variable is false.
The check is for "is it using the userspace APIC", so rickgcn's patch
is correct.
Paolo
> How does this sound?
>
> if (!(kvm_enabled() && kvm_irqchip_in_kernel())
> || !(whpx_enabled() && whpx_irqchip_in_kernel())) {
>
> Or
>
> if ((kvm_enabled() && !kvm_irqchip_in_kernel())
> || (whpx_enabled() && !whpx_irqchip_in_kernel())
> || tcg_enabled()) {
>
> Thank you,
>
© 2016 - 2026 Red Hat, Inc.