mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 06:02:05 +00:00
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 <bjorn@rivosinc.com> Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Link: https://lore.kernel.org/r/20240605114100.315918-6-bjorn@kernel.org Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
This commit is contained in:
parent
007480fe84
commit
6e6c5e21b8
@ -188,6 +188,11 @@ extern phys_addr_t __phys_addr_symbol(unsigned long x);
|
||||
|
||||
unsigned long kaslr_offset(void);
|
||||
|
||||
static __always_inline void *pfn_to_kaddr(unsigned long pfn)
|
||||
{
|
||||
return __va(pfn << PAGE_SHIFT);
|
||||
}
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#define virt_addr_valid(vaddr) ({ \
|
||||
|
Loading…
Reference in New Issue
Block a user