]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
KVM: x86: Move definition of X2APIC_MSR() to lapic.h
authorSean Christopherson <seanjc@google.com>
Tue, 10 Jun 2025 22:57:22 +0000 (15:57 -0700)
committerSean Christopherson <seanjc@google.com>
Fri, 20 Jun 2025 20:07:28 +0000 (13:07 -0700)
Dedup the definition of X2APIC_MSR and put it in the local APIC code
where it belongs.

No functional change intended.

Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Link: https://lore.kernel.org/r/20250610225737.156318-18-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/lapic.h
arch/x86/kvm/svm/svm.c
arch/x86/kvm/vmx/vmx.h

index 4ce30db6582814a52f3ef2812683e3ff8ce42cd4..4518b4e0552ff35d9b3ec76331a401a04f2859db 100644 (file)
@@ -21,6 +21,8 @@
 #define APIC_BROADCAST                 0xFF
 #define X2APIC_BROADCAST               0xFFFFFFFFul
 
+#define X2APIC_MSR(r) (APIC_BASE_MSR + ((r) >> 4))
+
 enum lapic_mode {
        LAPIC_MODE_DISABLED = 0,
        LAPIC_MODE_INVALID = X2APIC_ENABLE,
index 6e7040f86e9e1735405f09eee2dc0ec619ab15f8..89df3b5ddde5c514a87e62ab527d8c7cb5254bf7 100644 (file)
@@ -82,8 +82,6 @@ static uint64_t osvw_len = 4, osvw_status;
 
 static DEFINE_PER_CPU(u64, current_tsc_ratio);
 
-#define X2APIC_MSR(x)  (APIC_BASE_MSR + (x >> 4))
-
 static const u32 direct_access_msrs[] = {
        MSR_STAR,
        MSR_IA32_SYSENTER_CS,
index 076af78af15118219104ce0db56a8ecbb03f9900..32053ece7797b952f232bcecc6c9c40cbb777e1d 100644 (file)
@@ -19,8 +19,6 @@
 #include "../mmu.h"
 #include "common.h"
 
-#define X2APIC_MSR(r) (APIC_BASE_MSR + ((r) >> 4))
-
 #ifdef CONFIG_X86_64
 #define MAX_NR_USER_RETURN_MSRS        7
 #else