powerpc/64s: syscall real mode entry use mtmsrd rather than rfid

Have the real mode system call entry handler branch to the kernel
0xc000... address and then use mtmsrd to enable the MMU, rather than use
SRRs and rfid.

Commit 8729c26e67 ("powerpc/64s/exception: Move real to virt switch
into the common handler") implemented this style of real mode entry for
other interrupt handlers, so this brings system calls into line with
them, which is the main motivcation for the change.

This tends to be slightly faster due to avoiding the mtsprs, and it also
does not clobber the SRR registers, which becomes important in a
subsequent change. The real mode entry points don't tend to be too
important for performance these days, but it is possible for a
hypervisor to run guests in AIL=0 mode for certian reasons.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210208063326.331502-1-npiggin@gmail.com
This commit is contained in:
Nicholas Piggin 2021-02-08 16:33:26 +10:00 коммит произвёл Michael Ellerman
Родитель 60a707d0c9
Коммит 14ad0e7d04
2 изменённых файлов: 9 добавлений и 6 удалений

Просмотреть файл

@ -225,6 +225,12 @@ _ASM_NOKPROBE_SYMBOL(system_call_vectored_emulate)
b system_call_vectored_common b system_call_vectored_common
#endif #endif
.balign IFETCH_ALIGN_BYTES
.globl system_call_common_real
system_call_common_real:
ld r10,PACAKMSR(r13) /* get MSR value for kernel */
mtmsrd r10
.balign IFETCH_ALIGN_BYTES .balign IFETCH_ALIGN_BYTES
.globl system_call_common .globl system_call_common
system_call_common: system_call_common:

Просмотреть файл

@ -1973,12 +1973,9 @@ END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE)
HMT_MEDIUM HMT_MEDIUM
.if ! \virt .if ! \virt
__LOAD_HANDLER(r10, system_call_common) __LOAD_HANDLER(r10, system_call_common_real)
mtspr SPRN_SRR0,r10 mtctr r10
ld r10,PACAKMSR(r13) bctr
mtspr SPRN_SRR1,r10
RFI_TO_KERNEL
b . /* prevent speculative execution */
.else .else
li r10,MSR_RI li r10,MSR_RI
mtmsrd r10,1 /* Set RI (EE=0) */ mtmsrd r10,1 /* Set RI (EE=0) */