aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/rtas_entry.S
diff options
context:
space:
mode:
authorGravatar Nicholas Piggin <npiggin@gmail.com> 2022-03-08 23:50:40 +1000
committerGravatar Michael Ellerman <mpe@ellerman.id.au> 2022-05-19 23:11:27 +1000
commit5c86bd02b3c3ef68a109fa7e690ad62d3091f6d4 (patch)
tree125548c7c002ac82fb973d2c8b5bc57a18d50b73 /arch/powerpc/kernel/rtas_entry.S
parentpowerpc/rtas: Call enter_rtas with MSR[EE] disabled (diff)
downloadlinux-5c86bd02b3c3ef68a109fa7e690ad62d3091f6d4.tar.gz
linux-5c86bd02b3c3ef68a109fa7e690ad62d3091f6d4.tar.bz2
linux-5c86bd02b3c3ef68a109fa7e690ad62d3091f6d4.zip
powerpc/rtas: PACA can be restored directly from SPRG
On 64-bit, PACA is saved in a SPRG so it does not need to be saved on stack. We also don't need to mask off the top bits for real mode addresses because the architecture does this for us. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220308135047.478297-8-npiggin@gmail.com
Diffstat (limited to 'arch/powerpc/kernel/rtas_entry.S')
-rw-r--r--arch/powerpc/kernel/rtas_entry.S13
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/powerpc/kernel/rtas_entry.S b/arch/powerpc/kernel/rtas_entry.S
index acf90a15e39d..3bd29ddba546 100644
--- a/arch/powerpc/kernel/rtas_entry.S
+++ b/arch/powerpc/kernel/rtas_entry.S
@@ -62,10 +62,9 @@ _GLOBAL(enter_rtas)
/* Because RTAS is running in 32b mode, it clobbers the high order half
* of all registers that it saves. We therefore save those registers
- * RTAS might touch to the stack. (r0, r3-r13 are caller saved)
+ * RTAS might touch to the stack. (r0, r3-r12 are caller saved)
*/
SAVE_GPR(2, r1) /* Save the TOC */
- SAVE_GPR(13, r1) /* Save paca */
SAVE_NVGPRS(r1) /* Save the non-volatiles */
mfcr r4
@@ -135,15 +134,14 @@ rtas_return_loc:
mtmsrd r6
/* relocation is off at this point */
- GET_PACA(r4)
- clrldi r4,r4,2 /* convert to realmode address */
+ GET_PACA(r13)
bcl 20,31,$+4
0: mflr r3
ld r3,(1f-0b)(r3) /* get &rtas_restore_regs */
- ld r1,PACAR1(r4) /* Restore our SP */
- ld r4,PACASAVEDMSR(r4) /* Restore our MSR */
+ ld r1,PACAR1(r13) /* Restore our SP */
+ ld r4,PACASAVEDMSR(r13) /* Restore our MSR */
mtspr SPRN_SRR0,r3
mtspr SPRN_SRR1,r4
@@ -159,11 +157,8 @@ _ASM_NOKPROBE_SYMBOL(rtas_return_loc)
rtas_restore_regs:
/* relocation is on at this point */
REST_GPR(2, r1) /* Restore the TOC */
- REST_GPR(13, r1) /* Restore paca */
REST_NVGPRS(r1) /* Restore the non-volatiles */
- GET_PACA(r13)
-
ld r4,_CCR(r1)
mtcr r4
ld r5,_CTR(r1)