The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2 0/4] KVM: SVM: Fix IRQ window inhibit handling
@ 2026-01-23 22:45 Sean Christopherson
  2026-01-23 22:45 ` [PATCH v2 1/4] KVM: SVM: Fix clearing IRQ window inhibit with nested guests Sean Christopherson
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Sean Christopherson @ 2026-01-23 22:45 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini; +Cc: kvm, linux-kernel, Naveen N Rao

Patch 1 fixes a bugs where KVM will keep AVIC inhibit for too long when
running a nested guest and AVIC is inhibited to open an IRQ window.

Patch 2 refcounts IRQ window inhibits so that "closing" an IRQ window on
one vCPU doesn't clobber other vCPUs' windows when AVIC is enabled.

Patch 3 optimizes IRQ window inhibits by avoiding contention on
apicv_update_lock when KVM wants to inhibit AVIC to open an IRQ windows
because AVIC is _already_ inhibited.

Patch 4 further optimizes IRQ window inhibits by isolating the refcount
and the lock in their own cacheline, e.g. to avoid false sharing and cache
line contention with things like apicv_inhibit_reasons, which is read on
every VM-Enter.

v2:
 - Formalize the SoB chains (thanks Naveen!)
 - Explicitly isolate the write-mostly fields with ____cacheline_aligned.
 - Add Naveen's Tested-by tags.

v1 / RFC: https://lore.kernel.org/all/cover.1752819570.git.naveen@kernel.org

Original: https://lore.kernel.org/all/cover.1738595289.git.naveen@kernel.org

Sean Christopherson (4):
  KVM: SVM: Fix clearing IRQ window inhibit with nested guests
  KVM: SVM: Fix IRQ window inhibit handling across multiple vCPUs
  KVM: SVM: Optimize IRQ window inhibit handling
  KVM: Isolate apicv_update_lock and apicv_nr_irq_window_req in a
    cacheline

 arch/x86/include/asm/kvm_host.h | 29 +++++++++++++++-
 arch/x86/kvm/svm/svm.c          | 60 ++++++++++++++++++++-------------
 arch/x86/kvm/svm/svm.h          |  1 +
 arch/x86/kvm/x86.c              | 45 ++++++++++++++++++++++++-
 4 files changed, 110 insertions(+), 25 deletions(-)


base-commit: e81f7c908e1664233974b9f20beead78cde6343a
-- 
2.52.0.457.g6b5491de43-goog


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-03-05 17:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-23 22:45 [PATCH v2 0/4] KVM: SVM: Fix IRQ window inhibit handling Sean Christopherson
2026-01-23 22:45 ` [PATCH v2 1/4] KVM: SVM: Fix clearing IRQ window inhibit with nested guests Sean Christopherson
2026-01-23 22:45 ` [PATCH v2 2/4] KVM: SVM: Fix IRQ window inhibit handling across multiple vCPUs Sean Christopherson
2026-01-23 22:45 ` [PATCH v2 3/4] KVM: SVM: Optimize IRQ window inhibit handling Sean Christopherson
2026-01-23 22:45 ` [PATCH v2 4/4] KVM: Isolate apicv_update_lock and apicv_nr_irq_window_req in a cacheline Sean Christopherson
2026-03-05 17:08 ` [PATCH v2 0/4] KVM: SVM: Fix IRQ window inhibit handling Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox