[PATCH -fixes] riscv: Fix relocatable kernels with early alternatives using -fno-pie

Conor Dooley conor at kernel.org
Wed May 31 02:32:58 PDT 2023


On Wed, May 31, 2023 at 09:26:27AM +0200, Alexandre Ghiti wrote:
> On 30/05/2023 22:22, Conor Dooley wrote:
> > On Tue, May 30, 2023 at 08:04:17PM +0200, Alexandre Ghiti wrote:
> > > Ahah, I think we found the culprit!
> > > 
> > > With CONFIG_RELOCATABLE, vmlinux is actually stripped from all the
> > > relocations (so that it can be shipped) and vmlinux.relocs is what you
> > > should use instead, since it is just a copy of vmlinux before the
> > > removal of the relocations!
> > That probably makes us both eejits for not realising sooner...
> 
> Ahah, TIL a new word, thanks :)
> 
> > 
> > Tested-by: Conor Dooley <conor.dooley at microchip.com> # booted on nezha & unmatched
> > 
> > Thanks for your patience here Alex.
> 
> So I checked again if the -fno-pie should be applied to mm/dma-noncoherent.c
> as I suggested, but actually no: errata/thead/errata.c never reaches
> riscv_noncoherent_supported() in early boot (you can see how 'fragile' it is
> though and why something needs to be done...).

I did make sure to check this patch itself, without the additional bit,
to see if it was needed.
But yeah, it is going to be super fragile - do you have any ideas about
how to circumvent that?

> Oh and I realized that I forgot the Reported-by from Andreas and the Fixes
> tags, so here they are:
> 
> Fixes: 39b33072941f ("riscv: Introduce CONFIG_RELOCATABLE")
> Reported-by: Andreas Schwab <schwab at linux-m68k.org>
> 
> 
> Thank you too for your patience and your quick answers!
> 
> Alex
> 
> 
> > 
> > _______________________________________________
> > linux-riscv mailing list
> > linux-riscv at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-riscv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20230531/901a8b80/attachment.sig>


More information about the linux-riscv mailing list