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,
Amirmohammad Eftekhar <amirmohammad.eftekhar@cispa.de>
Subject: [PATCH v2 2/2] KVM: x86: Consolidate invocations of kvm_x86_ops.load_eoi_exitmap()
Date: Wed, 21 Oct 2026 19:28:13 -0700 [thread overview]
Message-ID: <20261022022813.303978-3-seanjc@google.com> (raw)
In-Reply-To: <20261022022813.303978-1-seanjc@google.com>
Rework KVM's handling of EOI exit bitmap updates to consolidate the calls
to vendor code so that it's easier to see that the Hyper-V path is doing
the exact same thing, just with extra input to account for the SynIC
vectors.
No functional change intended.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
arch/x86/kvm/x86.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 0028d57e964a..483dac323c8e 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -8047,6 +8047,9 @@ EXPORT_SYMBOL_FOR_KVM_INTERNAL(kvm_inc_or_dec_irq_window_inhibit);
static void vcpu_scan_ioapic(struct kvm_vcpu *vcpu)
{
+ unsigned long *eoi_exit_bitmap = vcpu->arch.ioapic_handled_vectors;
+ DECLARE_BITMAP(__eoi_exit_bitmap, 256) __maybe_unused;
+
if (!kvm_apic_present(vcpu))
return;
@@ -8064,17 +8067,14 @@ static void vcpu_scan_ioapic(struct kvm_vcpu *vcpu)
#ifdef CONFIG_KVM_HYPERV
if (to_hv_vcpu(vcpu)) {
- u64 eoi_exit_bitmap[4];
-
- bitmap_or((ulong *)eoi_exit_bitmap,
+ bitmap_or(__eoi_exit_bitmap,
vcpu->arch.ioapic_handled_vectors,
to_hv_synic(vcpu)->vec_bitmap, 256);
- kvm_x86_call(load_eoi_exitmap)(vcpu, eoi_exit_bitmap);
- return;
+
+ eoi_exit_bitmap = __eoi_exit_bitmap;
}
#endif
- kvm_x86_call(load_eoi_exitmap)(
- vcpu, (u64 *)vcpu->arch.ioapic_handled_vectors);
+ kvm_x86_call(load_eoi_exitmap)(vcpu, (u64 *)eoi_exit_bitmap);
}
void kvm_arch_guest_memory_reclaimed(struct kvm *kvm)
--
2.56.0.218.g1ec904b173-goog
prev parent reply other threads:[~2026-10-22 2:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 2:28 [PATCH v2 0/2] KVM: x86: Drop deferred updates of EOI bitmaps Sean Christopherson
2026-10-22 2:28 ` [PATCH v2 1/2] KVM: x86: Switch to vmcs01 to update EOI exiting bitmap on-demand if L2 is active Sean Christopherson
2026-10-22 2:28 ` Sean Christopherson [this message]
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=20261022022813.303978-3-seanjc@google.com \
--to=seanjc@google.com \
--cc=amirmohammad.eftekhar@cispa.de \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.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
all inboxes | Powered by JetHome®