Skip to content

Commit

Permalink
x86/acrn: Allow ACRN guest to use X2APIC mode
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Shuo Liu authored and Ingo Molnar committed Aug 6, 2020
1 parent 7b4ea94 commit 86d709c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions arch/x86/kernel/cpu/acrn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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);
Expand Down

0 comments on commit 86d709c

Please sign in to comment.