Skip to content

Commit a9ebcb8

Browse files
kirylIngo Molnar
authored and
Ingo Molnar
committed
mm/memremap: Pass down MEMREMAP_* flags to arch_memremap_wb()
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 <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Dave Hansen <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]
1 parent affe678 commit a9ebcb8

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

arch/arm/include/asm/io.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ void __iomem *ioremap_wc(resource_size_t res_cookie, size_t size);
381381
void iounmap(volatile void __iomem *io_addr);
382382
#define iounmap iounmap
383383

384-
void *arch_memremap_wb(phys_addr_t phys_addr, size_t size);
384+
void *arch_memremap_wb(phys_addr_t phys_addr, size_t size, unsigned long flags);
385385
#define arch_memremap_wb arch_memremap_wb
386386

387387
/*

arch/arm/mm/ioremap.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ void __arm_iomem_set_ro(void __iomem *ptr, size_t size)
436436
set_memory_ro((unsigned long)ptr, PAGE_ALIGN(size) / PAGE_SIZE);
437437
}
438438

439-
void *arch_memremap_wb(phys_addr_t phys_addr, size_t size)
439+
void *arch_memremap_wb(phys_addr_t phys_addr, size_t size, unsigned long flags)
440440
{
441441
return (__force void *)arch_ioremap_caller(phys_addr, size,
442442
MT_MEMORY_RW,

arch/arm/mm/nommu.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ void __iomem *pci_remap_cfgspace(resource_size_t res_cookie, size_t size)
248248
EXPORT_SYMBOL_GPL(pci_remap_cfgspace);
249249
#endif
250250

251-
void *arch_memremap_wb(phys_addr_t phys_addr, size_t size)
251+
void *arch_memremap_wb(phys_addr_t phys_addr, size_t size, unsigned long flags)
252252
{
253253
return (void *)phys_addr;
254254
}

arch/riscv/include/asm/io.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ __io_writes_outs(outs, u64, q, __io_pbr(), __io_paw())
136136
#include <asm-generic/io.h>
137137

138138
#ifdef CONFIG_MMU
139-
#define arch_memremap_wb(addr, size) \
139+
#define arch_memremap_wb(addr, size, flags) \
140140
((__force void *)ioremap_prot((addr), (size), _PAGE_KERNEL))
141141
#endif
142142

kernel/iomem.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
#include <linux/ioremap.h>
77

88
#ifndef arch_memremap_wb
9-
static void *arch_memremap_wb(resource_size_t offset, unsigned long size)
9+
static void *arch_memremap_wb(resource_size_t offset, unsigned long size,
10+
unsigned long flags)
1011
{
1112
#ifdef ioremap_cache
1213
return (__force void *)ioremap_cache(offset, size);
@@ -91,7 +92,7 @@ void *memremap(resource_size_t offset, size_t size, unsigned long flags)
9192
if (is_ram == REGION_INTERSECTS)
9293
addr = try_ram_remap(offset, size, flags);
9394
if (!addr)
94-
addr = arch_memremap_wb(offset, size);
95+
addr = arch_memremap_wb(offset, size, flags);
9596
}
9697

9798
/*

0 commit comments

Comments
 (0)