Hi Sergey, On Friday, 2 October 2026 at 14:49, Sergey Bugaev <[email protected]> wrote:
> Hello, > > this sounds like throwing out the baby with the bathwater :| PIC is an > *essential* security feature, cannot we fix the underlying issue > instead of disabling it? We did manage PIC on AArch64, I'm sure RISC-V > can do it too. > To make things clear, we will be supporting PIC on userland once we get the kernel to reach userland. This change applies to the kernel image itself only. Is it essential to have kernels be built with PIC to ensure best security practices nowadays? I would be glad if you directed me to relevant sources. > In particular, for boothdr.S, cannot you just spell the intended > relocation more explicitly? Why is there a GOT in the first place, > Mach is a single image/DSO with no ifuncs? 'la' is a > pseudo-instruction that it sounds like should be best avoided, you > likely want 'lla' (aka 'auipc' + 'addi') instead. > Sure, that sounds plausible. But the running assumption so far has been a non-PIC kernel image. If we are going to commit to support PIC as an official, blessed way to build the riscv kernel image, then I need to take some time to verify everything works as intended and spend time fixing existing assumptions. > Sergey > > P.S. Sorry for my ignorance, where is the repo I should be looking at > to check out the current state of your RISC_V work? > Please see the repository at: https://github.com/hakanrw/gnumach-riscv64 The master branch has an early physical address kernel image that reaches the GNU Mach banner. It was tested on QEMU and my personal test board Milk-V Mars. See the announcement: https://lists.gnu.org/archive/html/bug-hurd/2026-09/msg00036.html We are now continuing development in the branch high-address-kernel. Diego has recently implemented Sv39 paging bootstrap and I merged it. It currently works under QEMU and we are able to map high address kernel successfully, but some further work remains and I will need to test it on my board first before I merge it back to master. We welcome your contributions and expertise. Hakan
