aboutsummaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/vmalloc.h
diff options
context:
space:
mode:
authorAnshuman Khandual <[email protected]>2021-09-20 14:59:31 +0530
committerWill Deacon <[email protected]>2021-09-29 16:54:33 +0100
commitf8b46c4b51ab109457770e662bb3d0cde390879f (patch)
treea90f0ecfb87f95f31302461333b6c813f27bdaff /arch/arm64/include/asm/vmalloc.h
parente63cf610ead18d5f8df0739a36cba57ccba43f6b (diff)
arm64/mm: Add pud_sect_supported()
Section mapping at PUD level is supported only on 4K pages and currently it gets verified with explicit #ifdef or IS_ENABLED() constructs. This adds a new helper pud_sect_supported() for this purpose, which particularly cleans up the HugeTLB code path. It updates relevant switch statements with checks for __PAGETABLE_PMD_FOLDED in order to avoid build failures caused with two identical switch case values in those code blocks. Cc: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Cc: [email protected] Cc: [email protected] Suggested-by: Mark Rutland <[email protected]> Signed-off-by: Anshuman Khandual <[email protected]> Reviewed-by: Catalin Marinas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
Diffstat (limited to 'arch/arm64/include/asm/vmalloc.h')
-rw-r--r--arch/arm64/include/asm/vmalloc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/vmalloc.h b/arch/arm64/include/asm/vmalloc.h
index 7a22aeea9bb5..b9185503feae 100644
--- a/arch/arm64/include/asm/vmalloc.h
+++ b/arch/arm64/include/asm/vmalloc.h
@@ -2,6 +2,7 @@
#define _ASM_ARM64_VMALLOC_H
#include <asm/page.h>
+#include <asm/pgtable.h>
#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP
@@ -9,10 +10,9 @@
static inline bool arch_vmap_pud_supported(pgprot_t prot)
{
/*
- * Only 4k granule supports level 1 block mappings.
* SW table walks can't handle removal of intermediate entries.
*/
- return IS_ENABLED(CONFIG_ARM64_4K_PAGES) &&
+ return pud_sect_supported() &&
!IS_ENABLED(CONFIG_PTDUMP_DEBUGFS);
}