On Tue, Sep 30, 2025 at 01:15:32PM +0200, Florian Weimer wrote:
- Deepak Gupta:
Any distro who is shipping userspace (which all of them are) along with kernel will not be shipping two different userspaces (one with shadow stack and one without them). If distro are shipping two different userspaces, then they might as well ship two different kernels. Tagging some distro folks here to get their take on shipping different userspace depending on whether hardware is RVA23 or not. @Heinrich, @Florian, @redbeard and @Aurelien.
Major distro's have already drawn a distinction here that they will drop support for hardware which isn't RVA23 for the sake of keeping binary distribution simple.
The following are just my personal thoughts.
For commercial distributions, I just don't see how things work out if you have hardware that costs less than (say) $30 over its lifetime, and you want LTS support for 10+ years. The existing distribution business models aren't really compatible with such low per-node costs. So it makes absolute sense for distributions to target more powerful cores, and therefore require RVA23. Nobody is suggesting that mainstream distributions should target soft-float, either.
For community distributions, it is a much tougher call. Obsoleting virtually all existing hardware sends a terrible signal to early supporters of the architecture. But given how limited the RISC-V baseline ISA is, I'm not sure if there is much of a choice here. Maybe it's possible to soften the blow by committing to (say) two more years of baseline ISA support, and then making the switch, assuming that RVA23 hardware for local installation is widely available by then.
Yes that's totally fine. Distro (community or commercial) get to decide. They aren't forced to make a decision of RVA23 switch. Question is about "Once they switch to RVA23 on say release `A`, will they build release `A` for non-RVA23 as well".
Once they make a switch, I do not expect the userspace they're building to be able to run on older hardware because it'll have zimop instruction in them in epilogue and prologue.
Sure, they can keep supporting older releases, keep building userspace without cfi/non-rva23 and thus they should be building kernel without cfi config as well for those releases.
New release (RVA23) isn't expected to run on older hardware. If new userspace is not going to be able to run on older hardware and new userspace isn't making an effort to have runtime selection of binaries depending on which hardware it is running, Is it worth the effort to have two vDSO in kernel and expose the one depending on which hardware its running? It's just added complexity for usecase which I don't really see a usecase.
Yes a savvy kernel hacker might have a need where they want to build a kernel with RVA23 and transport it on all kind of hardware but that's a very corner use-case.
At the very least this corner use case shouldn't block these patches from being taken in 6.18. Current patches don't block such future capability (if any one feels like this is really needed).
However, my real worry is that in the not-too-distant future, another ISA transition will be required after RVA23. This is not entirely hypothetical because RVA23 is still an ISA designed mostly for C (at least in the scalar space, I don't know much about the vector side). Other architectures carry forward support for efficient overflow checking (as required by Ada and some other now less-popular languages, and as needed for efficiently implementing fixnums with arbitrary precision fallback). Considering current industry trends, it is not inconceivable that these ISA features become important again in the near term.
I can only be optimistic here and hope that enough ecosystem adoption would prevent such breaks in transition.
You can see the effect of native overflow checking support if you look at Ada code examples with integer arithmetic. For example, this:
function Fib (N: Integer) return Integer is begin if N <= 1 then return N; else return Fib (N - 1) + Fib (N - 2); end if; end;
produces about 370 RISC-V instructions with -gnato, compared to 218 instructions with -gnato0 and overflow checking disabled (using GCC trunk). For GCC 15, the respective instruction counts are 301 and 258 for x86-64, and 288 and 244 for AArch64. RVA23 reduces the instruction count with overflow checking to 353. A further reduction should be possible once GCC starts using xnor in its overflow checks, but I expect that the overhead from overflow checking will remain high.
Thanks, Florian