Skip to content

Commit 05b05f2

Browse files
antonblanchardmpe
authored andcommitted
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 6a40480 ("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>
1 parent 72e349f commit 05b05f2

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

‎arch/powerpc/kernel/exceptions-64s.S‎

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,13 @@ END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE) \
5959

6060
#if defined(CONFIG_RELOCATABLE)
6161
/*
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.
6564
*/
6665
#define SYSCALL_PSERIES_2_DIRECT \
6766
mflr r10 ; \
6867
ld r12,PACAKBASE(r13) ; \
69-
LOAD_HANDLER(r12, system_call_entry_direct) ; \
68+
LOAD_HANDLER(r12, system_call_entry) ; \
7069
mtctr r12 ; \
7170
mfspr r12,SPRN_SRR1 ; \
7271
/* Re-use of r13... No spare regs to do this */ \
@@ -80,7 +79,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE) \
8079
mfspr r12,SPRN_SRR1 ; \
8180
li r10,MSR_RI ; \
8281
mtmsrd r10,1 ; /* Set RI (EE=0) */ \
83-
b system_call_entry_direct ;
82+
b system_call_entry ;
8483
#endif
8584

8685
/*
@@ -969,13 +968,6 @@ hv_facility_unavailable_relon_trampoline:
969968
__end_interrupts:
970969

971970
.align 7
972-
system_call_entry_direct:
973-
#if defined(CONFIG_RELOCATABLE)
974-
/* The first level prologue may have used LR to get here, saving
975-
* orig in r10. To save hacking/ifdeffing common code, restore here.
976-
*/
977-
mtlr r10
978-
#endif
979971
system_call_entry:
980972
b system_call_common
981973

0 commit comments

Comments
 (0)