• Huacai Chen's avatar
    LoongArch: Make {virt, phys, page, pfn} translation work with KFENCE · 0ca84aea
    Huacai Chen authored
    KFENCE changes virt_to_page() to be able to translate tlb mapped virtual
    addresses, but forget to change virt_to_phys()/phys_to_virt() and other
    translation functions as well. This patch fix it, otherwise some drivers
    (such as nvme and virtio-blk) cannot work with KFENCE.
    
    All {virt, phys, page, pfn} translation functions are updated:
    1, virt_to_pfn()/pfn_to_virt();
    2, virt_to_page()/page_to_virt();
    3, virt_to_phys()/phys_to_virt().
    
    DMW/TLB mapped addresses are distinguished by comparing the vaddress
    with vm_map_base in virt_to_xyz(), and we define WANT_PAGE_VIRTUAL in
    the KFENCE case for the reverse translations, xyz_to_virt().
    Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
    0ca84aea
kfence.h 1.57 KB