Skip to content

Commit 2062d44

Browse files
Anshuman Khandualwilldeacon
authored andcommitted
arm64/mm: Rename ARM64_SWAPPER_USES_SECTION_MAPS
ARM64_SWAPPER_USES_SECTION_MAPS implies that a PMD level huge page mappings are used for swapper, idmap and vmemmap. Lets make it PMD explicit removing any possible confusion with generic memory sections and also bit generic as it's applicable for idmap and vmemmap mappings as well. Hence rename it as ARM64_KERNEL_USES_PMD_MAPS instead. Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Link: https://lore.kernel.org/r/1623991622-24294-1-git-send-email-anshuman.khandual@arm.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent 7957a3d commit 2062d44

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

arch/arm64/include/asm/kernel-pgtable.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
* 64K (section size = 512M).
1919
*/
2020
#ifdef CONFIG_ARM64_4K_PAGES
21-
#define ARM64_SWAPPER_USES_SECTION_MAPS 1
21+
#define ARM64_KERNEL_USES_PMD_MAPS 1
2222
#else
23-
#define ARM64_SWAPPER_USES_SECTION_MAPS 0
23+
#define ARM64_KERNEL_USES_PMD_MAPS 0
2424
#endif
2525

2626
/*
@@ -33,7 +33,7 @@
3333
* VA range, so pages required to map highest possible PA are reserved in all
3434
* cases.
3535
*/
36-
#if ARM64_SWAPPER_USES_SECTION_MAPS
36+
#if ARM64_KERNEL_USES_PMD_MAPS
3737
#define SWAPPER_PGTABLE_LEVELS (CONFIG_PGTABLE_LEVELS - 1)
3838
#define IDMAP_PGTABLE_LEVELS (ARM64_HW_PGTABLE_LEVELS(PHYS_MASK_SHIFT) - 1)
3939
#else
@@ -90,7 +90,7 @@
9090
#define IDMAP_DIR_SIZE (IDMAP_PGTABLE_LEVELS * PAGE_SIZE)
9191

9292
/* Initial memory map size */
93-
#if ARM64_SWAPPER_USES_SECTION_MAPS
93+
#if ARM64_KERNEL_USES_PMD_MAPS
9494
#define SWAPPER_BLOCK_SHIFT PMD_SHIFT
9595
#define SWAPPER_BLOCK_SIZE PMD_SIZE
9696
#define SWAPPER_TABLE_SHIFT PUD_SHIFT
@@ -106,7 +106,7 @@
106106
#define SWAPPER_PTE_FLAGS (PTE_TYPE_PAGE | PTE_AF | PTE_SHARED)
107107
#define SWAPPER_PMD_FLAGS (PMD_TYPE_SECT | PMD_SECT_AF | PMD_SECT_S)
108108

109-
#if ARM64_SWAPPER_USES_SECTION_MAPS
109+
#if ARM64_KERNEL_USES_PMD_MAPS
110110
#define SWAPPER_MM_MMUFLAGS (PMD_ATTRINDX(MT_NORMAL) | SWAPPER_PMD_FLAGS)
111111
#else
112112
#define SWAPPER_MM_MMUFLAGS (PTE_ATTRINDX(MT_NORMAL) | SWAPPER_PTE_FLAGS)

arch/arm64/mm/mmu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,14 +1113,14 @@ static void free_empty_tables(unsigned long addr, unsigned long end,
11131113
}
11141114
#endif
11151115

1116-
#if !ARM64_SWAPPER_USES_SECTION_MAPS
1116+
#if !ARM64_KERNEL_USES_PMD_MAPS
11171117
int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
11181118
struct vmem_altmap *altmap)
11191119
{
11201120
WARN_ON((start < VMEMMAP_START) || (end > VMEMMAP_END));
11211121
return vmemmap_populate_basepages(start, end, node, altmap);
11221122
}
1123-
#else /* !ARM64_SWAPPER_USES_SECTION_MAPS */
1123+
#else /* !ARM64_KERNEL_USES_PMD_MAPS */
11241124
int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
11251125
struct vmem_altmap *altmap)
11261126
{
@@ -1165,7 +1165,7 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
11651165

11661166
return 0;
11671167
}
1168-
#endif /* !ARM64_SWAPPER_USES_SECTION_MAPS */
1168+
#endif /* !ARM64_KERNEL_USES_PMD_MAPS */
11691169

11701170
#ifdef CONFIG_MEMORY_HOTPLUG
11711171
void vmemmap_free(unsigned long start, unsigned long end,

0 commit comments

Comments
 (0)