[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAdeq_KK_eChRpPUOrw3XaKXJj+abg63rYfNc4A+dTdKKN1M6A@mail.gmail.com>
Date: Tue, 12 Aug 2025 18:08:33 +0800
From: hugo lee <cs.hugolee@...il.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: pbonzini@...hat.com, tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, hpa@...or.com, x86@...nel.org,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
Yuguo Li <hugoolli@...cent.com>
Subject: Re: [PATCH] KVM: x86: Synchronize APIC State with QEMU when irqchip=split
On Tue, Aug 12, 2025, Sean Christopherson <seanjc@...gle.com> wrote:
>
> On Fri, Aug 08, 2025, hugo lee wrote:
> > On Fri, Aug 8, 2025, Sean Christopherson <seanjc@...gle.com> wrote:
> > >
> > > On Thu, Aug 07, 2025, hugo lee wrote:
> > > > On Thu, Aug 7, 2025 Sean Christopherson wrote:
> > > > >
> > > > > On Wed, Aug 06, 2025, Yuguo Li wrote:
> > > > > > When using split irqchip mode, IOAPIC is handled by QEMU while the LAPIC is
> > > > > > emulated by KVM. When guest disables LINT0, KVM doesn't exit to QEMU for
> > > > > > synchronization, leaving IOAPIC unaware of this change. This may cause vCPU
> > > > > > to be kicked when external devices(e.g. PIT)keep sending interrupts.
> > > > >
> > > > > I don't entirely follow what the problem is. Is the issue that QEMU injects an
> > > > > IRQ that should have been blocked? Or is QEMU forcing the vCPU to exit unnecessarily?
> > > > >
> > > >
> > > > This issue is about QEMU keeps injecting should-be-blocked
> > > > (blocked by guest and qemu just doesn't know that) IRQs.
> > > > As a result, QEMU forces vCPU to exit unnecessarily.
> > >
> > > Is the problem that the guest receives spurious IRQs, or that QEMU is forcing
> > > unnecesary exits, i.e hurting performance?
> > >
> >
> > It is QEMU is forcing unnecessary exits which will hurt performance by
> > trying to require the Big QEMU Lock in qemu_wait_io_event.
>
> Please elaborate on the performance impact and why the issue can't be solved in
> QEMU.
On some legacy bios images using guests, they may disable PIT
after booting.
When irqchip=split is on, qemu will keep kicking the guest and try to
get the Big QEMU Lock.
This could be solved in QEMU by guessing when to synchronize,
since QEMU doesn't know what's happening on the LAPIC in the kernel.
It can do synchronize in every qemu_cpu_kick which could also
cause unnecessary syncs and influence the performance.
So I think it is more reasonable to synchronize by the writer
than guessing in QEMU.
Powered by blists - more mailing lists