Re: Page sizes supported by RISC-V

Jeff Law
2024-09-29T14:51:41Z

On 9/28/24 10:35 AM, Florian Weimer wrote:
> I'm working on adding a <sys/pagesize.h> header to glibc, so that
> programmers can easily determine the range of possible page sizes for a
> particular target, for things like pointer tagging and mapped file
> alignment requirements.
>
> Linux currently supports 4 KiB pages only. I couldn't find anything in
> the RISC-V specifications that mandates a specific page size, but of
> course the way ELF LOAD segments are constructed necessarily imposes a
> maximum page size constraint for particular executables. Today, the
> toolchain assumes the maximum supported page size is 4 KiB, and this is
> also reflected in arch/riscv/Kconfig in the Linux sources (as far as I
> can read Kconfig).
4k is probably the most common in practice right now. RISC-V generally
seems to leave this kind of thing to the implementors to decide, so I
wouldn't be at all surprised if there's nothing in the privileged spec
other than specifying a minimum page size.

Jeff