Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Relocatable system call no longer uses the LR

We had some code to restore the LR in the relocatable system call path
back when we used the LR to do an indirect branch.

Commit 6a404806dfce ("powerpc: Avoid link stack corruption in MMU
on syscall entry path") changed this to use the CTR which is volatile
across system calls so does not need restoring.

Remove the stale comment and the restore of the LR.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Anton Blanchard and committed by
Michael Ellerman
05b05f28 72e349f1

+4 -12
+4 -12
arch/powerpc/kernel/exceptions-64s.S
··· 59 59 60 60 #if defined(CONFIG_RELOCATABLE) 61 61 /* 62 - * We can't branch directly; in the direct case we use LR 63 - * and system_call_entry restores LR. (We thus need to move 64 - * LR to r10 in the RFID case too.) 62 + * We can't branch directly so we do it via the CTR which 63 + * is volatile across system calls. 65 64 */ 66 65 #define SYSCALL_PSERIES_2_DIRECT \ 67 66 mflr r10 ; \ 68 67 ld r12,PACAKBASE(r13) ; \ 69 - LOAD_HANDLER(r12, system_call_entry_direct) ; \ 68 + LOAD_HANDLER(r12, system_call_entry) ; \ 70 69 mtctr r12 ; \ 71 70 mfspr r12,SPRN_SRR1 ; \ 72 71 /* Re-use of r13... No spare regs to do this */ \ ··· 79 80 mfspr r12,SPRN_SRR1 ; \ 80 81 li r10,MSR_RI ; \ 81 82 mtmsrd r10,1 ; /* Set RI (EE=0) */ \ 82 - b system_call_entry_direct ; 83 + b system_call_entry ; 83 84 #endif 84 85 85 86 /* ··· 968 969 __end_interrupts: 969 970 970 971 .align 7 971 - system_call_entry_direct: 972 - #if defined(CONFIG_RELOCATABLE) 973 - /* The first level prologue may have used LR to get here, saving 974 - * orig in r10. To save hacking/ifdeffing common code, restore here. 975 - */ 976 - mtlr r10 977 - #endif 978 972 system_call_entry: 979 973 b system_call_common 980 974