Skip to content

Commit 2c9c6ce

Browse files
evansm7ozbenh
authored andcommitted
powerpc: Add __SANE_USERSPACE_TYPES__ to asm/types.h for LL64
PPC64 uses long long for u64 in the kernel, but powerpc's asm/types.h prevents 64-bit userland from seeing this definition, instead defaulting to u64 == long in userspace. Some user programs (e.g. kvmtool) may actually want LL64, so this patch adds a check for __SANE_USERSPACE_TYPES__ so that, if defined, int-ll64.h is included instead. Signed-off-by: Matt Evans <matt@ozlabs.org> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
1 parent a66086b commit 2c9c6ce

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arch/powerpc/include/asm/types.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
* This is here because we used to use l64 for 64bit powerpc
66
* and we don't want to impact user mode with our change to ll64
77
* in the kernel.
8+
*
9+
* However, some user programs are fine with this. They can
10+
* flag __SANE_USERSPACE_TYPES__ to get int-ll64.h here.
811
*/
9-
#if defined(__powerpc64__) && !defined(__KERNEL__)
12+
#if !defined(__SANE_USERSPACE_TYPES__) && defined(__powerpc64__) && !defined(__KERNEL__)
1013
# include <asm-generic/int-l64.h>
1114
#else
1215
# include <asm-generic/int-ll64.h>

0 commit comments

Comments
 (0)