aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeeraj Upadhyay <[email protected]>2025-07-09 03:32:20 +0000
committerSean Christopherson <[email protected]>2025-07-10 16:44:43 +0000
commit17776e6c203bd3a9be795fb0a2fd72191a201ac9 (patch)
tree1532d364ac09401f8e921ee38a3f8fdeae274b7b
parentx86/apic: KVM: Move lapic set/clear_vector() helpers to common code (diff)
downloadkernel-17776e6c203bd3a9be795fb0a2fd72191a201ac9.tar.gz
kernel-17776e6c203bd3a9be795fb0a2fd72191a201ac9.zip
x86/apic: KVM: Move apic_test)vector() to common code
Move apic_test_vector() to apic.h in order to reuse it in the Secure AVIC guest APIC driver in later patches to test vector state in the APIC backing page. No functional change intended. Signed-off-by: Neeraj Upadhyay <[email protected]> Acked-by: Sean Christopherson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
-rw-r--r--arch/x86/include/asm/apic.h5
-rw-r--r--arch/x86/kvm/lapic.c5
2 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index c6d1c51f71ec..34e9b43d8940 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -557,6 +557,11 @@ static inline void apic_set_vector(int vec, void *bitmap)
set_bit(APIC_VECTOR_TO_BIT_NUMBER(vec), bitmap + APIC_VECTOR_TO_REG_OFFSET(vec));
}
+static inline int apic_test_vector(int vec, void *bitmap)
+{
+ return test_bit(APIC_VECTOR_TO_BIT_NUMBER(vec), bitmap + APIC_VECTOR_TO_REG_OFFSET(vec));
+}
+
/*
* Warm reset vector position:
*/
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index a065db3db02d..241b3535cb4f 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -93,11 +93,6 @@ static __always_inline void kvm_lapic_set_reg64(struct kvm_lapic *apic,
apic_set_reg64(apic->regs, reg, val);
}
-static inline int apic_test_vector(int vec, void *bitmap)
-{
- return test_bit(APIC_VECTOR_TO_BIT_NUMBER(vec), bitmap + APIC_VECTOR_TO_REG_OFFSET(vec));
-}
-
bool kvm_apic_pending_eoi(struct kvm_vcpu *vcpu, int vector)
{
struct kvm_lapic *apic = vcpu->arch.apic;