KVM: x86: Move definition of X2APIC_MSR() to lapic.h

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>
This commit is contained in:
Sean Christopherson 2025-06-10 15:57:22 -07:00
parent cb53d07948
commit 405a63d4d3
3 changed files with 2 additions and 4 deletions

View 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,

View 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,

View 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