Page MenuHomeFreeBSD

RISC-V: fix global symbol lookups for mpentry with lld

Authored by mhorne on Jan 11 2020, 11:46 PM.



This is a follow up to r356481. In locore.S, before virtual memory is
set up, we should avoid using indirect address lookups through the GOT.
Therefore we need to convert uses of the la instruction to lla, which
always generates an auipc/addi pair of instructions. This conversion was
done for the BSP case, but not the AP case, resulting in a fault
somewhere before mpva and a failure to bring APs online.

Reported by: lwhsu

Test Plan

Kernel build with clang + lld boots in qemu with -smp 2

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mhorne created this revision.Jan 11 2020, 11:46 PM

Ah yes, good point, looks good to me.

lwhsu accepted this revision.Jan 12 2020, 7:45 AM

Thanks for the patch and this works in my staging CI env.

This revision is now accepted and ready to land.Jan 12 2020, 7:45 AM
This revision was automatically updated to reflect the committed changes.