Skip to content

Commit 86d709c

Browse files
Shuo LiuIngo Molnar
authored andcommitted
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 <[email protected]> Signed-off-by: Shuo Liu <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 7b4ea94 commit 86d709c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

arch/x86/kernel/cpu/acrn.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include <linux/interrupt.h>
1313
#include <asm/apic.h>
14+
#include <asm/cpufeatures.h>
1415
#include <asm/desc.h>
1516
#include <asm/hypervisor.h>
1617
#include <asm/idtentry.h>
@@ -29,12 +30,7 @@ static void __init acrn_init_platform(void)
2930

3031
static bool acrn_x2apic_available(void)
3132
{
32-
/*
33-
* x2apic is not supported for now. Future enablement will have to check
34-
* X86_FEATURE_X2APIC to determine whether x2apic is supported in the
35-
* guest.
36-
*/
37-
return false;
33+
return boot_cpu_has(X86_FEATURE_X2APIC);
3834
}
3935

4036
static void (*acrn_intr_handler)(void);

0 commit comments

Comments
 (0)