aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/apic.h
diff options
context:
space:
mode:
authorNeeraj Upadhyay <[email protected]>2025-07-09 03:32:19 +0000
committerSean Christopherson <[email protected]>2025-07-10 16:44:43 +0000
commitfe954bcd577e703acdef597903079c991740f6bf (patch)
tree36d22c75b5ce1384b5d9a716ab7d3a3ad40c3c69 /arch/x86/include/asm/apic.h
parentx86/apic: KVM: Move lapic get/set helpers to common code (diff)
downloadkernel-fe954bcd577e703acdef597903079c991740f6bf.tar.gz
kernel-fe954bcd577e703acdef597903079c991740f6bf.zip
x86/apic: KVM: Move lapic set/clear_vector() helpers to common code
Move apic_clear_vector() and apic_set_vector() helper functions to apic.h in order to reuse them in the Secure AVIC guest APIC driver in later patches to atomically set/clear vectors 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]>
Diffstat (limited to 'arch/x86/include/asm/apic.h')
-rw-r--r--arch/x86/include/asm/apic.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index b8b5fe875bde..c6d1c51f71ec 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -547,6 +547,16 @@ static __always_inline void apic_set_reg64(void *regs, int reg, u64 val)
*((u64 *) (regs + reg)) = val;
}
+static inline void apic_clear_vector(int vec, void *bitmap)
+{
+ clear_bit(APIC_VECTOR_TO_BIT_NUMBER(vec), bitmap + APIC_VECTOR_TO_REG_OFFSET(vec));
+}
+
+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));
+}
+
/*
* Warm reset vector position:
*/