2017-11-01 21:08:43 +07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
2012-10-09 15:47:26 +07:00
|
|
|
#ifndef _UAPI__ASM_POWERPC_CPUTABLE_H
|
|
|
|
#define _UAPI__ASM_POWERPC_CPUTABLE_H
|
|
|
|
|
2013-05-03 21:47:56 +07:00
|
|
|
/* in AT_HWCAP */
|
2012-10-09 15:47:26 +07:00
|
|
|
#define PPC_FEATURE_32 0x80000000
|
|
|
|
#define PPC_FEATURE_64 0x40000000
|
|
|
|
#define PPC_FEATURE_601_INSTR 0x20000000
|
|
|
|
#define PPC_FEATURE_HAS_ALTIVEC 0x10000000
|
|
|
|
#define PPC_FEATURE_HAS_FPU 0x08000000
|
|
|
|
#define PPC_FEATURE_HAS_MMU 0x04000000
|
|
|
|
#define PPC_FEATURE_HAS_4xxMAC 0x02000000
|
|
|
|
#define PPC_FEATURE_UNIFIED_CACHE 0x01000000
|
|
|
|
#define PPC_FEATURE_HAS_SPE 0x00800000
|
|
|
|
#define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000
|
|
|
|
#define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000
|
|
|
|
#define PPC_FEATURE_NO_TB 0x00100000
|
|
|
|
#define PPC_FEATURE_POWER4 0x00080000
|
|
|
|
#define PPC_FEATURE_POWER5 0x00040000
|
|
|
|
#define PPC_FEATURE_POWER5_PLUS 0x00020000
|
|
|
|
#define PPC_FEATURE_CELL 0x00010000
|
|
|
|
#define PPC_FEATURE_BOOKE 0x00008000
|
|
|
|
#define PPC_FEATURE_SMT 0x00004000
|
|
|
|
#define PPC_FEATURE_ICACHE_SNOOP 0x00002000
|
|
|
|
#define PPC_FEATURE_ARCH_2_05 0x00001000
|
|
|
|
#define PPC_FEATURE_PA6T 0x00000800
|
|
|
|
#define PPC_FEATURE_HAS_DFP 0x00000400
|
|
|
|
#define PPC_FEATURE_POWER6_EXT 0x00000200
|
|
|
|
#define PPC_FEATURE_ARCH_2_06 0x00000100
|
|
|
|
#define PPC_FEATURE_HAS_VSX 0x00000080
|
|
|
|
|
|
|
|
#define PPC_FEATURE_PSERIES_PERFMON_COMPAT \
|
|
|
|
0x00000040
|
|
|
|
|
powerpc: scan_features() updates incorrect bits for REAL_LE
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: 44ae3ab3358e ("powerpc: Free up some CPU feature bits by moving out MMU-related features")
Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: stable@vger.kernel.org
[mpe: Flesh out changelog, add comment reserving 0x4]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-04-15 09:06:13 +07:00
|
|
|
/* Reserved - do not use 0x00000004 */
|
2012-10-09 15:47:26 +07:00
|
|
|
#define PPC_FEATURE_TRUE_LE 0x00000002
|
|
|
|
#define PPC_FEATURE_PPC_LE 0x00000001
|
|
|
|
|
2013-05-03 21:47:56 +07:00
|
|
|
/* in AT_HWCAP2 */
|
|
|
|
#define PPC_FEATURE2_ARCH_2_07 0x80000000
|
|
|
|
#define PPC_FEATURE2_HTM 0x40000000
|
|
|
|
#define PPC_FEATURE2_DSCR 0x20000000
|
|
|
|
#define PPC_FEATURE2_EBB 0x10000000
|
|
|
|
#define PPC_FEATURE2_ISEL 0x08000000
|
|
|
|
#define PPC_FEATURE2_TAR 0x04000000
|
2014-06-10 12:04:40 +07:00
|
|
|
#define PPC_FEATURE2_VEC_CRYPTO 0x02000000
|
2015-06-12 08:06:32 +07:00
|
|
|
#define PPC_FEATURE2_HTM_NOSC 0x01000000
|
2016-01-11 09:59:04 +07:00
|
|
|
#define PPC_FEATURE2_ARCH_3_00 0x00800000 /* ISA 3.00 */
|
|
|
|
#define PPC_FEATURE2_HAS_IEEE128 0x00400000 /* VSX IEEE Binary Float 128-bit */
|
2017-05-20 11:29:49 +07:00
|
|
|
#define PPC_FEATURE2_DARN 0x00200000 /* darn random number insn */
|
|
|
|
#define PPC_FEATURE2_SCV 0x00100000 /* scv syscall */
|
2017-10-12 17:17:17 +07:00
|
|
|
#define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000 /* TM w/out suspended state */
|
2013-05-03 21:47:56 +07:00
|
|
|
|
2017-05-09 10:16:52 +07:00
|
|
|
/*
|
|
|
|
* IMPORTANT!
|
|
|
|
* All future PPC_FEATURE definitions should be allocated in cooperation with
|
|
|
|
* OPAL / skiboot firmware, in accordance with the ibm,powerpc-cpu-features
|
|
|
|
* device tree binding.
|
|
|
|
*/
|
|
|
|
|
2012-10-09 15:47:26 +07:00
|
|
|
#endif /* _UAPI__ASM_POWERPC_CPUTABLE_H */
|