RE: [PATCH 05/11] powerpc/8xx: Optimise access to swapper_pg_dir
From: David Laight <hidden>
Date: 2015-01-06 14:42:16
Also in:
lkml
From: leroy christophe
Le 06/01/2015 13:08, David Laight a =E9crit :quoted
quoted
On Tue, 2014-12-16 at 16:03 +0100, Christophe Leroy wrote:quoted
All accessed to PGD entries are done via 0(r11). By using lower part of swapper_pg_dir as load index to r11, we can re=
move the
quoted
quoted
quoted
ori instruction. Signed-off-by: Christophe Leroy <redacted>Nice :) Acked-by: Joakim Tjernlund <redacted>quoted
--- arch/powerpc/kernel/head_8xx.S | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/hea=
d_8xx.S
quoted
quoted
quoted
index ae05f28..aa45225 100644--- a/arch/powerpc/kernel/head_8xx.S +++ b/arch/powerpc/kernel/head_8xx.S@@ -322,13 +322,12 @@ InstructionTLBMiss: mfspr r11, SPRN_M_TW/* Get level 1 table base address */ #ifdef CONFIG_MODULES beq 3f - lis r11, (swapper_pg_dir-PAGE_OFFSET)@h - ori r11, r11, (swapper_pg_dir-PAGE_OFFSET)@l + lis r11, (swapper_pg_dir-PAGE_OFFSET)@ha 3: #endif /* Insert level 1 index */ rlwimi r11, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT =
- 2) << 1, 29
quoted
quoted
quoted
- lwz r11, 0(r11)/* Get the level 1 entry */ + lwz r11, (swapper_pg_dir-PAGE_OFFSET)@l(r11)/* Get the le=
vel 1 entry */
quoted
quoted
quoted
On the face of it that fragment doesn't look right when CONFIG_MODULES =
is undefined.
quoted
DavidI'm not sure I understand what you mean. =20 The other part of the patch adds the following: + li r5, (swapper_pg_dir-PAGE_OFFSET)@l + sub r4, r4, r5 =20 r4 is the value put into SPRN_M_TW, so I don't see what may be wrong.
Ok, but it is completely non-obvious. You probably need to change some comments somewhere about what is held in SPRN_M_TW - since it is no longer the L1 base address, but that value offset by some 'random' amount. David