Skip to content

Commit 1310222

Browse files
Anshuman Khandualwilldeacon
authored andcommitted
arm64/mm: Drop use_1G_block()
pud_sect_supported() already checks for PUD level block mapping support i.e on ARM64_4K_PAGES config. Hence pud_sect_supported(), along with some other required alignment checks can help completely drop use_1G_block(). Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will@kernel.org> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Link: https://lore.kernel.org/r/1644988012-25455-1-git-send-email-anshuman.khandual@arm.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent cf5a501 commit 1310222

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

arch/arm64/mm/mmu.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -295,18 +295,6 @@ static void alloc_init_cont_pmd(pud_t *pudp, unsigned long addr,
295295
} while (addr = next, addr != end);
296296
}
297297

298-
static inline bool use_1G_block(unsigned long addr, unsigned long next,
299-
unsigned long phys)
300-
{
301-
if (PAGE_SHIFT != 12)
302-
return false;
303-
304-
if (((addr | next | phys) & ~PUD_MASK) != 0)
305-
return false;
306-
307-
return true;
308-
}
309-
310298
static void alloc_init_pud(pgd_t *pgdp, unsigned long addr, unsigned long end,
311299
phys_addr_t phys, pgprot_t prot,
312300
phys_addr_t (*pgtable_alloc)(int),
@@ -345,7 +333,8 @@ static void alloc_init_pud(pgd_t *pgdp, unsigned long addr, unsigned long end,
345333
/*
346334
* For 4K granule only, attempt to put down a 1GB block
347335
*/
348-
if (use_1G_block(addr, next, phys) &&
336+
if (pud_sect_supported() &&
337+
((addr | next | phys) & ~PUD_MASK) == 0 &&
349338
(flags & NO_BLOCK_MAPPINGS) == 0) {
350339
pud_set_huge(pudp, phys, prot);
351340

0 commit comments

Comments
 (0)