]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
linux-user/aarch64: Inject SIGSEGV for GCS faults
authorRichard Henderson <richard.henderson@linaro.org>
Wed, 8 Oct 2025 21:56:08 +0000 (14:56 -0700)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 10 Oct 2025 12:19:11 +0000 (13:19 +0100)
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20251008215613.300150-69-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
linux-user/aarch64/cpu_loop.c
linux-user/aarch64/target_signal.h

index 50a4c99535d3be2f3b55b6f481c6e937c0a560a2..7f66a879ea98d6042f526d82c51460e189f8eb75 100644 (file)
@@ -89,6 +89,11 @@ static void signal_for_exception(CPUARMState *env, vaddr addr)
         si_code = TARGET_ILL_ILLOPN;
         break;
 
+    case EC_GCS:
+        si_signo = TARGET_SIGSEGV;
+        si_code = TARGET_SEGV_CPERR;
+        break;
+
     case EC_MOP:
         /*
          * FIXME: The kernel fixes up wrong-option exceptions.
index 6f66a50bfd2a64fa5b69876d943a94bc05689a83..e509ac10327b0024515e52e3e7b14bb645d7beba 100644 (file)
@@ -7,6 +7,7 @@
 
 #define TARGET_SEGV_MTEAERR  8  /* Asynchronous ARM MTE error */
 #define TARGET_SEGV_MTESERR  9  /* Synchronous ARM MTE exception */
+#define TARGET_SEGV_CPERR   10  /* Control protection fault */
 
 #define TARGET_ARCH_HAS_SETUP_FRAME
 #define TARGET_ARCH_HAS_SIGTRAMP_PAGE 1