Page MenuHomeFreeBSD

Add kernel ifunc support on arm64
ClosedPublic

Authored by andrew on Oct 1 2018, 11:23 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 30 2024, 11:22 PM
Unknown Object (File)
Sep 17 2024, 7:26 PM
Unknown Object (File)
Sep 14 2024, 8:37 AM
Unknown Object (File)
Sep 4 2024, 7:09 PM
Unknown Object (File)
Sep 1 2024, 6:39 AM
Unknown Object (File)
Aug 27 2024, 9:32 AM
Unknown Object (File)
Aug 26 2024, 4:07 PM
Unknown Object (File)
Aug 21 2024, 12:31 AM
Subscribers

Details

Summary

Tested with ifunc resolvers in the kernel and module with calls from
kernel to kernel, module to kernel, and module to module.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 19891
Build 19415: arc lint + arc unit

Event Timeline

sys/arm64/arm64/machdep.c
1078

Does panic work (or planned to work after real ifunc introduction) before ifuncs are resolved ?

sys/arm64/include/ifunc.h
42

Did you committed the change to add six zero args ?

andrew marked an inline comment as done.
  • Move link_elf_ireloc earlier in the boot
  • Include all the arguments in DEFINE_UIFUNC
sys/arm64/arm64/machdep.c
1078

I expect to move link_elf_ireloc earlier into the boot, however I also expect we will need to rerun the resolver functions after secondary CPUs have been started. They may have different ID registers that affect which implementation they select.

kib added inline comments.
sys/arm64/arm64/machdep.c
1078

For RELA relocations this should work, but not for REL. Also, you need to ensure that APs do not execute relocated code until fixed.

This revision is now accepted and ready to land.Oct 1 2018, 3:53 PM
andrew added inline comments.
sys/arm64/arm64/machdep.c
1078

I would expect we need to transform REL to RELA before the first relocation pass.

The resolvers in the early pass would need to understand they need to return safe values, however I expect any function that runs on the boot CPU will also run on the non-boot CPU, however it may be suboptimal.

sys/arm64/arm64/machdep.c
1078

I am not sure I see how the REL->RELA translation can be done, there is no space in Elf_Rel to save the addend, it is taken from the patched place and is overwritten by the act of relocation.

OTOH, I expect that arm64 uses RELA, same as amd64.

This revision was automatically updated to reflect the committed changes.