From: Paul Mackerras Date: Wed, 23 Oct 2013 08:40:02 +0000 (+0100) Subject: powerpc: Don't corrupt user registers on 32-bit X-Git-Tag: omap-for-v3.13/fixes-for-merge-window-take2~19^2~45^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=955c1cab809edfb5429603c68493363074ac20cf;p=pandora-kernel.git powerpc: Don't corrupt user registers on 32-bit Commit de79f7b9f6 ("powerpc: Put FP/VSX and VR state into structures") modified load_up_fpu() and load_up_altivec() in such a way that they now use r7 and r8. Unfortunately, the callers of these functions on 32-bit machines then return to userspace via fast_exception_return, which doesn't restore all of the volatile GPRs, but only r1, r3 -- r6 and r9 -- r12. This was causing userspace segfaults and other userspace misbehaviour on 32-bit machines. This fixes the problem by changing the register usage of load_up_fpu() and load_up_altivec() to avoid using r7 and r8 and instead use r6 and r10. This also adds comments to those functions saying which registers may be used. Signed-off-by: Paul Mackerras Tested-by: Scott Wood (on e500mc, so no altivec) Signed-off-by: Benjamin Herrenschmidt --- Reading git-diff-tree failed