From: Philippe Bergheaud <felix@linux.vnet.ibm.com>
Subject: powerpc: Alignment handler shouldn't access VSX registers with TS_FPR
Git-commit: a5841a46022e1ebe97d4c926c32ef4e9acec96a7
Patch-mainline: v3.13-rc1
References: bnc#856774 fate#315275, LTC#92305

Summary:     powerpc: add little-endian support
Description: Add little-endian support for POWER8.

Upstream-Description:

    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.

[merged in final change from 3ad26e5c4459d3]

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Signed-off-by: Philippe Bergheaud <felix@linux.vnet.ibm.com>
Acked-by: Torsten Duwe <duwe@suse.de>
---
 arch/powerpc/kernel/align.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-3.12-SLE12/arch/powerpc/kernel/align.c
===================================================================
--- linux-3.12-SLE12.orig/arch/powerpc/kernel/align.c
+++ linux-3.12-SLE12/arch/powerpc/kernel/align.c
@@ -650,7 +650,7 @@ static int emulate_vsx(unsigned char __u
 	flush_vsx_to_thread(current);
 
 	if (reg < 32)
-		ptr = (char *) &current->thread.TS_FPR(reg);
+		ptr = (char *) &current->thread.fp_state.fpr[reg][0];
 	else
 		ptr = (char *) &current->thread.vr_state.vr[reg - 32];
 
