PPC: Add __SANE_USERSPACE_TYPES__ to asm/types.h for LL64
PATCH 1/1 PPC: 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.
--- arch/powerpc/include/asm/types.h | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
arch/powerpc/include/asm/types.h +4 -1
@@ -5,8 +5,11 @@* This is here because we used to use l64 for 64bit powerpc * and we don't want to impact user mode with our change to ll64 * in the kernel. +* +* However, some user programs are fine with this. They can +* flag __SANE_USERSPACE_TYPES__ to get int-ll64.h here. */ -#if defined(__powerpc64__) && !defined(__KERNEL__) +#if !defined(__SANE_USERSPACE_TYPES__) && defined(__powerpc64__) && !defined(__KERNEL__)# include <asm-generic/int-l64.h> #else # include <asm-generic/int-ll64.h>
Signature · 1 line
1.7.0.4
Quoted 16 lines · Matt Evans
PPC64 uses long long for u64 in the kernel, but powerpc's
asm/types.hprevents 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.his included instead.Signed-off-by Matt Evans <[email protected]>--- arch/powerpc/include/asm/types.h | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)arch/powerpc/include/asm/types.h +0
-0
arch/powerpc/include/asm/types.h line 12
Quoted 9 lines
arch/powerpc/include/asm/types.h +4
-1@@ -5,8 +5,11 @@* This is here because we used to use l64 for 64bit powerpc * and we don't want to impact user mode with our change to ll64 * in the kernel. +* +* However, some user programs are fine with this. They can +* flag __SANE_USERSPACE_TYPES__ to get int-ll64.h here. */ -#if defined(__powerpc64__) && !defined(__KERNEL__) +#if !defined(__SANE_USERSPACE_TYPES__) && defined(__powerpc64__) && !defined(__KERNEL__)
Any other name would work too i guess.
Thanks,
Ingo