aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic/apic.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2021-01-15 14:03:53 -0800
committerPaolo Bonzini <pbonzini@redhat.com>2021-02-04 05:27:22 -0500
commitdb7d8e476821df85dce0cfd1e654c72c7db879dc (patch)
tree99210d85ddac21209e9556a1390b7747d05d6a96 /arch/x86/kernel/apic/apic.c
parentKVM: X86: Add the Document for KVM_CAP_X86_BUS_LOCK_EXIT (diff)
downloadlinux-dev-db7d8e476821df85dce0cfd1e654c72c7db879dc.tar.xz
linux-dev-db7d8e476821df85dce0cfd1e654c72c7db879dc.zip
x86/apic: Export x2apic_mode for use by KVM in "warm" path
Export x2apic_mode so that KVM can query whether x2APIC is active without having to incur the RDMSR in x2apic_enabled(). When Posted Interrupts are in use for a guest with an assigned device, KVM ends up checking for x2APIC at least once every time a vCPU halts. KVM could obviously snapshot x2apic_enabled() to avoid the RDMSR, but that's rather silly given that x2apic_mode holds the exact info needed by KVM. Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20210115220354.434807-2-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kernel/apic/apic.c')
-rw-r--r--arch/x86/kernel/apic/apic.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 6bd20c0de8bc..dea2b44966ca 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1743,6 +1743,7 @@ void apic_ap_setup(void)
#ifdef CONFIG_X86_X2APIC
int x2apic_mode;
+EXPORT_SYMBOL_GPL(x2apic_mode);
enum {
X2APIC_OFF,