Merge tag 'icc-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov...
[linux-2.6-microblaze.git] / arch / arm64 / mm / mmu.c
index 0b28cc2..9ff0de1 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/io.h>
 #include <linux/mm.h>
 #include <linux/vmalloc.h>
+#include <linux/set_memory.h>
 
 #include <asm/barrier.h>
 #include <asm/cputype.h>
@@ -82,7 +83,7 @@ void set_swapper_pgd(pgd_t *pgdp, pgd_t pgd)
 pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
                              unsigned long size, pgprot_t vma_prot)
 {
-       if (!pfn_valid(pfn))
+       if (!pfn_is_map_memory(pfn))
                return pgprot_noncached(vma_prot);
        else if (file->f_flags & O_SYNC)
                return pgprot_writecombine(vma_prot);
@@ -515,8 +516,7 @@ static void __init map_mem(pgd_t *pgdp)
         */
        BUILD_BUG_ON(pgd_index(direct_map_end - 1) == pgd_index(direct_map_end));
 
-       if (rodata_full || crash_mem_map || debug_pagealloc_enabled() ||
-           IS_ENABLED(CONFIG_KFENCE))
+       if (can_set_direct_map() || crash_mem_map || IS_ENABLED(CONFIG_KFENCE))
                flags |= NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS;
 
        /*
@@ -1485,8 +1485,7 @@ int arch_add_memory(int nid, u64 start, u64 size,
         * KFENCE requires linear map to be mapped at page granularity, so that
         * it is possible to protect/unprotect single pages in the KFENCE pool.
         */
-       if (rodata_full || debug_pagealloc_enabled() ||
-           IS_ENABLED(CONFIG_KFENCE))
+       if (can_set_direct_map() || IS_ENABLED(CONFIG_KFENCE))
                flags |= NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS;
 
        __create_pgd_mapping(swapper_pg_dir, start, __phys_to_virt(start),