Skip to content

Commit 39715bf

Browse files
vrothbergmpe
authored andcommitted
powerpc/process: Fix CONFIG_ALIVEC typo in restore_tm_state()
It should be ALTIVEC, not ALIVEC. Cyril explains: If a thread performs a transaction with altivec and then gets preempted for whatever reason, this bug may cause the kernel to not re-enable altivec when that thread runs again. This will result in an altivec unavailable fault, when that fault happens inside a user transaction the kernel has no choice but to enable altivec and doom the transaction. The result is that transactions using altivec may get aborted more often than they should. The difficulty in catching this with a selftest is my deliberate use of the word may above. Optimisations to avoid FPU/altivec/VSX faults mean that the kernel will always leave them on for 255 switches. This code prevents the kernel turning it off if it got to the 256th switch (and userspace was transactional). Fixes: dc16b55 ("powerpc: Always restore FPU/VEC/VSX if hardware transactional memory in use") Reviewed-by: Cyril Bur <cyrilbur@gmail.com> Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 09b7e37 commit 39715bf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/powerpc/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ void restore_tm_state(struct pt_regs *regs)
10121012
/* Ensure that restore_math() will restore */
10131013
if (msr_diff & MSR_FP)
10141014
current->thread.load_fp = 1;
1015-
#ifdef CONFIG_ALIVEC
1015+
#ifdef CONFIG_ALTIVEC
10161016
if (cpu_has_feature(CPU_FTR_ALTIVEC) && msr_diff & MSR_VEC)
10171017
current->thread.load_vec = 1;
10181018
#endif

0 commit comments

Comments
 (0)