OSDN Git Service

Merge patch series "riscv: Use PUD/P4D/PGD pages for the linear mapping"
authorPalmer Dabbelt <palmer@rivosinc.com>
Wed, 19 Apr 2023 03:43:07 +0000 (20:43 -0700)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 19 Apr 2023 03:43:07 +0000 (20:43 -0700)
commit2e75ab3189ecfe5f4383ef82896d30eaad0b3cd6
treea0f3d53827db6525d58b7cb05df9f83fd0f7eeab
parent5464912cfae706aff47f6253c495bf81284bc5d5
parent3335068f87217ea59d08f462187dc856652eea15
Merge patch series "riscv: Use PUD/P4D/PGD pages for the linear mapping"

Alexandre Ghiti <alexghiti@rivosinc.com> says:

This patchset intends to improve tlb utilization by using hugepages for
the linear mapping.

As reported by Anup in v6, when STRICT_KERNEL_RWX is enabled, we must
take care of isolating the kernel text and rodata so that they are not
mapped with a PUD mapping which would then assign wrong permissions to
the whole region: it is achieved the same way as arm64 by using the
memblock nomap API which isolates those regions and re-merge them afterwards
thus avoiding any issue with the system resources tree creation.

arch/riscv/include/asm/page.h |  19 ++++++-
 arch/riscv/mm/init.c          | 102 ++++++++++++++++++++++++++--------
 arch/riscv/mm/physaddr.c      |  16 ++++++
 drivers/of/fdt.c              |  11 ++--
 4 files changed, 118 insertions(+), 30 deletions(-)

* b4-shazam-merge:
  riscv: Use PUD/P4D/PGD pages for the linear mapping
  riscv: Move the linear mapping creation in its own function
  riscv: Get rid of riscv_pfn_base variable

Link: https://lore.kernel.org/r/20230324155421.271544-1-alexghiti@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/page.h