]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mm/memremap: Pass down MEMREMAP_* flags to arch_memremap_wb()
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Mon, 17 Feb 2025 16:38:20 +0000 (18:38 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 21 Feb 2025 14:05:38 +0000 (15:05 +0100)
x86 version of arch_memremap_wb() needs the flags to decide if the mapping
has to be encrypted or decrypted.

Pass down the flag to arch_memremap_wb(). All current implementations
ignore the argument.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: linux-mm@kvack.org
Link: https://lore.kernel.org/r/20250217163822.343400-2-kirill.shutemov@linux.intel.com
arch/arm/include/asm/io.h
arch/arm/mm/ioremap.c
arch/arm/mm/nommu.c
arch/riscv/include/asm/io.h
kernel/iomem.c

index 1815748f5d2acc772a7697b9795265bd6e9487bd..bae5edf348efa7784b10aa3dd53acc5ead661ff8 100644 (file)
@@ -381,7 +381,7 @@ void __iomem *ioremap_wc(resource_size_t res_cookie, size_t size);
 void iounmap(volatile void __iomem *io_addr);
 #define iounmap iounmap
 
-void *arch_memremap_wb(phys_addr_t phys_addr, size_t size);
+void *arch_memremap_wb(phys_addr_t phys_addr, size_t size, unsigned long flags);
 #define arch_memremap_wb arch_memremap_wb
 
 /*
index 89f1c97f3079c11efbfd0112fe02f833ff1df9e3..748698e91a4b46d06973e781b6ca4cc9b98686ba 100644 (file)
@@ -436,7 +436,7 @@ void __arm_iomem_set_ro(void __iomem *ptr, size_t size)
        set_memory_ro((unsigned long)ptr, PAGE_ALIGN(size) / PAGE_SIZE);
 }
 
-void *arch_memremap_wb(phys_addr_t phys_addr, size_t size)
+void *arch_memremap_wb(phys_addr_t phys_addr, size_t size, unsigned long flags)
 {
        return (__force void *)arch_ioremap_caller(phys_addr, size,
                                                   MT_MEMORY_RW,
index 1a8f6914ee59dc6f0dbb4f4fc3d1ca993e3eba5a..d638cc87807e28908ef617ec98678b1ab406f7b5 100644 (file)
@@ -248,7 +248,7 @@ void __iomem *pci_remap_cfgspace(resource_size_t res_cookie, size_t size)
 EXPORT_SYMBOL_GPL(pci_remap_cfgspace);
 #endif
 
-void *arch_memremap_wb(phys_addr_t phys_addr, size_t size)
+void *arch_memremap_wb(phys_addr_t phys_addr, size_t size, unsigned long flags)
 {
        return (void *)phys_addr;
 }
index 1c5c641075d2fd48d2f20fa8993875261ada4eb4..0257f4aa7ff4509538a8a609acbf56bd690b7adc 100644 (file)
@@ -136,7 +136,7 @@ __io_writes_outs(outs, u64, q, __io_pbr(), __io_paw())
 #include <asm-generic/io.h>
 
 #ifdef CONFIG_MMU
-#define arch_memremap_wb(addr, size)   \
+#define arch_memremap_wb(addr, size, flags)    \
        ((__force void *)ioremap_prot((addr), (size), _PAGE_KERNEL))
 #endif
 
index dc2120776e1c3dc2c5b80d621a6e10abffbec6a7..75e61c1c6bc074399526501c79e9ab8622c36a03 100644 (file)
@@ -6,7 +6,8 @@
 #include <linux/ioremap.h>
 
 #ifndef arch_memremap_wb
-static void *arch_memremap_wb(resource_size_t offset, unsigned long size)
+static void *arch_memremap_wb(resource_size_t offset, unsigned long size,
+                             unsigned long flags)
 {
 #ifdef ioremap_cache
        return (__force void *)ioremap_cache(offset, size);
@@ -91,7 +92,7 @@ void *memremap(resource_size_t offset, size_t size, unsigned long flags)
                if (is_ram == REGION_INTERSECTS)
                        addr = try_ram_remap(offset, size, flags);
                if (!addr)
-                       addr = arch_memremap_wb(offset, size);
+                       addr = arch_memremap_wb(offset, size, flags);
        }
 
        /*