mbox series

[0/3] Make {virt, phys, page, pfn} translation work with KFENCE for LoongArch

Message ID 20240404133642.971583-1-chenhuacai@loongson.cn (mailing list archive)
Headers show
Series Make {virt, phys, page, pfn} translation work with KFENCE for LoongArch | expand

Message

Huacai Chen April 4, 2024, 1:36 p.m. UTC
On LoongArch kmalloc() range is DMW-mapped rather than TLB-mapped, so
KFENCE remap __kfence_pool to the TLB-mappd range.

To make all drivers work, {virt, phys, page, pfn} translation functions
are overriden (part of them already done, others done in this series):
1, virt_to_pfn()/pfn_to_virt();
2, virt_to_page()/page_to_virt();
3, virt_to_phys()/phys_to_virt().
 
Since LoongArch overrides page_to_virt() which use page_address() in the
KFENCE case (by defining WANT_PAGE_VIRTUAL/HASHED_PAGE_VIRTUAL). So move
lowmem_page_address() a little later to avoid such build errors:

error: implicit declaration of function ‘page_address’.

Huacai Chen(3):
 mm: Move lowmem_page_address() a little later.
 LoongArch: Make {virt, phys, page, pfn} translation work with KFENCE
 LoongArch: Make virt_addr_valid()/__virt_addr_valid() work with KFENCE

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
2.27.0