All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv3 0/5] use __create_pgd_mapping() to implement idmap and unify codes
@ 2021-05-31  8:45 Pingfan Liu
  2021-05-31  8:45 ` [PATCHv3 1/5] arm64/mm: introduce pgtable allocator for idmap_pg_dir and init_pg_dir Pingfan Liu
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Pingfan Liu @ 2021-05-31  8:45 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Pingfan Liu, Catalin Marinas, Will Deacon, Ard Biesheuvel,
	Marc Zyngier, Kristina Martsenko, James Morse, Steven Price,
	Jonathan Cameron, Pavel Tatashin, Anshuman Khandual, Atish Patra,
	Mike Rapoport, Logan Gunthorpe, Mark Brown

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/20210410095654.24102-1-kernelfans@gmail.com/
V2:
https://lore.kernel.org/linux-arm-kernel/20210425141304.32721-1-kernelfans@gmail.com/


Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Kristina Martsenko <kristina.martsenko@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Steven Price <steven.price@arm.com>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Atish Patra <atish.patra@wdc.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Logan Gunthorpe <logang@deltatee.com>
Cc: Mark Brown <broonie@kernel.org>
To: linux-arm-kernel@lists.infradead.org

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(-)

-- 
2.29.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] 10+ messages in thread

end of thread, other threads:[~2021-06-09  9:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-31  8:45 [PATCHv3 0/5] use __create_pgd_mapping() to implement idmap and unify codes Pingfan Liu
2021-05-31  8:45 ` [PATCHv3 1/5] arm64/mm: introduce pgtable allocator for idmap_pg_dir and init_pg_dir Pingfan Liu
2021-05-31  8:45 ` [PATCHv3 2/5] arm64/mm: disable WARN_ON() and BUG_ON() in __create_pgd_mapping() if too early Pingfan Liu
2021-05-31  8:45 ` [PATCHv3 3/5] arm64/mm: unconditionally set IDMAP_PGTABLE_LEVELS to max pgtable level Pingfan Liu
2021-05-31  8:45 ` [PATCHv3 4/5] arm64/mm: make __create_pgd_mapping() capable to handle pgtable's paddr Pingfan Liu
2021-05-31  8:45 ` [PATCHv3 5/5] arm64/mm: use __create_pgd_mapping() to create pgtable for idmap_pg_dir and init_pg_dir Pingfan Liu
2021-05-31 19:50 ` [PATCHv3 0/5] use __create_pgd_mapping() to implement idmap and unify codes Ard Biesheuvel
2021-06-01  9:25   ` Pingfan Liu
2021-06-08 17:38     ` Catalin Marinas
2021-06-09  9:25       ` Pingfan Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.