]> xenbits.xensource.com Git - xen.git/commitdiff
xen/arm: Add ECBHB and CLEARBHB ID fields
authorBertrand Marquis <bertrand.marquis@arm.com>
Wed, 23 Feb 2022 09:42:18 +0000 (09:42 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 8 Mar 2022 17:12:50 +0000 (17:12 +0000)
Introduce ID coprocessor register ID_AA64ISAR2_EL1.
Add definitions in cpufeature and sysregs of ECBHB field in mmfr1 and
CLEARBHB in isar2 ID coprocessor registers.

This is part of XSA-398 / CVE-2022-23960.

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Acked-by: Julien Grall <julien@xen.org>
(cherry picked from commit 4b68d12d98b8790d8002fcc2c25a9d713374a4d7)

xen/arch/arm/cpufeature.c
xen/include/asm-arm/arm64/sysregs.h
xen/include/asm-arm/cpufeature.h

index 44126dbf072343540111aaa8dfd612bd5fd9c801..13dac7ccaf9463f5abf22240b9afa8e9a27bd60e 100644 (file)
@@ -117,6 +117,7 @@ void identify_cpu(struct cpuinfo_arm *c)
 
         c->isa64.bits[0] = READ_SYSREG64(ID_AA64ISAR0_EL1);
         c->isa64.bits[1] = READ_SYSREG64(ID_AA64ISAR1_EL1);
+        c->isa64.bits[2] = READ_SYSREG64(ID_AA64ISAR2_EL1);
 #endif
 
         c->pfr32.bits[0] = READ_SYSREG32(ID_PFR0_EL1);
index 08585a969ebd92860ccb21ee0fc9423e3ab55024..5f1e9b998f3371dfaef9f21be1c02dbbef10f137 100644 (file)
 #define ICH_AP1R2_EL2             __AP1Rx_EL2(2)
 #define ICH_AP1R3_EL2             __AP1Rx_EL2(3)
 
+#ifndef ID_AA64ISAR2_EL1
+#define ID_AA64ISAR2_EL1            S3_0_C0_C6_2
+#endif
+
 /* Access to system registers */
 
 #define READ_SYSREG32(name) ({                          \
index 60e677d8420035268a39b23a77d0475134dea6a4..c748fc17fe661c6b3f626ae238600be70c64c281 100644 (file)
@@ -182,12 +182,26 @@ struct cpuinfo_arm {
             unsigned long lo:4;
             unsigned long pan:4;
             unsigned long __res1:8;
-            unsigned long __res2:32;
+            unsigned long __res2:28;
+            unsigned long ecbhb:4;
         };
     } mm64;
 
-    struct {
-        uint64_t bits[2];
+    union {
+        uint64_t bits[3];
+        struct {
+            /* ISAR0 */
+            unsigned long __res0:64;
+
+            /* ISAR1 */
+            unsigned long __res1:64;
+
+            /* ISAR2 */
+            unsigned long __res3:28;
+            unsigned long clearbhb:4;
+
+            unsigned long __res4:32;
+        };
     } isa64;
 
 #endif