]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blobdiff - arch/arm64/mm/mmu.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234
[mirror_ubuntu-focal-kernel.git] / arch / arm64 / mm / mmu.c
index a170c6369a68412cbe3e59ce140a4a834684548f..e5ae8663f2305812c281fda575f109187db8c4e6 100644 (file)
@@ -1,20 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-only
 /*
  * Based on arch/arm/mm/mmu.c
  *
  * Copyright (C) 1995-2005 Russell King
  * Copyright (C) 2012 ARM Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <linux/cache.h>
@@ -955,13 +944,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)