Skip to content

Commit 01d7c2a

Browse files
oohalmpe
authored andcommitted
powerpc/process: Fix altivec SPR not being saved
In save_sprs() in process.c contains the following test: if (cpu_has_feature(cpu_has_feature(CPU_FTR_ALTIVEC))) t->vrsave = mfspr(SPRN_VRSAVE); CPU feature with the mask 0x1 is CPU_FTR_COHERENT_ICACHE so the test is equivilent to: if (cpu_has_feature(CPU_FTR_ALTIVEC) && cpu_has_feature(CPU_FTR_COHERENT_ICACHE)) On CPUs without support for both (i.e G5) this results in vrsave not being saved between context switches. The vector register save/restore code doesn't use VRSAVE to determine which registers to save/restore, but the value of VRSAVE is used to determine if altivec is being used in several code paths. Fixes: 152d523 ("powerpc: Create context switch helpers save_sprs() and restore_sprs()") Cc: stable@vger.kernel.org Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 08a5bb2 commit 01d7c2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ void restore_tm_state(struct pt_regs *regs)
983983
static inline void save_sprs(struct thread_struct *t)
984984
{
985985
#ifdef CONFIG_ALTIVEC
986-
if (cpu_has_feature(cpu_has_feature(CPU_FTR_ALTIVEC)))
986+
if (cpu_has_feature(CPU_FTR_ALTIVEC))
987987
t->vrsave = mfspr(SPRN_VRSAVE);
988988
#endif
989989
#ifdef CONFIG_PPC_BOOK3S_64

0 commit comments

Comments
 (0)