Skip to content

Commit

Permalink
powerpc: Improve comment explaining why we modify VRSAVE
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Cyril Bur <cyrilbur@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Anton Blanchard authored and Michael Ellerman committed Jul 26, 2016
1 parent 1a1cee8 commit dd57023
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions arch/powerpc/kernel/vector.S
Original file line number Diff line number Diff line change
Expand Up @@ -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. See also the programming note in the ISA.
*/
mfspr r4,SPRN_VRSAVE
cmpwi 0,r4,0
Expand Down

0 comments on commit dd57023

Please sign in to comment.