Skip to content

Commit beff823

Browse files
antonblanchardmpe
authored andcommitted
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 <[email protected]> Cc: [email protected] Signed-off-by: Michael Ellerman <[email protected]>
1 parent 6997e57 commit beff823

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

arch/powerpc/kernel/prom.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,23 +148,24 @@ static struct ibm_pa_feature {
148148
unsigned long cpu_features; /* CPU_FTR_xxx bit */
149149
unsigned long mmu_features; /* MMU_FTR_xxx bit */
150150
unsigned int cpu_user_ftrs; /* PPC_FEATURE_xxx bit */
151+
unsigned int cpu_user_ftrs2; /* PPC_FEATURE2_xxx bit */
151152
unsigned char pabyte; /* byte number in ibm,pa-features */
152153
unsigned char pabit; /* bit number (big-endian) */
153154
unsigned char invert; /* if 1, pa bit set => clear feature */
154155
} ibm_pa_features[] __initdata = {
155-
{0, 0, PPC_FEATURE_HAS_MMU, 0, 0, 0},
156-
{0, 0, PPC_FEATURE_HAS_FPU, 0, 1, 0},
157-
{CPU_FTR_CTRL, 0, 0, 0, 3, 0},
158-
{CPU_FTR_NOEXECUTE, 0, 0, 0, 6, 0},
159-
{CPU_FTR_NODSISRALIGN, 0, 0, 1, 1, 1},
160-
{0, MMU_FTR_CI_LARGE_PAGE, 0, 1, 2, 0},
161-
{CPU_FTR_REAL_LE, 0, PPC_FEATURE_TRUE_LE, 5, 0, 0},
156+
{0, 0, PPC_FEATURE_HAS_MMU, 0, 0, 0, 0},
157+
{0, 0, PPC_FEATURE_HAS_FPU, 0, 0, 1, 0},
158+
{CPU_FTR_CTRL, 0, 0, 0, 0, 3, 0},
159+
{CPU_FTR_NOEXECUTE, 0, 0, 0, 0, 6, 0},
160+
{CPU_FTR_NODSISRALIGN, 0, 0, 0, 1, 1, 1},
161+
{0, MMU_FTR_CI_LARGE_PAGE, 0, 0, 1, 2, 0},
162+
{CPU_FTR_REAL_LE, 0, PPC_FEATURE_TRUE_LE, 0, 5, 0, 0},
162163
/*
163164
* If the kernel doesn't support TM (ie. CONFIG_PPC_TRANSACTIONAL_MEM=n),
164165
* we don't want to turn on CPU_FTR_TM here, so we use CPU_FTR_TM_COMP
165166
* which is 0 if the kernel doesn't support TM.
166167
*/
167-
{CPU_FTR_TM_COMP, 0, 0, 22, 0, 0},
168+
{CPU_FTR_TM_COMP, 0, 0, 0, 22, 0, 0},
168169
};
169170

170171
static 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,
195196
if (bit ^ fp->invert) {
196197
cur_cpu_spec->cpu_features |= fp->cpu_features;
197198
cur_cpu_spec->cpu_user_features |= fp->cpu_user_ftrs;
199+
cur_cpu_spec->cpu_user_features2 |= fp->cpu_user_ftrs2;
198200
cur_cpu_spec->mmu_features |= fp->mmu_features;
199201
} else {
200202
cur_cpu_spec->cpu_features &= ~fp->cpu_features;
201203
cur_cpu_spec->cpu_user_features &= ~fp->cpu_user_ftrs;
204+
cur_cpu_spec->cpu_user_features2 &= ~fp->cpu_user_ftrs2;
202205
cur_cpu_spec->mmu_features &= ~fp->mmu_features;
203206
}
204207
}

0 commit comments

Comments
 (0)