android_kernel_samsung_msm8976/arch/powerpc/include/uapi/asm
Anton Blanchard 73dd3ac10b powerpc: scan_features() updates incorrect bits for REAL_LE
commit 6997e57d693b07289694239e52a10d2f02c3a46f upstream.

The REAL_LE feature entry in the ibm_pa_feature struct is missing an MMU
feature value, meaning all the remaining elements initialise the wrong
values.

This means instead of checking for byte 5, bit 0, we check for byte 0,
bit 0, and then we incorrectly set the CPU feature bit as well as MMU
feature bit 1 and CPU user feature bits 0 and 2 (5).

Checking byte 0 bit 0 (IBM numbering), means we're looking at the
"Memory Management Unit (MMU)" feature - ie. does the CPU have an MMU.
In practice that bit is set on all platforms which have the property.

This means we set CPU_FTR_REAL_LE always. In practice that seems not to
matter because all the modern cpus which have this property also
implement REAL_LE, and we've never needed to disable it.

We're also incorrectly setting MMU feature bit 1, which is:

  #define MMU_FTR_TYPE_8xx		0x00000002

Luckily the only place that looks for MMU_FTR_TYPE_8xx is in Book3E
code, which can't run on the same cpus as scan_features(). So this also
doesn't matter in practice.

Finally in the CPU user feature mask, we're setting bits 0 and 2. Bit 2
is not currently used, and bit 0 is:

  #define PPC_FEATURE_PPC_LE		0x00000001

Which says the CPU supports the old style "PPC Little Endian" mode.
Again this should be harmless in practice as no 64-bit CPUs implement
that mode.

Fix the code by adding the missing initialisation of the MMU feature.

Also add a comment marking CPU user feature bit 2 (0x4) as reserved. It
would be unsafe to start using it as old kernels incorrectly set it.

Fixes: 44ae3ab335 ("powerpc: Free up some CPU feature bits by moving out MMU-related features")
Signed-off-by: Anton Blanchard <anton@samba.org>
[mpe: Flesh out changelog, add comment reserving 0x4]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
2016-06-07 10:42:53 +02:00
..
Kbuild powerpc/tm: Move TM abort cause codes to uapi 2013-06-01 08:29:23 +10:00
auxvec.h
bitsperlong.h
bootx.h
byteorder.h
cputable.h powerpc: scan_features() updates incorrect bits for REAL_LE 2016-06-07 10:42:53 +02:00
elf.h
epapr_hcalls.h PPC: ePAPR: Convert hcall header to uapi (round 2) 2012-10-31 13:45:32 +01:00
errno.h
fcntl.h
ioctl.h
ioctls.h tty, ioctls -- Add new ioctl definitions for tty flags fetching 2012-10-25 12:07:18 -07:00
ipcbuf.h
kvm.h KVM: PPC: Book3S: Add API for in-kernel XICS emulation 2013-05-02 15:28:36 +02:00
kvm_para.h powerpc: Corrected include header path in kvm_para.h 2012-12-20 11:23:32 +01:00
mman.h
msgbuf.h
nvram.h
param.h
poll.h
posix_types.h
ps3fb.h
ptrace.h powerpc/ptrace: Add DAWR debug feature info for userspace 2013-04-18 15:59:55 +10:00
resource.h
seccomp.h
sembuf.h
setup.h powerpc: Move most of setup.h out of uapi 2012-11-15 13:00:51 +11:00
shmbuf.h
sigcontext.h
siginfo.h
signal.h powerpc: switch to generic old sigaction() 2013-02-03 18:16:10 -05:00
socket.h net: add option to enable error queue packets waking select 2013-03-31 19:44:20 -04:00
sockios.h
spu_info.h
stat.h
statfs.h
swab.h
termbits.h
termios.h
tm.h powerpc/tm: Move TM abort cause codes to uapi 2013-06-01 08:29:23 +10:00
types.h
ucontext.h
unistd.h powerpc: Wireup the kcmp syscall to sys_ni 2013-03-05 16:56:29 +11:00