]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
riscv: mm: Define DIRECT_MAP_PHYSMEM_END
authorVivian Wang <wangruikang@iscas.ac.cn>
Sun, 7 Jun 2026 02:17:54 +0000 (20:17 -0600)
committerPaul Walmsley <pjw@kernel.org>
Sun, 7 Jun 2026 05:48:15 +0000 (23:48 -0600)
commitf3336b48cf9d3f2d1fc78e3289c0ded2f00876ee
treecd3e85d8fbd5d896314ebdb37a887363cf6445e6
parentdea5db8c5775704f24519d130482d9ceaf66c441
riscv: mm: Define DIRECT_MAP_PHYSMEM_END

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@vger.kernel.org # v6.13+
Tested-by: Han Gao <gaohan@iscas.ac.cn> # SG2044
Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
Link: https://patch.msgid.link/20260309-riscv-sparsemem-vmemmap-limits-v1-2-f40efe18e3cd@iscas.ac.cn
Signed-off-by: Paul Walmsley <pjw@kernel.org>
arch/riscv/include/asm/pgtable.h