Skip to content

Convert powerpc to default topdown mmap layout (v10)

Christophe Leroy linux-mm linuxppc-dev lkml stable 11 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v10 Latest13 patches 5 repliesIn review
  2. v94 patches 3 repliesSuperseded
  3. v814 patches 10 repliesSuperseded
Earlier versions · 8
VersionPostedPatchesRepliesStatus
v714 patches1 replyApplied
v614 patches2 repliesSuperseded
v511 patches0 repliesSuperseded
v410 patches16 repliesSuperseded
v310 patches0 repliesSuperseded
v2 posting 2/29 patches6 repliesSuperseded
v2 posting 1/29 patches1 replySuperseded
v18 patches10 repliesSuperseded

Changes in v10 from the cover letter

- Moved patch 4 as first patch in order to allow merging a stable backporting independently

Patches in v10 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13mm, hugetlbfs: Allow for "high" userspace addressesfs/hugetlbfs/inode.c include/linux/sched/mm.h mm/mmap.c+13 -121 reply
2/13mm: Allow arch specific arch_randomize_brk() with CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUTmm/util.c+1 -10 replies
3/13mm, hugetlbfs: Allow an arch to always use generic versions of get_unmapped_area functionsfs/hugetlbfs/inode.c include/linux/hugetlb.h include/linux/sched/mm.h +1 more+51 -110 replies
4/13mm: Add len and flags parameters to arch_get_mmap_end()arch/arm64/include/asm/processor.h fs/hugetlbfs/inode.c include/linux/sched/mm.h +1 more+8 -80 replies
5/13powerpc/mm: Move vma_mmu_pagesize()arch/powerpc/mm/hugetlbpage.c arch/powerpc/mm/slice.c+9 -110 replies
6/13powerpc/mm: Make slice specific to book3s/64arch/powerpc/include/asm/book3s/64/mmu-hash.h arch/powerpc/include/asm/book3s/64/slice.h arch/powerpc/include/asm/page.h +6 more+20 -630 replies
7/13powerpc/mm: Remove CONFIG_PPC_MM_SLICESarch/powerpc/include/asm/hugetlb.h arch/powerpc/include/asm/paca.h arch/powerpc/kernel/paca.c +5 more+5 -360 replies
8/13powerpc/mm: Use generic_get_unmapped_area() and call it from arch_get_unmapped_area()arch/powerpc/include/asm/task_size_64.h arch/powerpc/mm/mmap.c+14 -1210 replies
9/13powerpc/mm: Use generic_hugetlb_get_unmapped_area()arch/powerpc/include/asm/book3s/64/hugetlb.h arch/powerpc/mm/book3s64/radix_hugetlbpage.c arch/powerpc/mm/hugetlbpage.c+1 -620 replies
10/13powerpc/mm: Move get_unmapped_area functions to slice.carch/powerpc/include/asm/book3s/64/mmu.h arch/powerpc/include/asm/book3s/64/slice.h arch/powerpc/mm/book3s64/slice.c +2 more+48 -633 replies
11/13powerpc/mm: Enable full randomisation of memory mappingsarch/powerpc/mm/book3s64/slice.c arch/powerpc/mm/mmap.c+8 -120 replies
12/13powerpc/mm: Convert to default topdown mmap layoutarch/powerpc/Kconfig arch/powerpc/include/asm/processor.h arch/powerpc/mm/Makefile +1 more+2 -1090 replies
13/13powerpc: Simplify and move arch_randomize_brk()arch/powerpc/kernel/process.c arch/powerpc/mm/book3s64/hash_utils.c+19 -410 replies

Reviews trailers per patch

7 of 13 patches have a Reviewed-by or Acked-by.

PatchNicholas PigginCatalin MarinasAndrew Morton
1/13R-b A-b
2/13A-b
3/13R-b A-b
4/13A-b A-b
5/13R-b
6/13R-b
7/13R-b
8/13
9/13
10/13
11/13
12/13
13/13

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v10 thread

Cover letter [PATCH v10 00/13] Convert powerpc to default topdown mmap layout (v10)

Rebased on top of v5.18-rc1

This series converts powerpc to default topdown mmap layout.

First patch is a mm fix that should go into v5.18 and stable.

Andrew, can you take it ?

It is a complement/fix of f6795053dac8 ("mm: mmap: Allow for "high" userspace addresses") for hugetlb. It adds support for "high" userspace addresses that are optionally supported on the system and have to be requested via a hint mechanism ("high" addr parameter to mmap).

powerpc requires its own arch_get_unmapped_area() only when slices are needed, which is only for book3s/64. First part of the series moves slices into book3s/64 specific directories and cleans up other subarchitectures.

Last part converts to default topdown mmap layout.

A small modification is done to core mm to allow powerpc to still provide its own arch_randomize_brk()

Another modification is done to core mm to allow powerpc to use generic versions of get_unmapped_area functions for Radix while still providing its own implementation for Hash, the selection between Radix and Hash being doing at runtime.

Last modification to core mm is to give len and flags to arch_get_mmap_end().

Changes in v10:
- Moved patch 4 as first patch in order to allow merging a stable backporting independently

Changes in v9:
- v9 was just a split of v8 for tentatively getting the mm part merge through mm and the rest through powerpc tree

Changes in v8:
- Moved patch "sizes.h: Add SZ_1T macro" up from which is already in linux-next but not in Linus tree yet.
- Rebased on today's powerpc/next

Changes in v7:
- Taken into account comments from Catalin (patches 3 and 4)

Changes in v6:
- New patch (patch 4) to take arch_get_mmap_base() and arch_get_mmap_end() into account in generic hugetlb_get_unmapped_area()
- Get back arch_randomize_brk() simplification as it relies on default topdown mmap layout.
- Fixed precedence between || and && in powerpc's arch_get_mmap_end() (patch 9)

Changes in v5:
- Added patch 3
- Added arch_get_mmap_base() and arch_get_mmap_end() to patch 7 to better match original powerpc behaviour
- Switched patched 10 and 11 and performed full randomisation in patch 10 just before switching to default implementation, as suggested by Nic.

Changes in v4:
- Move arch_randomize_brk() simplification out of this series
- Add a change to core mm to enable using generic implementation while providing arch specific one at the same time.
- Reworked radix get_unmapped_area to use generic implementation
- Rebase on top of Nic's series v6

Changes in v3:
- Fixed missing <linux/elf-randomize.h> in last patch
- Added a patch to move SZ_1T out of drivers/pci/controller/pci-xgene.c

Changes in v2:
- Moved patch 4 before patch 2
- Make generic arch_randomize_brk() __weak
- Added patch 9

Christophe Leroy (13):
mm, hugetlbfs: Allow for "high" userspace addresses
mm: Allow arch specific arch_randomize_brk() with
CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
mm, hugetlbfs: Allow an arch to always use generic versions of
get_unmapped_area functions
mm: Add len and flags parameters to arch_get_mmap_end() powerpc/mm: Move vma_mmu_pagesize()
powerpc/mm: Make slice specific to book3s/64 powerpc/mm: Remove CONFIG_PPC_MM_SLICES
powerpc/mm: Use generic_get_unmapped_area() and call it from
arch_get_unmapped_area()
powerpc/mm: Use generic_hugetlb_get_unmapped_area() powerpc/mm: Move get_unmapped_area functions to slice.c powerpc/mm: Enable full randomisation of memory mappings powerpc/mm: Convert to default topdown mmap layout
powerpc: Simplify and move arch_randomize_brk()

 arch/arm64/include/asm/processor.h            |   4 +-
 arch/powerpc/Kconfig                          |   2 +-
 arch/powerpc/include/asm/book3s/64/hugetlb.h  |   4 -
 arch/powerpc/include/asm/book3s/64/mmu-hash.h |   1 +
 arch/powerpc/include/asm/book3s/64/mmu.h      |   6 -
 arch/powerpc/include/asm/book3s/64/slice.h    |  24 ++
 arch/powerpc/include/asm/hugetlb.h            |   2 +-
 arch/powerpc/include/asm/paca.h               |   7 -
 arch/powerpc/include/asm/page.h               |   1 -
 arch/powerpc/include/asm/processor.h          |   2 -
 arch/powerpc/include/asm/slice.h              |  46 ----
 arch/powerpc/include/asm/task_size_64.h       |   8 +
 arch/powerpc/kernel/paca.c                    |   5 -
 arch/powerpc/kernel/process.c                 |  41 ---
 arch/powerpc/mm/Makefile                      |   3 +-
 arch/powerpc/mm/book3s64/Makefile             |   2 +-
 arch/powerpc/mm/book3s64/hash_utils.c         |  33 ++-
 arch/powerpc/mm/book3s64/radix_hugetlbpage.c  |  55 ----
 arch/powerpc/mm/{ => book3s64}/slice.c        |  71 ++++-
 arch/powerpc/mm/hugetlbpage.c                 |  34 ---
 arch/powerpc/mm/mmap.c                        | 256 ------------------
 arch/powerpc/mm/nohash/mmu_context.c          |   9 -
 arch/powerpc/mm/nohash/tlb.c                  |   4 -
 arch/powerpc/platforms/Kconfig.cputype        |   4 -
 fs/hugetlbfs/inode.c                          |  26 +-
 include/linux/hugetlb.h                       |   5 +
 include/linux/sched/mm.h                      |  17 ++
 mm/mmap.c                                     |  43 +--
 mm/util.c                                     |   2 +-
 29 files changed, 183 insertions(+), 534 deletions(-)
 delete mode 100644 arch/powerpc/include/asm/slice.h
 rename arch/powerpc/mm/{ => book3s64}/slice.c (91%)
 delete mode 100644 arch/powerpc/mm/mmap.c
Signature · 1 line
2.35.1