Commit b102063b authored by Michael Ellerman's avatar Michael Ellerman

powerpc/64s: Use BRANCH_TO_COMMON() for slb_miss_realmode

All the callers of slb_miss_realmode currently open code the #ifndef
CONFIG_RELOCATABLE check and the branch via CTR in the RELOCATABLE case.
We have a macro to do this, BRANCH_TO_COMMON(), so use it.
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Reviewed-by: default avatarNicholas Piggin <npiggin@gmail.com>
parent 8568f1e0
...@@ -514,18 +514,7 @@ EXC_REAL_BEGIN(data_access_slb, 0x380, 0x80) ...@@ -514,18 +514,7 @@ EXC_REAL_BEGIN(data_access_slb, 0x380, 0x80)
mfspr r3,SPRN_DAR mfspr r3,SPRN_DAR
mfspr r11,SPRN_SRR1 mfspr r11,SPRN_SRR1
crset 4*cr6+eq crset 4*cr6+eq
#ifndef CONFIG_RELOCATABLE BRANCH_TO_COMMON(r10, slb_miss_realmode)
b slb_miss_realmode
#else
/*
* We can't just use a direct branch to slb_miss_realmode
* because the distance from here to there depends on where
* the kernel ends up being put.
*/
LOAD_HANDLER(r10, slb_miss_realmode)
mtctr r10
bctr
#endif
EXC_REAL_END(data_access_slb, 0x380, 0x80) EXC_REAL_END(data_access_slb, 0x380, 0x80)
EXC_VIRT_BEGIN(data_access_slb, 0x4380, 0x80) EXC_VIRT_BEGIN(data_access_slb, 0x4380, 0x80)
...@@ -536,18 +525,7 @@ EXC_VIRT_BEGIN(data_access_slb, 0x4380, 0x80) ...@@ -536,18 +525,7 @@ EXC_VIRT_BEGIN(data_access_slb, 0x4380, 0x80)
mfspr r3,SPRN_DAR mfspr r3,SPRN_DAR
mfspr r11,SPRN_SRR1 mfspr r11,SPRN_SRR1
crset 4*cr6+eq crset 4*cr6+eq
#ifndef CONFIG_RELOCATABLE BRANCH_TO_COMMON(r10, slb_miss_realmode)
b slb_miss_realmode
#else
/*
* We can't just use a direct branch to slb_miss_realmode
* because the distance from here to there depends on where
* the kernel ends up being put.
*/
LOAD_HANDLER(r10, slb_miss_realmode)
mtctr r10
bctr
#endif
EXC_VIRT_END(data_access_slb, 0x4380, 0x80) EXC_VIRT_END(data_access_slb, 0x4380, 0x80)
TRAMP_KVM_SKIP(PACA_EXSLB, 0x380) TRAMP_KVM_SKIP(PACA_EXSLB, 0x380)
...@@ -580,13 +558,7 @@ EXC_REAL_BEGIN(instruction_access_slb, 0x480, 0x80) ...@@ -580,13 +558,7 @@ EXC_REAL_BEGIN(instruction_access_slb, 0x480, 0x80)
mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */ mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */
mfspr r11,SPRN_SRR1 mfspr r11,SPRN_SRR1
crclr 4*cr6+eq crclr 4*cr6+eq
#ifndef CONFIG_RELOCATABLE BRANCH_TO_COMMON(r10, slb_miss_realmode)
b slb_miss_realmode
#else
LOAD_HANDLER(r10, slb_miss_realmode)
mtctr r10
bctr
#endif
EXC_REAL_END(instruction_access_slb, 0x480, 0x80) EXC_REAL_END(instruction_access_slb, 0x480, 0x80)
EXC_VIRT_BEGIN(instruction_access_slb, 0x4480, 0x80) EXC_VIRT_BEGIN(instruction_access_slb, 0x4480, 0x80)
...@@ -597,13 +569,7 @@ EXC_VIRT_BEGIN(instruction_access_slb, 0x4480, 0x80) ...@@ -597,13 +569,7 @@ EXC_VIRT_BEGIN(instruction_access_slb, 0x4480, 0x80)
mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */ mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */
mfspr r11,SPRN_SRR1 mfspr r11,SPRN_SRR1
crclr 4*cr6+eq crclr 4*cr6+eq
#ifndef CONFIG_RELOCATABLE BRANCH_TO_COMMON(r10, slb_miss_realmode)
b slb_miss_realmode
#else
LOAD_HANDLER(r10, slb_miss_realmode)
mtctr r10
bctr
#endif
EXC_VIRT_END(instruction_access_slb, 0x4480, 0x80) EXC_VIRT_END(instruction_access_slb, 0x4480, 0x80)
TRAMP_KVM(PACA_EXSLB, 0x480) TRAMP_KVM(PACA_EXSLB, 0x480)
......
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