[PATCH] aarch64: Add memory clobber to pkey_write

Yury Khrustalev <[email protected]>
Newsgroups gmane.comp.lib.glibc.alpha
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.