aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2016-04-14 22:07:24 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2016-04-18 06:10:45 -0400
commitbeff82374b259d726e2625ec6c518a5f2613f0ae (patch)
treeee625326f9123ce68ea3150a655aab57e617a6e8
parent6997e57d693b07289694239e52a10d2f02c3a46f (diff)
powerpc: Update cpu_user_features2 in scan_features()
scan_features() updates cpu_user_features but not cpu_user_features2. Amongst other things, cpu_user_features2 contains the user TM feature bits which we must keep in sync with the kernel TM feature bit. Signed-off-by: Anton Blanchard <anton@samba.org> Cc: stable@vger.kernel.org Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/kernel/prom.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 080c96b44a7f..03fce77e441d 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -148,23 +148,24 @@ 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, 0, 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 CPU_FTR_TM here, so we use CPU_FTR_TM_COMP
165 * which is 0 if the kernel doesn't support TM. 166 * which is 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, 0, 22, 0, 0},
168}; 169};
169 170
170static void __init scan_features(unsigned long node, const unsigned char *ftrs, 171static void __init scan_features(unsigned long node, const unsigned char *ftrs,
@@ -195,10 +196,12 @@ static void __init scan_features(unsigned long node, const unsigned char *ftrs,
195 if (bit ^ fp->invert) { 196 if (bit ^ fp->invert) {
196 cur_cpu_spec->cpu_features |= fp->cpu_features; 197 cur_cpu_spec->cpu_features |= fp->cpu_features;
197 cur_cpu_spec->cpu_user_features |= fp->cpu_user_ftrs; 198 cur_cpu_spec->cpu_user_features |= fp->cpu_user_ftrs;
199 cur_cpu_spec->cpu_user_features2 |= fp->cpu_user_ftrs2;
198 cur_cpu_spec->mmu_features |= fp->mmu_features; 200 cur_cpu_spec->mmu_features |= fp->mmu_features;
199 } else { 201 } else {
200 cur_cpu_spec->cpu_features &= ~fp->cpu_features; 202 cur_cpu_spec->cpu_features &= ~fp->cpu_features;
201 cur_cpu_spec->cpu_user_features &= ~fp->cpu_user_ftrs; 203 cur_cpu_spec->cpu_user_features &= ~fp->cpu_user_ftrs;
204 cur_cpu_spec->cpu_user_features2 &= ~fp->cpu_user_ftrs2;
202 cur_cpu_spec->mmu_features &= ~fp->mmu_features; 205 cur_cpu_spec->mmu_features &= ~fp->mmu_features;
203 } 206 }
204 } 207 }