aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-04-22 13:53:12 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-04-22 13:53:12 -0400
commitff061624e1afad3b556fcc8df23898014b47bc7e (patch)
tree63bbe78f263f8f2caa52496c6654fcfc4f8ed9d9
parent7c5047a124cbfd7be0648c1cf41f802cf7e6918d (diff)
parent4705e02498d6d5a7ab98dfee9595cd5e91db2017 (diff)
Merge tag 'powerpc-4.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: "Three powerpc cpu feature fixes from Anton Blanchard: - scan_features() updated incorrect bits for REAL_LE - update cpu_user_features2 in scan_features() - update TM user feature bits in scan_features()" * tag 'powerpc-4.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc: Update TM user feature bits in scan_features() powerpc: Update cpu_user_features2 in scan_features() powerpc: scan_features() updates incorrect bits for REAL_LE
-rw-r--r--arch/powerpc/include/uapi/asm/cputable.h1
-rw-r--r--arch/powerpc/kernel/prom.c26
2 files changed, 16 insertions, 11 deletions
diff --git a/arch/powerpc/include/uapi/asm/cputable.h b/arch/powerpc/include/uapi/asm/cputable.h
index 8dde19962a5b..f63c96cd3608 100644
--- a/arch/powerpc/include/uapi/asm/cputable.h
+++ b/arch/powerpc/include/uapi/asm/cputable.h
@@ -31,6 +31,7 @@
31#define PPC_FEATURE_PSERIES_PERFMON_COMPAT \ 31#define PPC_FEATURE_PSERIES_PERFMON_COMPAT \
32 0x00000040 32 0x00000040
33 33
34/* Reserved - do not use 0x00000004 */
34#define PPC_FEATURE_TRUE_LE 0x00000002 35#define PPC_FEATURE_TRUE_LE 0x00000002
35#define PPC_FEATURE_PPC_LE 0x00000001 36#define PPC_FEATURE_PPC_LE 0x00000001
36 37
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 7030b035905d..a15fe1d4e84a 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -148,23 +148,25 @@ static struct ibm_pa_feature {
148 unsigned long cpu_features; /* CPU_FTR_xxx bit */ 148 unsigned long cpu_features; /* CPU_FTR_xxx bit */
149 unsigned long mmu_features; /* MMU_FTR_xxx bit */ 149 unsigned long mmu_features; /* MMU_FTR_xxx bit */
150 unsigned int cpu_user_ftrs; /* PPC_FEATURE_xxx bit */ 150 unsigned int cpu_user_ftrs; /* PPC_FEATURE_xxx bit */
151 unsigned int cpu_user_ftrs2; /* PPC_FEATURE2_xxx bit */
151 unsigned char pabyte; /* byte number in ibm,pa-features */ 152 unsigned char pabyte; /* byte number in ibm,pa-features */
152 unsigned char pabit; /* bit number (big-endian) */ 153 unsigned char pabit; /* bit number (big-endian) */
153 unsigned char invert; /* if 1, pa bit set => clear feature */ 154 unsigned char invert; /* if 1, pa bit set => clear feature */
154} ibm_pa_features[] __initdata = { 155} ibm_pa_features[] __initdata = {
155 {0, 0, PPC_FEATURE_HAS_MMU, 0, 0, 0}, 156 {0, 0, PPC_FEATURE_HAS_MMU, 0, 0, 0, 0},
156 {0, 0, PPC_FEATURE_HAS_FPU, 0, 1, 0}, 157 {0, 0, PPC_FEATURE_HAS_FPU, 0, 0, 1, 0},
157 {CPU_FTR_CTRL, 0, 0, 0, 3, 0}, 158 {CPU_FTR_CTRL, 0, 0, 0, 0, 3, 0},
158 {CPU_FTR_NOEXECUTE, 0, 0, 0, 6, 0}, 159 {CPU_FTR_NOEXECUTE, 0, 0, 0, 0, 6, 0},
159 {CPU_FTR_NODSISRALIGN, 0, 0, 1, 1, 1}, 160 {CPU_FTR_NODSISRALIGN, 0, 0, 0, 1, 1, 1},
160 {0, MMU_FTR_CI_LARGE_PAGE, 0, 1, 2, 0}, 161 {0, MMU_FTR_CI_LARGE_PAGE, 0, 0, 1, 2, 0},
161 {CPU_FTR_REAL_LE, PPC_FEATURE_TRUE_LE, 5, 0, 0}, 162 {CPU_FTR_REAL_LE, 0, PPC_FEATURE_TRUE_LE, 0, 5, 0, 0},
162 /* 163 /*
163 * If the kernel doesn't support TM (ie. CONFIG_PPC_TRANSACTIONAL_MEM=n), 164 * If the kernel doesn't support TM (ie CONFIG_PPC_TRANSACTIONAL_MEM=n),
164 * we don't want to turn on CPU_FTR_TM here, so we use CPU_FTR_TM_COMP 165 * we don't want to turn on TM here, so we use the *_COMP versions
165 * which is 0 if the kernel doesn't support TM. 166 * which are 0 if the kernel doesn't support TM.
166 */ 167 */
167 {CPU_FTR_TM_COMP, 0, 0, 22, 0, 0}, 168 {CPU_FTR_TM_COMP, 0, 0,
169 PPC_FEATURE2_HTM_COMP|PPC_FEATURE2_HTM_NOSC_COMP, 22, 0, 0},
168}; 170};
169 171
170static void __init scan_features(unsigned long node, const unsigned char *ftrs, 172static void __init scan_features(unsigned long node, const unsigned char *ftrs,
@@ -195,10 +197,12 @@ static void __init scan_features(unsigned long node, const unsigned char *ftrs,
195 if (bit ^ fp->invert) { 197 if (bit ^ fp->invert) {
196 cur_cpu_spec->cpu_features |= fp->cpu_features; 198 cur_cpu_spec->cpu_features |= fp->cpu_features;
197 cur_cpu_spec->cpu_user_features |= fp->cpu_user_ftrs; 199 cur_cpu_spec->cpu_user_features |= fp->cpu_user_ftrs;
200 cur_cpu_spec->cpu_user_features2 |= fp->cpu_user_ftrs2;
198 cur_cpu_spec->mmu_features |= fp->mmu_features; 201 cur_cpu_spec->mmu_features |= fp->mmu_features;
199 } else { 202 } else {
200 cur_cpu_spec->cpu_features &= ~fp->cpu_features; 203 cur_cpu_spec->cpu_features &= ~fp->cpu_features;
201 cur_cpu_spec->cpu_user_features &= ~fp->cpu_user_ftrs; 204 cur_cpu_spec->cpu_user_features &= ~fp->cpu_user_ftrs;
205 cur_cpu_spec->cpu_user_features2 &= ~fp->cpu_user_ftrs2;
202 cur_cpu_spec->mmu_features &= ~fp->mmu_features; 206 cur_cpu_spec->mmu_features &= ~fp->mmu_features;
203 } 207 }
204 } 208 }