Skip to content

Commit

Permalink
powerpc: Alignment handler shouldn't access VSX registers with TS_FPR
Browse files Browse the repository at this point in the history
The TS_FPR macro selects the FPR component of a VSX register (the
high doubleword). emulate_vsx is using this macro to get the
address of the associated VSX register. This happens to work on big
endian, but fails on little endian.

Replace it with an explicit array access.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Anton Blanchard authored and Benjamin Herrenschmidt committed Oct 11, 2013
1 parent c324496 commit a5841a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/align.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ static int emulate_vsx(unsigned char __user *addr, unsigned int reg,
flush_vsx_to_thread(current);

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

Expand Down

0 comments on commit a5841a4

Please sign in to comment.