diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2021-03-12 12:50:44 +0000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2021-03-29 13:22:10 +1100 |
commit | 16db54369df614bf386aa31a6730c5bdb1bf4ffd (patch) | |
tree | 77b4e805b4d5a319c82749bb89beff86ddf21b3f /arch/powerpc/kernel/head_booke.h | |
parent | a305597850c96e2f2d349533cf3b514fa4b7b9f8 (diff) | |
download | lwn-16db54369df614bf386aa31a6730c5bdb1bf4ffd.tar.gz lwn-16db54369df614bf386aa31a6730c5bdb1bf4ffd.zip |
powerpc/32: Save remaining registers in exception prolog
Save non volatile registers, XER, CTR, MSR and NIP in exception prolog.
Also assign proper value to r2 and r3 there.
For now, recalculate thread pointer in prepare_transfer_to_handler.
It will disappear once KUAP is ported to C.
And remove the comment which is now completely wrong.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/56f0cde9dd0362edf2ddba4d887552013eee7329.1615552867.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'arch/powerpc/kernel/head_booke.h')
-rw-r--r-- | arch/powerpc/kernel/head_booke.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/head_booke.h b/arch/powerpc/kernel/head_booke.h index 4d583fbef0b6..7f3dd5fae51d 100644 --- a/arch/powerpc/kernel/head_booke.h +++ b/arch/powerpc/kernel/head_booke.h @@ -89,6 +89,18 @@ END_BTB_FLUSH_SECTION stw r10,_TRAP(r1) SAVE_4GPRS(3, r1) SAVE_2GPRS(7, r1) + SAVE_NVGPRS(r1) + stw r2,GPR2(r1) + stw r12,_NIP(r1) + stw r9,_MSR(r1) + mfctr r10 + mfspr r2,SPRN_SPRG_THREAD + stw r10,_CTR(r1) + tovirt(r2, r2) + mfspr r10,SPRN_XER + addi r2, r2, -THREAD + stw r10,_XER(r1) + addi r3,r1,STACK_FRAME_OVERHEAD .endm .macro prepare_transfer_to_handler |