History

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.

Anshuman Khandual committed 7 years ago

Commit 0f472d01 parent 6b95ab45 files · +18 −0Browse files

Unified · Split

5 files
  1. arch/arm64/mm/mmu.c +5 −0
  2. arch/powerpc/mm/book3s64/radix_pgtable.c +5 −0
  3. arch/x86/mm/ioremap.c +5 −0
  4. include/linux/io.h +1 −0
  5. lib/ioremap.c +2 −0
arch/arm64/mm/mmu.c+5−0
@@ -942,6 +942,11 @@ void *__init fixmap_remap_fdt(phys_addr_t dt_phys) · 941 unmodified lines
942942 return dt_virt;
943943 }
944944
945+int __init arch_ioremap_p4d_supported(void)
946+{
947+ return 0;
948+}
949+
945950 int __init arch_ioremap_pud_supported(void)
946951 {
947952 /*
arch/powerpc/mm/book3s64/radix_pgtable.c+5−0
@@ -1237,3 +1237,8 @@ int radix__ioremap_range(unsigned long ea, phys_addr_t pa, unsigned long size, · 1236 unmodified lines
12371237 return 0;
12381238 }
12391239 }
1240+
1241+int __init arch_ioremap_p4d_supported(void)
1242+{
1243+ return 0;
1244+}
arch/x86/mm/ioremap.c+5−0
@@ -459,6 +459,11 @@ void iounmap(volatile void __iomem *addr) · 458 unmodified lines
459459 }
460460 EXPORT_SYMBOL(iounmap);
461461
462+int __init arch_ioremap_p4d_supported(void)
463+{
464+ return 0;
465+}
466+
462467 int __init arch_ioremap_pud_supported(void)
463468 {
464469 #ifdef CONFIG_X86_64
include/linux/io.h+1−0
@@ -33,6 +33,7 @@ static inline int ioremap_page_range(unsigned long addr, unsigned long end, · 32 unmodified lines
3333
3434 #ifdef CONFIG_HAVE_ARCH_HUGE_VMAP
3535 void __init ioremap_huge_init(void);
36+int arch_ioremap_p4d_supported(void);
3637 int arch_ioremap_pud_supported(void);
3738 int arch_ioremap_pmd_supported(void);
3839 #else
lib/ioremap.c+2−0
@@ -30,6 +30,8 @@ early_param("nohugeiomap", set_nohugeiomap); · 29 unmodified lines
3030 void __init ioremap_huge_init(void)
3131 {
3232 if (!ioremap_huge_disabled) {
33+ if (arch_ioremap_p4d_supported())
34+ ioremap_p4d_capable = 1;
3335 if (arch_ioremap_pud_supported())
3436 ioremap_pud_capable = 1;
3537 if (arch_ioremap_pmd_supported())

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t