From mboxrd@z Thu Jan 1 00:00:00 1970 From: yakui.zhao@intel.com (Zhao Yakui) Date: Fri, 16 Aug 2019 10:25:42 +0800 Subject: [RFC PATCH 01/15] x86/acrn: Report X2APIC for ACRN guest In-Reply-To: <1565922356-4488-1-git-send-email-yakui.zhao@intel.com> References: <1565922356-4488-1-git-send-email-yakui.zhao@intel.com> Message-ID: <1565922356-4488-2-git-send-email-yakui.zhao@intel.com> List-Id: Linux Driver Project Developer List After lapic is switched from xapic to x2apic mode, it can use the APIC MSR register to access local apic register in ACRN guest. This will help to remove some traps of lapic access in ACRN guest. Report the X2APIC so that the ACRN guest can be switched to x2apic mode. Co-developed-by: Jason Chen CJ Signed-off-by: Jason Chen CJ Signed-off-by: Zhao Yakui --- arch/x86/kernel/cpu/acrn.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/cpu/acrn.c b/arch/x86/kernel/cpu/acrn.c index 676022e..95db5c4 100644 --- a/arch/x86/kernel/cpu/acrn.c +++ b/arch/x86/kernel/cpu/acrn.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -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); -- 2.7.4