Page sizes supported by RISC-V
Florian Weimer
fweimer at redhat.com
Sun Sep 29 08:08:51 PDT 2024
* Jeff Law:
> 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.
I understand that not making a call in the specifications avoids the
need to resolve these conflicts. But if you don't define a maximum page
size there, it is effectively specified as 4096 bytes. This will cause
problems if distributions targeting large systems want a larger page
size because it better aligns with the kind of hardware they target.
It's really bad for cross-distribution binary compatibility, something
that's important outside the embedded space and probably necessary for
mainstreaming.
(Of course you know all this. 8-)
Thanks,
Florian
More information about the linux-riscv
mailing list