]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/arm: GPT_Secure is reserved without FEAT_SEL2
authorRichard Henderson <richard.henderson@linaro.org>
Fri, 26 Sep 2025 00:11:29 +0000 (17:11 -0700)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 7 Oct 2025 10:26:10 +0000 (11:26 +0100)
For GPT_Secure, if SEL2 is not enabled, raise a GPCF_Walk exception.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20250926001134.295547-6-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/ptw.c

index 1cafe8f4f7bd63685faf8fa188aee51c936e8bdb..3df5d4da12f1d0556d665280755731e194305505 100644 (file)
@@ -478,10 +478,14 @@ static bool granule_protection_check(CPUARMState *env, uint64_t paddress,
         break;
     case 0b1111: /* all access */
         return true;
-    case 0b1000:
-    case 0b1001:
-    case 0b1010:
-    case 0b1011:
+    case 0b1000: /* secure */
+        if (!cpu_isar_feature(aa64_sel2, cpu)) {
+            goto fault_walk;
+        }
+        /* fall through */
+    case 0b1001: /* non-secure */
+    case 0b1010: /* root */
+    case 0b1011: /* realm */
         if (pspace == (gpi & 3)) {
             return true;
         }