From: Philippe Bergheaud <felix@linux.vnet.ibm.com>
Subject: [30/33] powerpc: modules: use r12 for stub jump address.
Git-commit: b1ce369e820aaca3d91e9d9bbaaf860794d9ab01
Patch-mainline: v3.16-rc1
References: bnc#863764 fate#315275, LTC#103998
X-Patchwork-Id: 333428

Summary: Novell863764 - SLES 12 - Enable POWER LE kernel build with ELFv2
Description: Enable POWER LE kernel build with ELFv2

Upstream-Description:

    In ELFv2, r12 is supposed to equal to PC on entry to a function.
    Our stubs use r11, so change swap that with r12.
    
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Signed-off-by: Philippe Bergheaud <felix@linux.vnet.ibm.com>
Acked-by: Torsten Duwe <duwe@suse.de>
---
 arch/powerpc/kernel/module_64.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module_64.c
index 8bfcf1b..f8b6d28 100644
--- a/arch/powerpc/kernel/module_64.c
+++ b/arch/powerpc/kernel/module_64.c
@@ -67,13 +67,13 @@ struct ppc64_stub_entry
    r2) into the stub. */
 static struct ppc64_stub_entry ppc64_stub =
 { .jump = {
-	0x3d820000,			/* addis   r12,r2, <high> */
-	0x398c0000,			/* addi    r12,r12, <low> */
+	0x3d620000,			/* addis   r11,r2, <high> */
+	0x396b0000,			/* addi    r11,r11, <low> */
 	/* Save current r2 value in magic place on the stack. */
 	0xf8410000|R2_STACK_OFFSET,	/* std     r2,R2_STACK_OFFSET(r1) */
-	0xe96c0020,			/* ld      r11,32(r12) */
-	0xe84c0028,			/* ld      r2,40(r12) */
-	0x7d6903a6,			/* mtctr   r11 */
+	0xe98b0020,			/* ld      r12,32(r11) */
+	0xe84b0026,			/* ld      r2,40(r11) */
+	0x7d8903a6,			/* mtctr   r12 */
 	0x4e800420			/* bctr */
 } };
 
