]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen/arm64: Hide FEAT_SME
authorJulien Grall <julien@xen.org>
Wed, 14 Aug 2024 21:00:54 +0000 (22:00 +0100)
committerJulien Grall <jgrall@amazon.com>
Thu, 22 Aug 2024 10:09:42 +0000 (11:09 +0100)
Newer hardware may support FEAT_SME. Xen doesn't have any knowledge but
it will still expose the feature to the VM. If the OS is trying to use
SME, then it will crash.

Solve by hiding FEAT_SME.

Signed-off-by: Julien Grall <julien@xen.org>
Acked-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
xen/arch/arm/cpufeature.c
xen/arch/arm/include/asm/cpufeature.h

index ef77473bf8e343fd725583e12a3fd5d0b32898f6..b45dbe3c668d884711707e358547f28e65f05901 100644 (file)
@@ -208,6 +208,9 @@ static int __init create_domain_cpuinfo(void)
     domain_cpuinfo.pfr64.sve = 0;
     domain_cpuinfo.zfr64.bits[0] = 0;
 
+    /* Hide SMT support as Xen does not support it */
+    domain_cpuinfo.pfr64.sme = 0;
+
     /* Hide MTE support as Xen does not support it */
     domain_cpuinfo.pfr64.mte = 0;
 
index c95582044a8a488d99f5de9b31f827cd14c878da..969e043f5bdaced4dec5272727f50ad9161883ab 100644 (file)
@@ -207,7 +207,9 @@ struct cpuinfo_arm {
             unsigned long mte:4;
             unsigned long ras_frac:4;
             unsigned long mpam_frac:4;
-            unsigned long __res1:44;
+            unsigned long __res1:4;
+            unsigned long sme:4;
+            unsigned long __res2:36;
         };
     } pfr64;