[PATCH 2/2] riscv: mm: Define DIRECT_MAP_PHYSMEM_END

Paul Walmsley pjw at kernel.org
Thu Jun 4 15:34:49 PDT 2026


On Mon, 9 Mar 2026, Vivian Wang wrote:

> On RISC-V, the actual mappable range of physical address space is
> dependent on the current MMU mode i.e. satp_mode (See
> Documentation/arch/riscv/vm-layout.rst).
> 
> Define the DIRECT_MAP_PHYSMEM_END macro based on the existing virtual
> address space layout macros to expose this information to
> get_free_mem_region(). Otherwise, it returns a region that couldn't be
> mapped, which breaks ZONE_DEVICE.
> 
> Cc: <stable at vger.kernel.org> # v6.13+
> Tested-by: Han Gao <gaohan at iscas.ac.cn> # SG2044
> Signed-off-by: Vivian Wang <wangruikang at iscas.ac.cn>

Thanks, queued for v7.2.


- Paul



More information about the linux-riscv mailing list