From: Sean Christopherson <seanjc@google.com>
To: Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Naveen N Rao <naveen@kernel.org>
Subject: [PATCH v2 0/4] KVM: SVM: Fix IRQ window inhibit handling
Date: Fri, 23 Jan 2026 14:45:10 -0800 [thread overview]
Message-ID: <20260123224514.2509129-1-seanjc@google.com> (raw)
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
next reply other threads:[~2026-01-23 22:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-23 22:45 Sean Christopherson [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260123224514.2509129-1-seanjc@google.com \
--to=seanjc@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=naveen@kernel.org \
--cc=pbonzini@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox