Merge tag 'for-linus-20190524' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / arch / arm64 / mm / mmu.c
index ef82312..a1bfc44 100644 (file)
@@ -40,7 +40,7 @@
 #include <asm/kernel-pgtable.h>
 #include <asm/sections.h>
 #include <asm/setup.h>
-#include <asm/sizes.h>
+#include <linux/sizes.h>
 #include <asm/tlb.h>
 #include <asm/mmu_context.h>
 #include <asm/ptdump.h>
@@ -955,13 +955,18 @@ void *__init fixmap_remap_fdt(phys_addr_t dt_phys)
 
 int __init arch_ioremap_pud_supported(void)
 {
-       /* only 4k granule supports level 1 block mappings */
-       return IS_ENABLED(CONFIG_ARM64_4K_PAGES);
+       /*
+        * 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) &&
+              !IS_ENABLED(CONFIG_ARM64_PTDUMP_DEBUGFS);
 }
 
 int __init arch_ioremap_pmd_supported(void)
 {
-       return 1;
+       /* See arch_ioremap_pud_supported() */
+       return !IS_ENABLED(CONFIG_ARM64_PTDUMP_DEBUGFS);
 }
 
 int pud_set_huge(pud_t *pudp, phys_addr_t phys, pgprot_t prot)
@@ -1065,8 +1070,8 @@ int p4d_free_pud_page(p4d_t *p4d, unsigned long addr)
 }
 
 #ifdef CONFIG_MEMORY_HOTPLUG
-int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
-                   bool want_memblock)
+int arch_add_memory(int nid, u64 start, u64 size,
+                       struct mhp_restrictions *restrictions)
 {
        int flags = 0;
 
@@ -1077,6 +1082,6 @@ int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
                             size, PAGE_KERNEL, __pgd_pgtable_alloc, flags);
 
        return __add_pages(nid, start >> PAGE_SHIFT, size >> PAGE_SHIFT,
-                          altmap, want_memblock);
+                          restrictions);
 }
 #endif