Thread (4 messages) 4 messages, 2 authors, 2021-09-15

[PATCH v2 1/2] arm64: add an MTE support check to the top of mte_thread_switch()

flat view
STALE1857d

From: Peter Collingbourne <hidden>
Date: 2021-09-14 21:56:35
Subsystem: arm64 port (aarch64 architecture), the rest · Maintainers: Catalin Marinas, Will Deacon, Linus Torvalds

This lets us avoid doing unnecessary work on hardware that does
not support MTE, and will allow us to freely use MTE instructions
in the code called by mte_thread_switch().

Signed-off-by: Peter Collingbourne <redacted>
Link: https://linux-review.googlesource.com/id/I02fd000d1ef2c86c7d2952a7f099b254ec227a5d
---
 arch/arm64/kernel/mte.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/arch/arm64/kernel/mte.c b/arch/arm64/kernel/mte.c
index 9d314a3bad3b..8fc2d90eeb00 100644
--- a/arch/arm64/kernel/mte.c
+++ b/arch/arm64/kernel/mte.c
@@ -199,6 +199,9 @@ void mte_thread_init_user(void)
 
 void mte_thread_switch(struct task_struct *next)
 {
+	if (!system_supports_mte())
+		return;
+
 	mte_update_sctlr_user(next);
 
 	/*
-- 
2.33.0.309.g3052b89438-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help