linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v8 0/4] riscv: Use PUD/P4D/PGD pages for the linear mapping
@ 2023-03-16 13:17 Alexandre Ghiti
  2023-03-16 13:17 ` [PATCH v8 1/4] riscv: Get rid of riscv_pfn_base variable Alexandre Ghiti
                   ` (4 more replies)
  0 siblings, 5 replies; 24+ messages in thread
From: Alexandre Ghiti @ 2023-03-16 13:17 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Rob Herring, Frank Rowand, Mike Rapoport,
	Andrew Morton, Anup Patel, linux-arm-kernel, linux-kernel,
	linux-riscv, devicetree, linux-mm
  Cc: Alexandre Ghiti

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 by introducing a new memblock API.

Another patch makes use of this new API in arm64 which used some sort of
hack to solve this issue: it was built/boot tested successfully.

base-commit-tag: v6.3-rc1

v8:
- Fix rv32, as reported by Anup
- Do not modify memblock_isolate_range and fixes comment, as suggested by Mike
- Use the new memblock API for crash kernel too in arm64, as suggested by Andrew
- Fix arm64 double mapping (which to me did not work in v7), but ends up not
  being pretty at all, will wait for comments from arm64 reviewers, but
  this patch can easily be dropped if they do not want it.

v7:
- Fix Anup bug report by introducing memblock_isolate_memory which
  allows us to split the memblock mappings and then avoid to map the
  the PUD which contains the kernel as read only
- Add a patch to arm64 to use this newly introduced API

v6:
- quiet LLVM warning by casting phys_ram_base into an unsigned long

v5:
- Fix nommu builds by getting rid of riscv_pfn_base in patch 1, thanks
  Conor
- Add RB from Andrew

v4:
- Rebase on top of v6.2-rc3, as noted by Conor
- Add Acked-by Rob

v3:
- Change the comment about initrd_start VA conversion so that it fits
  ARM64 and RISCV64 (and others in the future if needed), as suggested
  by Rob

v2:
- Add a comment on why RISCV64 does not need to set initrd_start/end that
  early in the boot process, as asked by Rob

Alexandre Ghiti (4):
  riscv: Get rid of riscv_pfn_base variable
  mm: Introduce memblock_isolate_memory
  arm64: Make use of memblock_isolate_memory for the linear mapping
  riscv: Use PUD/P4D/PGD pages for the linear mapping

 arch/arm64/mm/mmu.c           | 25 +++++++++++------
 arch/riscv/include/asm/page.h | 19 +++++++++++--
 arch/riscv/mm/init.c          | 53 ++++++++++++++++++++++++++++-------
 arch/riscv/mm/physaddr.c      | 16 +++++++++++
 drivers/of/fdt.c              | 11 ++++----
 include/linux/memblock.h      |  1 +
 mm/memblock.c                 | 20 +++++++++++++
 7 files changed, 119 insertions(+), 26 deletions(-)

-- 
2.37.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2024-03-12  9:34 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-16 13:17 [PATCH v8 0/4] riscv: Use PUD/P4D/PGD pages for the linear mapping Alexandre Ghiti
2023-03-16 13:17 ` [PATCH v8 1/4] riscv: Get rid of riscv_pfn_base variable Alexandre Ghiti
2023-03-16 13:17 ` [PATCH v8 2/4] mm: Introduce memblock_isolate_memory Alexandre Ghiti
2023-03-16 20:12   ` Mike Rapoport
2023-03-20 10:54     ` Alexandre Ghiti
2023-03-20 17:44       ` Mike Rapoport
2023-03-23 11:52         ` Alexandre Ghiti
2023-03-23 12:16           ` Mike Rapoport
2023-03-23 12:30             ` Alexandre Ghiti
2023-03-16 13:17 ` [PATCH v8 3/4] arm64: Make use of memblock_isolate_memory for the linear mapping Alexandre Ghiti
2023-03-24 15:21   ` Will Deacon
2023-03-24 15:23     ` Alexandre Ghiti
2023-03-16 13:17 ` [PATCH v8 4/4] riscv: Use PUD/P4D/PGD pages " Alexandre Ghiti
2023-03-23 12:18 ` [PATCH v8 0/4] " Anup Patel
2023-03-23 12:54   ` Alexandre Ghiti
2023-03-23 14:55     ` Anup Patel
2023-03-24  9:59       ` Alexandre Ghiti
     [not found]         ` <CAPqJEFr6MgUyARfbWAo7EeQKLVd4xRJz_LOYN68UC-kPD1Hr5A@mail.gmail.com>
2024-01-18  8:23           ` Fwd: " Nylon Chen
2024-01-18 13:01             ` Alexandre Ghiti
2024-01-19  9:26               ` Nylon Chen
2024-02-05  9:32                 ` Alexandre Ghiti
2024-03-12  6:40                   ` Nylon Chen
2024-03-12  6:48                     ` Nylon Chen
2024-03-12  9:33                       ` Alexandre Ghiti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).