diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2021-10-19 09:29:18 +0200 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2021-12-09 12:41:17 +0100 |
commit | 70428da94c7ad692d306747a04117543827292a7 (patch) | |
tree | a9c27bfdbaa5b4b79a93564f80ac31165f4ff560 /arch/powerpc/kernel/asm-offsets.c | |
parent | powerpc/32s: Do kuep_lock() and kuep_unlock() in assembly (diff) | |
download | linux-70428da94c7ad692d306747a04117543827292a7.tar.xz linux-70428da94c7ad692d306747a04117543827292a7.zip |
powerpc/32s: Save content of sr0 to avoid 'mfsr'
Calling 'mfsr' to get the content of segment registers is heavy,
in addition it requires clearing of the 'reserved' bits.
In order to avoid this operation, save it in mm context and in
thread struct.
The saved sr0 is the one used by kernel, this means that on
locking entry it can be used as is.
For unlocking, the only thing to do is to clear SR_NX.
This improves null_syscall selftest by 12 cycles, ie 4%.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/b02baf2ed8f09bad910dfaeeb7353b2ae6830525.1634627931.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'arch/powerpc/kernel/asm-offsets.c')
-rw-r--r-- | arch/powerpc/kernel/asm-offsets.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c index b823f484c640..cf3436b7b166 100644 --- a/arch/powerpc/kernel/asm-offsets.c +++ b/arch/powerpc/kernel/asm-offsets.c @@ -139,6 +139,7 @@ int main(void) OFFSET(THR11, thread_struct, r11); OFFSET(THLR, thread_struct, lr); OFFSET(THCTR, thread_struct, ctr); + OFFSET(THSR0, thread_struct, sr0); #endif #ifdef CONFIG_SPE OFFSET(THREAD_EVR0, thread_struct, evr[0]); |