summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorShuo Liu <shuo.a.liu@intel.com>2020-08-06 19:38:02 +0800
committerIngo Molnar <mingo@kernel.org>2020-08-07 01:32:00 +0200
commit86d709ce30eaa65706090865662a08d7bdd30c54 (patch)
tree747b38e17b4f5a4b905ef4c8ac50d317df270391 /arch/x86
parent7b4ea9456dd3f73238408126ab00f1d906963d81 (diff)
downloadlinux-stable-86d709ce30eaa65706090865662a08d7bdd30c54.tar.gz
linux-stable-86d709ce30eaa65706090865662a08d7bdd30c54.tar.bz2
linux-stable-86d709ce30eaa65706090865662a08d7bdd30c54.zip
x86/acrn: Allow ACRN guest to use X2APIC mode
The ACRN Hypervisor did not support x2APIC and thus x2APIC support was disabled by always returning false when VM checked for x2APIC support. ACRN received full support of x2APIC and exports the capability through CPUID feature bits. Let VM decide if it needs to switch to x2APIC mode according to CPUID features. Originally-by: Yakui Zhao <yakui.zhao@intel.com> Signed-off-by: Shuo Liu <shuo.a.liu@intel.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Link: https://lore.kernel.org/r/20200806113802.9325-1-shuo.a.liu@intel.com
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/cpu/acrn.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/acrn.c b/arch/x86/kernel/cpu/acrn.c
index 1da9b1c9a2db..3b08cdfc6514 100644
--- a/arch/x86/kernel/cpu/acrn.c
+++ b/arch/x86/kernel/cpu/acrn.c
@@ -11,6 +11,7 @@
#include <linux/interrupt.h>
#include <asm/apic.h>
+#include <asm/cpufeatures.h>
#include <asm/desc.h>
#include <asm/hypervisor.h>
#include <asm/idtentry.h>
@@ -29,12 +30,7 @@ static void __init acrn_init_platform(void)
static bool acrn_x2apic_available(void)
{
- /*
- * x2apic is not supported for now. Future enablement will have to check
- * X86_FEATURE_X2APIC to determine whether x2apic is supported in the
- * guest.
- */
- return false;
+ return boot_cpu_has(X86_FEATURE_X2APIC);
}
static void (*acrn_intr_handler)(void);