diff options
author | Anshuman Khandual <anshuman.khandual@arm.com> | 2019-07-16 19:27:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-16 22:23:22 -0400 |
commit | 0f472d04f59ff89d15b2a1c4eafde7317ddd67a2 (patch) | |
tree | 20786684171109ec50859a88c6a354e12e2a8390 | |
parent | 6b95ab4218bfa59bc315105127ffe03aef3b5742 (diff) |
mm/ioremap: probe platform for p4d huge map support
Finish up what commit c2febafc6773 ("mm: convert generic code to 5-level
paging") started while levelling up P4D huge mapping support at par with
PUD and PMD. A new arch call back arch_ioremap_p4d_supported() is added
which just maintains status quo (P4D huge map not supported) on x86,
arm64 and powerpc.
When HAVE_ARCH_HUGE_VMAP is enabled its just a simple check from the
arch about the support, hence runtime effects are minimal.
Link: http://lkml.kernel.org/r/1561699231-20991-1-git-send-email-anshuman.khandual@arm.com
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/arm64/mm/mmu.c | 5 | ||||
-rw-r--r-- | arch/powerpc/mm/book3s64/radix_pgtable.c | 5 | ||||
-rw-r--r-- | arch/x86/mm/ioremap.c | 5 | ||||
-rw-r--r-- | include/linux/io.h | 1 | ||||
-rw-r--r-- | lib/ioremap.c | 2 |
5 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 1b49c08dfa2b..e661469cabdd 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c | |||
@@ -942,6 +942,11 @@ void *__init fixmap_remap_fdt(phys_addr_t dt_phys) | |||
942 | return dt_virt; | 942 | return dt_virt; |
943 | } | 943 | } |
944 | 944 | ||
945 | int __init arch_ioremap_p4d_supported(void) | ||
946 | { | ||
947 | return 0; | ||
948 | } | ||
949 | |||
945 | int __init arch_ioremap_pud_supported(void) | 950 | int __init arch_ioremap_pud_supported(void) |
946 | { | 951 | { |
947 | /* | 952 | /* |
diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c index 65c2ba1e1783..b4ca9e95e678 100644 --- a/arch/powerpc/mm/book3s64/radix_pgtable.c +++ b/arch/powerpc/mm/book3s64/radix_pgtable.c | |||
@@ -1237,3 +1237,8 @@ int radix__ioremap_range(unsigned long ea, phys_addr_t pa, unsigned long size, | |||
1237 | return 0; | 1237 | return 0; |
1238 | } | 1238 | } |
1239 | } | 1239 | } |
1240 | |||
1241 | int __init arch_ioremap_p4d_supported(void) | ||
1242 | { | ||
1243 | return 0; | ||
1244 | } | ||
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index e500f1df1140..63e99f15d7cf 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c | |||
@@ -459,6 +459,11 @@ void iounmap(volatile void __iomem *addr) | |||
459 | } | 459 | } |
460 | EXPORT_SYMBOL(iounmap); | 460 | EXPORT_SYMBOL(iounmap); |
461 | 461 | ||
462 | int __init arch_ioremap_p4d_supported(void) | ||
463 | { | ||
464 | return 0; | ||
465 | } | ||
466 | |||
462 | int __init arch_ioremap_pud_supported(void) | 467 | int __init arch_ioremap_pud_supported(void) |
463 | { | 468 | { |
464 | #ifdef CONFIG_X86_64 | 469 | #ifdef CONFIG_X86_64 |
diff --git a/include/linux/io.h b/include/linux/io.h index 9876e5801a9d..accac822336a 100644 --- a/include/linux/io.h +++ b/include/linux/io.h | |||
@@ -33,6 +33,7 @@ static inline int ioremap_page_range(unsigned long addr, unsigned long end, | |||
33 | 33 | ||
34 | #ifdef CONFIG_HAVE_ARCH_HUGE_VMAP | 34 | #ifdef CONFIG_HAVE_ARCH_HUGE_VMAP |
35 | void __init ioremap_huge_init(void); | 35 | void __init ioremap_huge_init(void); |
36 | int arch_ioremap_p4d_supported(void); | ||
36 | int arch_ioremap_pud_supported(void); | 37 | int arch_ioremap_pud_supported(void); |
37 | int arch_ioremap_pmd_supported(void); | 38 | int arch_ioremap_pmd_supported(void); |
38 | #else | 39 | #else |
diff --git a/lib/ioremap.c b/lib/ioremap.c index a95161d9c883..0a2ffadc6d71 100644 --- a/lib/ioremap.c +++ b/lib/ioremap.c | |||
@@ -30,6 +30,8 @@ early_param("nohugeiomap", set_nohugeiomap); | |||
30 | void __init ioremap_huge_init(void) | 30 | void __init ioremap_huge_init(void) |
31 | { | 31 | { |
32 | if (!ioremap_huge_disabled) { | 32 | if (!ioremap_huge_disabled) { |
33 | if (arch_ioremap_p4d_supported()) | ||
34 | ioremap_p4d_capable = 1; | ||
33 | if (arch_ioremap_pud_supported()) | 35 | if (arch_ioremap_pud_supported()) |
34 | ioremap_pud_capable = 1; | 36 | ioremap_pud_capable = 1; |
35 | if (arch_ioremap_pmd_supported()) | 37 | if (arch_ioremap_pmd_supported()) |