Skip to content

Commit 6e6c5e2

Browse files
bjorn-rivospalmer-dabbelt
authored andcommitted
riscv: mm: Add pfn_to_kaddr() implementation
The pfn_to_kaddr() function is used by KASAN's memory hotplugging path. Add the missing function to the RISC-V port, so that it can be built with MHP and CONFIG_KASAN. Signed-off-by: Björn Töpel <[email protected]> Reviewed-by: Alexandre Ghiti <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 007480f commit 6e6c5e2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/riscv/include/asm/page.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@ extern phys_addr_t __phys_addr_symbol(unsigned long x);
188188

189189
unsigned long kaslr_offset(void);
190190

191+
static __always_inline void *pfn_to_kaddr(unsigned long pfn)
192+
{
193+
return __va(pfn << PAGE_SHIFT);
194+
}
195+
191196
#endif /* __ASSEMBLY__ */
192197

193198
#define virt_addr_valid(vaddr) ({ \

0 commit comments

Comments
 (0)