Commit de1cd079 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/32s: Use SPRN_SPRG_SCRATCH2 in DSI prolog

Use SPRN_SPRG_SCRATCH2 as an alternative scratch register in
the early part of DSI prolog in order to avoid clobbering
SPRN_SPRG_SCRATCH0/1 used by other prologs.

The 603 doesn't like a jump from DataLoadTLBMiss to the 10 nops
that are now in the beginning of DSI exception as a result of
the feature section. To workaround this, add a jump as alternative.
It also avoids fetching 10 nops for nothing.
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/f9f8df2a2be93568768ef1ac793639f7914cf103.1606285014.git.christophe.leroy@csgroup.eu
parent 6285f9cf
...@@ -1204,6 +1204,7 @@ ...@@ -1204,6 +1204,7 @@
#ifdef CONFIG_PPC_BOOK3S_32 #ifdef CONFIG_PPC_BOOK3S_32
#define SPRN_SPRG_SCRATCH0 SPRN_SPRG0 #define SPRN_SPRG_SCRATCH0 SPRN_SPRG0
#define SPRN_SPRG_SCRATCH1 SPRN_SPRG1 #define SPRN_SPRG_SCRATCH1 SPRN_SPRG1
#define SPRN_SPRG_SCRATCH2 SPRN_SPRG2
#define SPRN_SPRG_603_LRU SPRN_SPRG4 #define SPRN_SPRG_603_LRU SPRN_SPRG4
#endif #endif
......
...@@ -288,9 +288,9 @@ MachineCheck: ...@@ -288,9 +288,9 @@ MachineCheck:
DO_KVM 0x300 DO_KVM 0x300
DataAccess: DataAccess:
#ifdef CONFIG_VMAP_STACK #ifdef CONFIG_VMAP_STACK
mtspr SPRN_SPRG_SCRATCH0,r10
mfspr r10, SPRN_SPRG_THREAD
BEGIN_MMU_FTR_SECTION BEGIN_MMU_FTR_SECTION
mtspr SPRN_SPRG_SCRATCH2,r10
mfspr r10, SPRN_SPRG_THREAD
stw r11, THR11(r10) stw r11, THR11(r10)
mfspr r10, SPRN_DSISR mfspr r10, SPRN_DSISR
mfcr r11 mfcr r11
...@@ -304,19 +304,11 @@ BEGIN_MMU_FTR_SECTION ...@@ -304,19 +304,11 @@ BEGIN_MMU_FTR_SECTION
.Lhash_page_dsi_cont: .Lhash_page_dsi_cont:
mtcr r11 mtcr r11
lwz r11, THR11(r10) lwz r11, THR11(r10)
END_MMU_FTR_SECTION_IFSET(MMU_FTR_HPTE_TABLE) mfspr r10, SPRN_SPRG_SCRATCH2
mtspr SPRN_SPRG_SCRATCH1,r11 MMU_FTR_SECTION_ELSE
mfspr r11, SPRN_DAR b 1f
stw r11, DAR(r10) ALT_MMU_FTR_SECTION_END_IFSET(MMU_FTR_HPTE_TABLE)
mfspr r11, SPRN_DSISR 1: EXCEPTION_PROLOG_0 handle_dar_dsisr=1
stw r11, DSISR(r10)
mfspr r11, SPRN_SRR0
stw r11, SRR0(r10)
mfspr r11, SPRN_SRR1 /* check whether user or kernel */
stw r11, SRR1(r10)
mfcr r10
andi. r11, r11, MSR_PR
EXCEPTION_PROLOG_1 EXCEPTION_PROLOG_1
b handle_page_fault_tramp_1 b handle_page_fault_tramp_1
#else /* CONFIG_VMAP_STACK */ #else /* CONFIG_VMAP_STACK */
...@@ -764,7 +756,7 @@ fast_hash_page_return: ...@@ -764,7 +756,7 @@ fast_hash_page_return:
/* DSI */ /* DSI */
mtcr r11 mtcr r11
lwz r11, THR11(r10) lwz r11, THR11(r10)
mfspr r10, SPRN_SPRG_SCRATCH0 mfspr r10, SPRN_SPRG_SCRATCH2
rfi rfi
1: /* ISI */ 1: /* ISI */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment