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.
Unified · Split
| @@ -942,6 +942,11 @@ void *__init fixmap_remap_fdt(phys_addr_t dt_phys) · 941 unmodified lines | ||
| 942 | 942 | return dt_virt; |
| 943 | 943 | } |
| 944 | 944 | |
| 945 | +int __init arch_ioremap_p4d_supported(void) | |
| 946 | +{ | |
| 947 | + return 0; | |
| 948 | +} | |
| 949 | + | |
| 945 | 950 | int __init arch_ioremap_pud_supported(void) |
| 946 | 951 | { |
| 947 | 952 | /* |
| @@ -1237,3 +1237,8 @@ int radix__ioremap_range(unsigned long ea, phys_addr_t pa, unsigned long size, · 1236 unmodified lines | ||
| 1237 | 1237 | return 0; |
| 1238 | 1238 | } |
| 1239 | 1239 | } |
| 1240 | + | |
| 1241 | +int __init arch_ioremap_p4d_supported(void) | |
| 1242 | +{ | |
| 1243 | + return 0; | |
| 1244 | +} | |
| @@ -459,6 +459,11 @@ void iounmap(volatile void __iomem *addr) · 458 unmodified lines | ||
| 459 | 459 | } |
| 460 | 460 | EXPORT_SYMBOL(iounmap); |
| 461 | 461 | |
| 462 | +int __init arch_ioremap_p4d_supported(void) | |
| 463 | +{ | |
| 464 | + return 0; | |
| 465 | +} | |
| 466 | + | |
| 462 | 467 | int __init arch_ioremap_pud_supported(void) |
| 463 | 468 | { |
| 464 | 469 | #ifdef CONFIG_X86_64 |
| @@ -33,6 +33,7 @@ static inline int ioremap_page_range(unsigned long addr, unsigned long end, · 32 unmodified lines | ||
| 33 | 33 | |
| 34 | 34 | #ifdef CONFIG_HAVE_ARCH_HUGE_VMAP |
| 35 | 35 | void __init ioremap_huge_init(void); |
| 36 | +int arch_ioremap_p4d_supported(void); | |
| 36 | 37 | int arch_ioremap_pud_supported(void); |
| 37 | 38 | int arch_ioremap_pmd_supported(void); |
| 38 | 39 | #else |
| @@ -30,6 +30,8 @@ early_param("nohugeiomap", set_nohugeiomap); · 29 unmodified lines | ||
| 30 | 30 | void __init ioremap_huge_init(void) |
| 31 | 31 | { |
| 32 | 32 | if (!ioremap_huge_disabled) { |
| 33 | + if (arch_ioremap_p4d_supported()) | |
| 34 | + ioremap_p4d_capable = 1; | |
| 33 | 35 | if (arch_ioremap_pud_supported()) |
| 34 | 36 | ioremap_pud_capable = 1; |
| 35 | 37 | if (arch_ioremap_pmd_supported()) |