[PATCH] aarch64: Add memory clobber to pkey_write

Yury Khrustalev yury.khrustalev@arm.com
Wed Aug 26 12:41:38 GMT 2026


Add memory clobber for writing to the POR_EL0 register since a change
to this register affects subsequent memory accesses.

---
Passes regression on aarch64. OK for trunk?
OK to backport to 2.44, 2.43, 2.42, 2.41?

Base commit: 9c86ea03aa

---
 sysdeps/unix/sysv/linux/aarch64/arch-pkey.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sysdeps/unix/sysv/linux/aarch64/arch-pkey.h b/sysdeps/unix/sysv/linux/aarch64/arch-pkey.h
index 7276aa0b77..662ff73df3 100644
--- a/sysdeps/unix/sysv/linux/aarch64/arch-pkey.h
+++ b/sysdeps/unix/sysv/linux/aarch64/arch-pkey.h
@@ -47,7 +47,7 @@ pkey_read (void)
 static __always_inline void
 pkey_write (unsigned long value)
 {
-  __asm__ volatile ("msr s3_3_c10_c2_4, %0; isb" : : "r" (value));
+  __asm__ volatile ("msr s3_3_c10_c2_4, %0; isb" : : "r" (value) : "memory");
 }
 
 #endif /* _ARCH_PKEY_H */
-- 
2.47.3



More information about the Libc-alpha mailing list