Skip to content

Commit 4705e02

Browse files
antonblanchardmpe
authored andcommitted
powerpc: Update TM user feature bits in scan_features()
We need to update the user TM feature bits (PPC_FEATURE2_HTM and PPC_FEATURE2_HTM) to mirror what we do with the kernel TM feature bit. At the moment, if firmware reports TM is not available we turn off the kernel TM feature bit but leave the userspace ones on. Userspace thinks it can execute TM instructions and it dies trying. This (together with a QEMU patch) fixes PR KVM, which doesn't currently support TM. Signed-off-by: Anton Blanchard <[email protected]> Cc: [email protected] Signed-off-by: Michael Ellerman <[email protected]>
1 parent beff823 commit 4705e02

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

arch/powerpc/kernel/prom.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,12 @@ static struct ibm_pa_feature {
161161
{0, MMU_FTR_CI_LARGE_PAGE, 0, 0, 1, 2, 0},
162162
{CPU_FTR_REAL_LE, 0, PPC_FEATURE_TRUE_LE, 0, 5, 0, 0},
163163
/*
164-
* If the kernel doesn't support TM (ie. CONFIG_PPC_TRANSACTIONAL_MEM=n),
165-
* we don't want to turn on CPU_FTR_TM here, so we use CPU_FTR_TM_COMP
166-
* which is 0 if the kernel doesn't support TM.
164+
* If the kernel doesn't support TM (ie CONFIG_PPC_TRANSACTIONAL_MEM=n),
165+
* we don't want to turn on TM here, so we use the *_COMP versions
166+
* which are 0 if the kernel doesn't support TM.
167167
*/
168-
{CPU_FTR_TM_COMP, 0, 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},
169170
};
170171

171172
static void __init scan_features(unsigned long node, const unsigned char *ftrs,

0 commit comments

Comments
 (0)