Skip to contentSkip to conversation

arm64: mte: remove an ISB on kernel exit

PATCH Applied Peter Collingbourne 2 participants 3 messages Dec 3, 2020 – Jan 4, 2021 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: mte: remove an ISB on kernel exit

This ISB is unnecessary because we will soon do an ERET.

---
 arch/arm64/kernel/entry.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/entry.S +1 -1
index 07646ef4f184..f8ad8d7fb1a2 100644
@@ -182,7 +182,6 @@ alternative_else_nop_endif
 	mrs_s	\tmp2, SYS_GCR_EL1
 	bfi	\tmp2, \tmp, #0, #16
 	msr_s	SYS_GCR_EL1, \tmp2
-	isb
 #endif
 	.endm
 
@@ -194,6 +193,7 @@ alternative_else_nop_endif
 	ldr_l	\tmp, gcr_kernel_excl
 
 	mte_set_gcr \tmp, \tmp2
+	isb
 1:
 #endif
 	.endm
Signature · 7 lines
2.29.2.454.gaff20da3a2-goog


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer
#1 lore raw
Quoted 21 lines · Peter Collingbourne

This ISB is unnecessary because we will soon do an ERET.

---
 arch/arm64/kernel/entry.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/entry.S +0 -1
index 07646ef4f184..f8ad8d7fb1a2 100644
@@ -182,7 +182,6 @@ alternative_else_nop_endif
 	mrs_s	\tmp2, SYS_GCR_EL1
 	bfi	\tmp2, \tmp, #0, #16
 	msr_s	SYS_GCR_EL1, \tmp2
-	isb
 #endif
 	.endm
 

arch/arm64/kernel/entry.S alternative_else_nop_endif · line 199

Quoted 7 lines
arch/arm64/kernel/entry.S +1 -0
@@ -194,6 +193,7 @@ alternative_else_nop_endif
 	ldr_l	\tmp, gcr_kernel_excl
 
 	mte_set_gcr \tmp, \tmp2
+	isb
 1:
 #endif
 	.endm

It makes sense. I'll apply it after -rc1 once the MTE+kasan patches go in.

Thanks.

Signature · 6 lines
Catalin

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer Applied
#2 lore raw
In reply to Peter Collingbourne
Quoted 1 line · Peter Collingbourne

This ISB is unnecessary because we will soon do an ERET.

Applied to arm64 (for-next/fixes), thanks!

[1/1] arm64: mte: remove an ISB on kernel exit

      https://git.kernel.org/arm64/c/b614231dec78
Signature · 7 lines
Catalin


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel