[PATCH v1 10/18] arm64/mm: Disable all interrupts while replacing TTBR1

Mark Brown broonie at kernel.org
Fri Nov 4 16:54:45 PDT 2022


We really don't want any exceptions to be delivered while manipulating
TTBR1 so disable ALLINT as well as DAIF in idmap_cpu_replace_ttbr1(),
preventing delivery of NMIs while the replacement is in progress.

Signed-off-by: Mark Brown <broonie at kernel.org>
---
 arch/arm64/mm/proc.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S
index b9ecbbae1e1a..6bc90fc85d34 100644
--- a/arch/arm64/mm/proc.S
+++ b/arch/arm64/mm/proc.S
@@ -190,6 +190,7 @@ SYM_FUNC_END(cpu_do_resume)
  */
 SYM_TYPED_FUNC_START(idmap_cpu_replace_ttbr1)
 	save_and_disable_daif flags=x2
+	disable_allint
 
 	__idmap_cpu_set_reserved_ttbr1 x1, x3
 
@@ -197,6 +198,7 @@ SYM_TYPED_FUNC_START(idmap_cpu_replace_ttbr1)
 	msr	ttbr1_el1, x0
 	isb
 
+	enable_allint
 	restore_daif x2
 
 	ret
-- 
2.30.2




More information about the linux-arm-kernel mailing list