Commit a5841a46 authored by Anton Blanchard's avatar Anton Blanchard Committed by Benjamin Herrenschmidt

powerpc: Alignment handler shouldn't access VSX registers with TS_FPR

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: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent c3244964
...@@ -650,7 +650,7 @@ static int emulate_vsx(unsigned char __user *addr, unsigned int reg, ...@@ -650,7 +650,7 @@ static int emulate_vsx(unsigned char __user *addr, unsigned int reg,
flush_vsx_to_thread(current); flush_vsx_to_thread(current);
if (reg < 32) if (reg < 32)
ptr = (char *) &current->thread.TS_FPR(reg); ptr = (char *) &current->thread.fpr[reg][0];
else else
ptr = (char *) &current->thread.vr[reg - 32]; ptr = (char *) &current->thread.vr[reg - 32];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment