[PATCH] powerpc: Improve comment explaining why we modify VRSAVE

Anton Blanchard anton at samba.org
Fri May 20 04:41:34 AEST 2016

The comment explaining why we modify VRSAVE is misleading, glibc
does rely on the behaviour. Update the comment.

Signed-off-by: Anton Blanchard <anton at samba.org>

diff --git a/arch/powerpc/kernel/vector.S b/arch/powerpc/kernel/vector.S
index 1c2e7a3..3907fcf 100644
--- a/arch/powerpc/kernel/vector.S
+++ b/arch/powerpc/kernel/vector.S
@@ -70,10 +70,11 @@ _GLOBAL(load_up_altivec)
 	MTMSRD(r5)			/* enable use of AltiVec now */
-	/* Hack: if we get an altivec unavailable trap with VRSAVE
-	 * set to all zeros, we assume this is a broken application
-	 * that fails to set it properly, and thus we switch it to
-	 * all 1's
+	/*
+	 * While userspace in general ignores VRSAVE, glibc uses it as a
+	 * boolean to optimise userspace context save/restore. Whenever we
+	 * take an altivec unavailable exception we must set VRSAVE to
+	 * something non zero. Set it to all 1s.
 	mfspr	r4,SPRN_VRSAVE
 	cmpwi	0,r4,0

More information about the Linuxppc-dev mailing list