Skip to content

Commit a5841a4

Browse files
antonblanchardozbenh
authored andcommitted
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: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
1 parent c324496 commit a5841a4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎arch/powerpc/kernel/align.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ static int emulate_vsx(unsigned char __user *addr, unsigned int reg,
650650
flush_vsx_to_thread(current);
651651

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

0 commit comments

Comments
 (0)