Re: [PATCH 12/22] arm64: mte: Add specific SIGSEGV codes

From
Arnd Bergmann <arnd@arndb.de>
Date
2019-12-11 19:31:49
Also in
linux-arch, linux-mm
Reply to
Catalin Marinas, 2019-12-11
On Wed, Dec 11, 2019 at 7:40 PM Catalin Marinas [off-list ref] wrote:
quoted hunk ↗ jump to hunk
From: Vincenzo Frascino <vincenzo.frascino@arm.com>

Add MTE-specific SIGSEGV codes to siginfo.h.

Note that the for MTE we are reusing the same SPARC ADI codes because
the two functionalities are similar and they cannot coexist on the same
system.

Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
[catalin.marinas@arm.com: renamed precise/imprecise to sync/async]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
---
 include/uapi/asm-generic/siginfo.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/include/uapi/asm-generic/siginfo.h b/include/uapi/asm-generic/siginfo.h
index cb3d6c267181..a5184a5438c6 100644
--- a/include/uapi/asm-generic/siginfo.h
+++ b/include/uapi/asm-generic/siginfo.h
@@ -227,8 +227,13 @@ typedef struct siginfo {
 # define SEGV_PKUERR   4       /* failed protection key checks */
 #endif
 #define SEGV_ACCADI    5       /* ADI not enabled for mapped object */
-#define SEGV_ADIDERR   6       /* Disrupting MCD error */
-#define SEGV_ADIPERR   7       /* Precise MCD exception */
+#ifdef __aarch64__
+# define SEGV_MTEAERR  6       /* Asynchronous MTE error */
+# define SEGV_MTESERR  7       /* Synchronous MTE exception */
+#else
+# define SEGV_ADIDERR  6       /* Disrupting MCD error */
+# define SEGV_ADIPERR  7       /* Precise MCD exception */
+#endif
SEGV_ADIPERR/SEGV_ADIDERR were added together with SEGV_ACCADI,
it seems a bit odd to make only two of them conditional but not the others.

I think we are generally working towards having the same constants
across architectures even for features that only exist on one of them.

Adding Al and Eric to Cc, maybe they have another suggestion on what
constants should be used.

     Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thread (45 messages) 45 messages, 5 authors, last reply 2020-02-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help