]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/32s: Save content of sr0 to avoid 'mfsr'
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Tue, 19 Oct 2021 07:29:18 +0000 (09:29 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 9 Dec 2021 11:41:17 +0000 (22:41 +1100)
commit55fccb93b67684397edcb2258bf006157f59dcdd
treea9c27bfdbaa5b4b79a93564f80ac31165f4ff560
parent9c15ec44aac3a14e4f4b84269e6ae70b9c762d20
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
arch/powerpc/include/asm/book3s/32/mmu-hash.h
arch/powerpc/include/asm/processor.h
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kernel/entry_32.S
arch/powerpc/mm/book3s32/kuap.c
arch/powerpc/mm/book3s32/kuep.c
arch/powerpc/mm/book3s32/mmu_context.c
arch/powerpc/mm/mmu_context.c