linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: Improve comment explaining why we modify VRSAVE
@ 2016-05-19 18:41 Anton Blanchard
  2016-05-23  7:54 ` Cyril Bur
  2016-07-27 14:32 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Anton Blanchard @ 2016-05-19 18:41 UTC (permalink / raw)
  To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras; +Cc: linuxppc-dev

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

Signed-off-by: Anton Blanchard <anton@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 */
 	isync
 
-	/* 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-27 14:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-19 18:41 [PATCH] powerpc: Improve comment explaining why we modify VRSAVE Anton Blanchard
2016-05-23  7:54 ` Cyril Bur
2016-07-27 14:32 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).