Skip to content

Commit

Permalink
powerpc/8xx: Simplify INVALIDATE_ADJACENT_PAGES_CPU15
Browse files Browse the repository at this point in the history
We now have r11 available as a scratch register so
INVALIDATE_ADJACENT_PAGES_CPU15() can be simplified.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/bdafd651b4ac3a851fd09249f5f3699c50da29f2.1606231483.git.christophe.leroy@csgroup.eu
  • Loading branch information
Christophe Leroy authored and Michael Ellerman committed Dec 9, 2020
1 parent bccc589 commit 576e02b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions arch/powerpc/kernel/head_8xx.S
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,13 @@ SystemCall:
*/

#ifdef CONFIG_8xx_CPU15
#define INVALIDATE_ADJACENT_PAGES_CPU15(addr) \
addi addr, addr, PAGE_SIZE; \
tlbie addr; \
addi addr, addr, -(PAGE_SIZE << 1); \
tlbie addr; \
addi addr, addr, PAGE_SIZE
#define INVALIDATE_ADJACENT_PAGES_CPU15(addr, tmp) \
addi tmp, addr, PAGE_SIZE; \
tlbie tmp; \
addi tmp, addr, -PAGE_SIZE; \
tlbie tmp
#else
#define INVALIDATE_ADJACENT_PAGES_CPU15(addr)
#define INVALIDATE_ADJACENT_PAGES_CPU15(addr, tmp)
#endif

InstructionTLBMiss:
Expand All @@ -198,7 +197,7 @@ InstructionTLBMiss:
* kernel page tables.
*/
mfspr r10, SPRN_SRR0 /* Get effective address of fault */
INVALIDATE_ADJACENT_PAGES_CPU15(r10)
INVALIDATE_ADJACENT_PAGES_CPU15(r10, r11)
mtspr SPRN_MD_EPN, r10
#ifdef CONFIG_MODULES
mfcr r11
Expand Down

0 comments on commit 576e02b

Please sign in to comment.