Skip to contentSkip to conversation

Patch "powerpc/process: Fix altivec SPR not being saved" has been added to the 4.5-stable tree

PATCH [email protected] 1 participant 1 message Apr 12, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

powerpc/process: Fix altivec SPR not being saved

to the 4.5-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
powerpc-process-fix-altivec-spr-not-being-saved.patch
and it can be found in the queue-4.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 01d7c2a2de47890934faba91a71d183795e4348d Mon Sep 17 00:00:00 2001

From: Oliver O'Halloran <[email protected]>
Date: Tue, 8 Mar 2016 09:08:47 +1100
Subject: powerpc/process: Fix altivec SPR not being saved

From: Oliver O'Halloran <[email protected]>

commit 01d7c2a2de47890934faba91a71d183795e4348d upstream.

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 152d523e6307 ("powerpc: Create context switch helpers save_sprs() and restore_sprs()")
---
 arch/powerpc/kernel/process.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/process.c +1 -1
@@ -854,7 +854,7 @@ void restore_tm_state(struct pt_regs *re
 static inline void save_sprs(struct thread_struct *t)
 {
 #ifdef CONFIG_ALTIVEC
-	if (cpu_has_feature(cpu_has_feature(CPU_FTR_ALTIVEC)))
+	if (cpu_has_feature(CPU_FTR_ALTIVEC))
 		t->vrsave = mfspr(SPRN_VRSAVE);
 #endif
 #ifdef CONFIG_PPC_BOOK3S_64

Patches currently in stable-queue which might be from [email protected] are

queue-4.5/powerpc-process-fix-altivec-spr-not-being-saved.patch