]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - arch/x86/mm/ioremap.c
mm: introduce include/linux/pgtable.h
[mirror_ubuntu-jammy-kernel.git] / arch / x86 / mm / ioremap.c
index 18c637c0dc6fa8c2f51393903f8d4e1546fb6d5d..0dbd3737110755d78a0b2d7105375417f5f8d9e7 100644 (file)
@@ -21,7 +21,7 @@
 #include <asm/e820/api.h>
 #include <asm/efi.h>
 #include <asm/fixmap.h>
-#include <asm/pgtable.h>
+#include <linux/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/pgalloc.h>
 #include <asm/memtype.h>
@@ -778,10 +778,8 @@ void __init *early_memremap_encrypted(resource_size_t phys_addr,
 void __init *early_memremap_encrypted_wp(resource_size_t phys_addr,
                                         unsigned long size)
 {
-       /* Be sure the write-protect PAT entry is set for write-protect */
-       if (__pte2cachemode_tbl[_PAGE_CACHE_MODE_WP] != _PAGE_CACHE_MODE_WP)
+       if (!x86_has_pat_wp())
                return NULL;
-
        return early_memremap_prot(phys_addr, size, __PAGE_KERNEL_ENC_WP);
 }
 
@@ -799,10 +797,8 @@ void __init *early_memremap_decrypted(resource_size_t phys_addr,
 void __init *early_memremap_decrypted_wp(resource_size_t phys_addr,
                                         unsigned long size)
 {
-       /* Be sure the write-protect PAT entry is set for write-protect */
-       if (__pte2cachemode_tbl[_PAGE_CACHE_MODE_WP] != _PAGE_CACHE_MODE_WP)
+       if (!x86_has_pat_wp())
                return NULL;
-
        return early_memremap_prot(phys_addr, size, __PAGE_KERNEL_NOENC_WP);
 }
 #endif /* CONFIG_AMD_MEM_ENCRYPT */
@@ -889,5 +885,5 @@ void __init __early_set_fixmap(enum fixed_addresses idx,
                set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, flags));
        else
                pte_clear(&init_mm, addr, pte);
-       __flush_tlb_one_kernel(addr);
+       flush_tlb_one_kernel(addr);
 }