Skip to contentSkip to conversation

x86/acrn: Allow ACRN guest to use X2APIC mode

PATCH Applied Shuo Liu 2 participants 3 messages Aug 6, 2020 x86

lore
Share & tools
lore

Shuo Liu

author
#0 lore raw

PATCH 1/1 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.

Cc Dave Hansen <[email protected]>
Cc Sean Christopherson <[email protected]>
Cc Dan Williams <[email protected]>
Cc Fengwei Yin <[email protected]>
Cc Zhi Wang <[email protected]>
Cc Zhenyu Wang <[email protected]>
Cc Yu Wang <[email protected]>
Cc Reinette Chatre <[email protected]>
---
 arch/x86/kernel/cpu/acrn.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
arch/x86/kernel/cpu/acrn.c +2 -6
index 1da9b1c9a2db..3b08cdfc6514 100644
@@ -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);

base-commit: 48778464bb7d346b47157d21ffde2af6b2d39110

Signature · 1 line
2.28.0
merge bot Applied
#1 lore raw
The following commit has been merged into the x86/urgent branch of tip:

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     f75576c4818fdf344691ca5b791f42bf3878c3a8
Gitweb:        https://git.kernel.org/tip/f75576c4818fdf344691ca5b791f42bf3878c3a8
Author:        Shuo Liu <[email protected]>
AuthorDate:    Thu, 06 Aug 2020 19:38:02 +08:00
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Thu, 06 Aug 2020 15:20:17 +02:00

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.

---
 arch/x86/kernel/cpu/acrn.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
arch/x86/kernel/cpu/acrn.c +2 -6
index 1da9b1c..3b08cdf 100644
@@ -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);
merge bot Applied
#2 lore raw
In reply to Shuo Liu
The following commit has been merged into the x86/urgent branch of tip:

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     86d709ce30eaa65706090865662a08d7bdd30c54
Gitweb:        https://git.kernel.org/tip/86d709ce30eaa65706090865662a08d7bdd30c54
Author:        Shuo Liu <[email protected]>
AuthorDate:    Thu, 06 Aug 2020 19:38:02 +08:00
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Fri, 07 Aug 2020 01:32:00 +02:00

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.

---
 arch/x86/kernel/cpu/acrn.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
arch/x86/kernel/cpu/acrn.c +2 -6
index 1da9b1c..3b08cdf 100644
@@ -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);