From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
npiggin@gmail.com
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 00/14] powerpc/32: Reduce head complexity and re-activate MMU earlier
Date: Fri, 22 Jan 2021 10:05:23 +0000 (UTC) [thread overview]
Message-ID: <cover.1611309841.git.christophe.leroy@csgroup.eu> (raw)
This series is a first step on the way to C syscall/exception entry/exit.
This series aims at reducing exception/syscall prologs complexity.
It also brings earlier MMU re-activation.
This series is based on Nick's v6 series "powerpc: interrupt wrappers".
It takes benefit of the removal of traps arguments (patches 2-7 of that series).
I have squashed those patches as second patch of my series in order to
please test robots. My series cleanly applies on top of entire Nick's series.
v2 has been reworked in order to apply to all PPC32, including BOOKE and 40x.
At the time being, we have two pathes in the prologs: one for
when we have VMAP stack and one when we don't.
When VMAP stack is supported, there is special prolog code to
allow accessing stack with MMU on.
That code that accesses VM stack with MMU on is also able to access
linear memory, so it can also access non VM stack with MMU on.
CONFIG_VMAP_STACK as been on by default on 6xx and 8xx for several
kernel releases now, so it is known to work.
On the 8xx, null_syscall runs in 292 cycles with VMAP_STACK and in
296 cycles without VMAP stack.
On the 832x, null_syscall runs in 224 cycles with VMAP_STACK and in
213 cycles without VMAP stack.
By removing the old non VMAP stack code, and using the same prolog
regardless of the activation of VMAP stacks, we make the code a lot
simplier and reduce the number of test cases.
BOOKE has MMU always on, so there is no change needed for that.
To allow removal of the old non VMAP stack code, only 40x need
to get adapted to support earlier MMU activation. That's what
patches 3-8 are for.
Once this is done, we easily go one step further and re-activate
Instruction translation at the same time as data translation.
At the end, null_syscall runs in 286 cycles on the 8xx and in 216
cycles on the 832x
Changes in v2:
- Implemented early MMU activation also on 40x
- Added BOOKE in the loop
- Removed the patches that replace r11 by r1 all over the place (too
much churn for very small benefit for now)
Christophe Leroy (14):
powerpc/32s: Only build hash code when CONFIG_PPC_BOOK3S_604 is
selected
NOT TO BE MERGED - Squash of patches 2-7 of v6 series "powerpc:
interrupt wrappers"
powerpc/40x: Don't use SPRN_SPRG_SCRATCH0/1 in TLB miss handlers
powerpc/40x: Change CRITICAL_EXCEPTION_PROLOG macro to a gas macro
powerpc/40x: Save SRR0/SRR1 and r10/r11 earlier in critical exception
powerpc/40x: Reorder a few instructions in critical exception prolog
powerpc/40x: Prepare for enabling MMU in critical exception prolog
powerpc/40x: Prepare normal exception handler for enabling MMU early
powerpc/32: Preserve cr1 in exception prolog stack check
powerpc/32: Use LOAD_REG_IMMEDIATE() to load MSR values
powerpc/32: Always enable data translation in exception prolog
powerpc/32: Enable instruction translation at the same time as data
translation
powerpc/32: Remove msr argument in EXC_XFER_TEMPLATE()
powerpc/32: Use fast instructions to change MSR EE/RI when available
arch/powerpc/include/asm/asm-prototypes.h | 4 +-
arch/powerpc/include/asm/book3s/64/mmu-hash.h | 1 +
arch/powerpc/include/asm/bug.h | 7 +-
arch/powerpc/include/asm/debug.h | 3 +-
arch/powerpc/include/asm/hw_irq.h | 46 +++++
arch/powerpc/include/asm/processor.h | 4 +-
arch/powerpc/kernel/asm-offsets.c | 2 -
arch/powerpc/kernel/entry_32.S | 128 ++++----------
arch/powerpc/kernel/exceptions-64e.S | 5 +-
arch/powerpc/kernel/exceptions-64s.S | 164 +++++------------
arch/powerpc/kernel/fpu.S | 2 -
arch/powerpc/kernel/head_32.h | 167 ++++--------------
arch/powerpc/kernel/head_40x.S | 161 +++++++++--------
arch/powerpc/kernel/head_8xx.S | 26 +--
arch/powerpc/kernel/head_book3s_32.S | 52 ++----
arch/powerpc/kernel/head_booke.h | 20 +--
arch/powerpc/kernel/idle_6xx.S | 12 +-
arch/powerpc/kernel/idle_e500.S | 4 +-
arch/powerpc/kernel/process.c | 7 +-
arch/powerpc/kernel/traps.c | 2 +-
arch/powerpc/kernel/vector.S | 2 -
arch/powerpc/mm/book3s32/Makefile | 4 +-
arch/powerpc/mm/book3s32/hash_low.S | 14 --
arch/powerpc/mm/book3s64/hash_utils.c | 79 ++++++---
arch/powerpc/mm/book3s64/slb.c | 11 +-
arch/powerpc/mm/fault.c | 18 +-
arch/powerpc/platforms/8xx/machine_check.c | 2 +-
27 files changed, 354 insertions(+), 593 deletions(-)
--
2.25.0
next reply other threads:[~2021-01-22 10:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-22 10:05 Christophe Leroy [this message]
2021-01-22 10:05 ` [PATCH v2 01/14] powerpc/32s: Only build hash code when CONFIG_PPC_BOOK3S_604 is selected Christophe Leroy
2021-01-22 10:05 ` [PATCH v2 02/14] NOT TO BE MERGED - Squash of patches 2-7 of v6 series "powerpc: interrupt wrappers" Christophe Leroy
2021-01-22 10:05 ` [PATCH v2 03/14] powerpc/40x: Don't use SPRN_SPRG_SCRATCH0/1 in TLB miss handlers Christophe Leroy
2021-01-22 10:05 ` [PATCH v2 04/14] powerpc/40x: Change CRITICAL_EXCEPTION_PROLOG macro to a gas macro Christophe Leroy
2021-01-22 10:05 ` [PATCH v2 05/14] powerpc/40x: Save SRR0/SRR1 and r10/r11 earlier in critical exception Christophe Leroy
2021-01-22 10:05 ` [PATCH v2 06/14] powerpc/40x: Reorder a few instructions in critical exception prolog Christophe Leroy
2021-01-22 10:05 ` [PATCH v2 07/14] powerpc/40x: Prepare for enabling MMU " Christophe Leroy
2021-01-22 10:05 ` [PATCH v2 08/14] powerpc/40x: Prepare normal exception handler for enabling MMU early Christophe Leroy
2021-01-22 10:05 ` [PATCH v2 09/14] powerpc/32: Preserve cr1 in exception prolog stack check Christophe Leroy
2021-01-22 10:05 ` [PATCH v2 10/14] powerpc/32: Use LOAD_REG_IMMEDIATE() to load MSR values Christophe Leroy
2021-01-22 10:05 ` [PATCH v2 11/14] powerpc/32: Always enable data translation in exception prolog Christophe Leroy
2021-01-22 10:05 ` [PATCH v2 12/14] powerpc/32: Enable instruction translation at the same time as data translation Christophe Leroy
2021-01-22 10:05 ` [PATCH v2 13/14] powerpc/32: Remove msr argument in EXC_XFER_TEMPLATE() Christophe Leroy
2021-01-22 10:05 ` [PATCH v2 14/14] powerpc/32: Use fast instructions to change MSR EE/RI when available Christophe Leroy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1611309841.git.christophe.leroy@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox