[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a3d5db51c2e0f115e271b507c89e5af96bfeb015.1723817900.git.christophe.leroy@csgroup.eu>
Date: Fri, 16 Aug 2024 16:36:54 +0200
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Michael Ellerman <mpe@...erman.id.au>,
Nicholas Piggin <npiggin@...il.com>,
Naveen N Rao <naveen@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>,
"Theodore Ts'o" <tytso@....edu>,
"Jason A. Donenfeld" <Jason@...c4.com>,
Andy Lutomirski <luto@...nel.org>,
Vincenzo Frascino <vincenzo.frascino@....com>,
Arnd Bergmann <arnd@...db.de>
Cc: Christophe Leroy <christophe.leroy@...roup.eu>,
linux-kernel@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org,
linux-arch@...r.kernel.org
Subject: [PATCH 7/9] powerpc: Add little endian variants of LHZX_BE and friends
To support getrandom in VDSO which is based on little endian storage,
add macros equivalent to LHZX_BE for little endian accesses.
And move it outside of __powerpc64__ #ifdef so that it can also be
used for PPC32.
Signed-off-by: Christophe Leroy <christophe.leroy@...roup.eu>
---
arch/powerpc/include/asm/asm-compat.h | 40 +++++++++++++++++----------
1 file changed, 26 insertions(+), 14 deletions(-)
diff --git a/arch/powerpc/include/asm/asm-compat.h b/arch/powerpc/include/asm/asm-compat.h
index 2bc53c646ccd..ef8e79ae669a 100644
--- a/arch/powerpc/include/asm/asm-compat.h
+++ b/arch/powerpc/include/asm/asm-compat.h
@@ -25,20 +25,6 @@
#define PPC_LR_STKOFF 16
#define PPC_MIN_STKFRM 112
-#ifdef __BIG_ENDIAN__
-#define LHZX_BE stringify_in_c(lhzx)
-#define LWZX_BE stringify_in_c(lwzx)
-#define LDX_BE stringify_in_c(ldx)
-#define STWX_BE stringify_in_c(stwx)
-#define STDX_BE stringify_in_c(stdx)
-#else
-#define LHZX_BE stringify_in_c(lhbrx)
-#define LWZX_BE stringify_in_c(lwbrx)
-#define LDX_BE stringify_in_c(ldbrx)
-#define STWX_BE stringify_in_c(stwbrx)
-#define STDX_BE stringify_in_c(stdbrx)
-#endif
-
#else /* 32-bit */
/* operations for longs and pointers */
@@ -61,4 +47,30 @@
#endif
+#ifdef __BIG_ENDIAN__
+#define LHZX_BE stringify_in_c(lhzx)
+#define LWZX_BE stringify_in_c(lwzx)
+#define LDX_BE stringify_in_c(ldx)
+#define STWX_BE stringify_in_c(stwx)
+#define STDX_BE stringify_in_c(stdx)
+
+#define LHZX_LE stringify_in_c(lhbrx)
+#define LWZX_LE stringify_in_c(lwbrx)
+#define LDX_LE stringify_in_c(ldbrx)
+#define STWX_LE stringify_in_c(stwbrx)
+#define STDX_LE stringify_in_c(stdbrx)
+#else
+#define LHZX_BE stringify_in_c(lhbrx)
+#define LWZX_BE stringify_in_c(lwbrx)
+#define LDX_BE stringify_in_c(ldbrx)
+#define STWX_BE stringify_in_c(stwbrx)
+#define STDX_BE stringify_in_c(stdbrx)
+
+#define LHZX_LE stringify_in_c(lhzx)
+#define LWZX_LE stringify_in_c(lwzx)
+#define LDX_LE stringify_in_c(ldx)
+#define STWX_LE stringify_in_c(stwx)
+#define STDX_LE stringify_in_c(stdx)
+#endif
+
#endif /* _ASM_POWERPC_ASM_COMPAT_H */
--
2.44.0
Powered by blists - more mailing lists