Skip to content

use __create_pgd_mapping() to implement idmap and unify codes

Pingfan Liu linux-arm-kernel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 4 repliesIn review
  2. v210 patches 0 repliesSuperseded
  3. v1 RFC8 patches 4 repliesSuperseded

Changes in v3 from the cover letter

-1. leave out the part of redefinition the CONFIG_PGTABLE_LEVEL,
concentrate on sharing __create_pgd_mapping() in head.S as the first step.
-2. make IDMAP_PGTABLE_LEVELS use the max value ([3/5])

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5arm64/mm: introduce pgtable allocator for idmap_pg_dir and init_pg_dirarch/arm64/mm/mmu.c+22 -00 replies
2/5arm64/mm: disable WARN_ON() and BUG_ON() in __create_pgd_mapping() if too earlyarch/arm64/mm/mmu.c+26 -160 replies
3/5arm64/mm: unconditionally set IDMAP_PGTABLE_LEVELS to max pgtable levelarch/arm64/include/asm/kernel-pgtable.h+12 -90 replies
4/5arm64/mm: make __create_pgd_mapping() capable to handle pgtable's paddrarch/arm64/mm/mmu.c+34 -50 replies
5/5arm64/mm: use __create_pgd_mapping() to create pgtable for idmap_pg_dir and init_pg_dirarch/arm64/include/asm/kernel-pgtable.h arch/arm64/include/asm/pgalloc.h arch/arm64/kernel/head.S +1 more+60 -1320 replies

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCHv3 0/5] use __create_pgd_mapping() to implement idmap and unify codes

v2 -> v3:
-1. leave out the part of redefinition the CONFIG_PGTABLE_LEVEL,
concentrate on sharing __create_pgd_mapping() in head.S as the first step.
-2. make IDMAP_PGTABLE_LEVELS use the max value ([3/5])

rfc -> v2:
more debug and test

*** Goal of this series ***

__create_pgd_mapping() sets up the pgtable for mapping __va(paddr) -> paddr under the MMU-on situation. Since pgtable upper level holds the paddr of the lower level, with a slight adaptation, __create_pgd_mapping() can also set up the mapping under the MMU-off situation. ([4/5])

After that, both idmap_pg_dir and init_pg_dir can be created by __create_pgd_mapping(). And the counterpart asm code can be simplified.

This series can be applied against commit 4284bdf9405a ("Linux 5.13-rc2").

*** Plan for the next ***

The omitted part in V2, which resorts to redefinition of CONFIG_PGTABLE_LEVEL to provides two sets of routines. One set is proper to set up a idmap which can adress total system RAM. That can simplify the asm code in head.S furtherly, also provide an create_idmap() API.

*** Test ***

This series can success booting with the following configuration on either Cavium ThunderX2 99xx or Qualcomm Falkor:

            PAGE_SIZE  VA  PA  PGTABLE_LEVEL
Qualcomm    4K         48  48  4
            4K         39  48  3
            16K        48  48  4
            16K        47  48  3
Cavium      64K        52  52  3
            64K        48  52  3
            64K        42  52  2

*** History ***

RFC:
https://lore.kernel.org/linux-arm-kernel/[email protected]/
V2:
https://lore.kernel.org/linux-arm-kernel/[email protected]/

Cc: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: Kristina Martsenko <[email protected]>
Cc: James Morse <[email protected]>
Cc: Steven Price <[email protected]>
Cc: Jonathan Cameron <[email protected]>
Cc: Pavel Tatashin <[email protected]>
Cc: Anshuman Khandual <[email protected]>
Cc: Atish Patra <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Logan Gunthorpe <[email protected]>
Cc: Mark Brown <[email protected]>
To: [email protected]

Pingfan Liu (5):
arm64/mm: introduce pgtable allocator for idmap_pg_dir and init_pg_dir arm64/mm: disable WARN_ON() and BUG_ON() in __create_pgd_mapping() if
too early
arm64/mm: unconditionally set IDMAP_PGTABLE_LEVELS to max pgtable
level
arm64/mm: make __create_pgd_mapping() capable to handle pgtable's
paddr
arm64/mm: use __create_pgd_mapping() to create pgtable for
idmap_pg_dir and init_pg_dir

 arch/arm64/include/asm/kernel-pgtable.h |  33 +++--
 arch/arm64/include/asm/pgalloc.h        |   9 ++
 arch/arm64/kernel/head.S                | 164 +++++++-----------------
 arch/arm64/mm/mmu.c                     | 108 ++++++++++++----
 4 files changed, 153 insertions(+), 161 deletions(-)
Signature · 7 lines
2.29.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel