[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260123224514.2509129-1-seanjc@google.com>
Date: Fri, 23 Jan 2026 14:45:10 -0800
From: Sean Christopherson <seanjc@...gle.com>
To: Sean Christopherson <seanjc@...gle.com>, Paolo Bonzini <pbonzini@...hat.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
Naveen N Rao <naveen@...nel.org>
Subject: [PATCH v2 0/4] KVM: SVM: Fix IRQ window inhibit handling
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
Powered by blists - more mailing lists