Skip to content

Use scratch registers on XLR/XLS/XLP

Jayachandran C linux-mips 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 3 repliesIn review

Changes in v3 from the cover letter

* Add patch 2 - fix up check for a valid scratch register

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4MIPS: Allow platform specific scratch registersarch/mips/kernel/cpu-probe.c arch/mips/mm/tlbex.c+27 -150 replies
2/4MIPS: Fixup check for invalid scratch registerarch/mips/mm/tlbex.c+5 -50 replies
3/4MIPS: mm: Use scratch for PGD when !CONFIG_MIPS_PGD_C0_CONTEXTarch/mips/include/asm/mmu_context.h arch/mips/mm/tlbex.c+92 -570 replies
3/4MIPS: mm: Use scratch for PGD when !CONFIG_MIPS_PGD_C0_CONTEXTarch/mips/include/asm/mmu_context.h arch/mips/mm/tlbex.c+92 -571 reply
4/4MIPS: Move definition of SMP processor id register to header filearch/mips/include/asm/mmu_context.h arch/mips/include/asm/stackframe.h arch/mips/include/asm/thread_info.h +1 more+50 -960 replies
4/4MIPS: Move definition of SMP processor id register to header filearch/mips/include/asm/mmu_context.h arch/mips/include/asm/stackframe.h arch/mips/include/asm/thread_info.h +1 more+50 -962 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] Use scratch registers on XLR/XLS/XLP

This set of patches enable the use of scratch registers on XLR/XLS and XLP (cop0 reg 22, sel 0-7) to optimize the generated TLB handlers.

The current code assumes scratch is 31, which is fixed by the first patch. The second patch fixes a minor issue in checking if scratch is allocated. The third patch enables use of a scratch register when it is available even on a 32-bit or non-r2 platform. The fourth patch is a cleanup to consolidate all the defines needed into one file, this patch does not have any change in logic.

In the earlier scheme, if MIPS_PGD_C0_CONTEXT was defined, the Context register or a scratch register would contain the current PGD, and the Xcontext would contain the smp_processor_id shifted to index pointers.

In the new scheme, the behavior when MIPS_PGD_C0_CONTEXT is defined remains the same. But when it is not defined, we still try to allocate a scratch register for the current pgd and the smp processor id remains in Context.

There is also an additional change is to generate the tlbmiss_handler_setup_pgd() function even when MIPS_PGD_C0_CONTEXT is not defined. This function will save the PGD in pgd_current[] and also in the scratch register if one has been allocated.

Comments/testing welcome.

Thanks,
JC.

Changes in v3:
* Add patch 2 - fix up check for a valid scratch register

Changes in v2:
* Update macros in thread-info.h, remove __ASSEMBLY__ part
* add ASM_CPUID_MFC0 and UASM_i_CPUID_MFC0 which allows us to remove a lot of conditional compilation.
* make c0_kscratch a inline function and remove global variable

Jayachandran C (4):
MIPS: Allow platform specific scratch registers
MIPS: Fixup check for invalid scratch register
MIPS: mm: Use scratch for PGD when !CONFIG_MIPS_PGD_C0_CONTEXT
MIPS: Move definition of SMP processor id register to header file

 arch/mips/include/asm/mmu_context.h |   22 ++---
 arch/mips/include/asm/stackframe.h  |   24 ++---
 arch/mips/include/asm/thread_info.h |   30 +++++-
 arch/mips/kernel/cpu-probe.c        |    1 +
 arch/mips/mm/tlbex.c                |  186 +++++++++++++++++------------------
 5 files changed, 132 insertions(+), 131 deletions(-)
Signature · 1 line
1.7.9.5