Skip to content

Commit

Permalink
powerpc/vsx: Fix VSX alignment handler for regs 32-63
Browse files Browse the repository at this point in the history
Fix the VSX alignment handler for VSX registers > 32.  32-63 are stored
in the VMX part of the thread_struct not the FPR part.

Signed-off-by: Michael Neuling <mikey@neuling.org>
CC: stable@kernel.org (2.6.27 & .28 please)
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Michael Neuling authored and Benjamin Herrenschmidt committed Feb 13, 2009
1 parent 0047656 commit 26456dc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/powerpc/kernel/align.c
Original file line number Diff line number Diff line change
Expand Up @@ -646,11 +646,16 @@ static int emulate_vsx(unsigned char __user *addr, unsigned int reg,
unsigned int areg, struct pt_regs *regs,
unsigned int flags, unsigned int length)
{
char *ptr = (char *) &current->thread.TS_FPR(reg);
char *ptr;
int ret = 0;

flush_vsx_to_thread(current);

if (reg < 32)
ptr = (char *) &current->thread.TS_FPR(reg);
else
ptr = (char *) &current->thread.vr[reg - 32];

if (flags & ST)
ret = __copy_to_user(addr, ptr, length);
else {
Expand Down

0 comments on commit 26456dc

Please sign in to comment.