Page MenuHomeFreeBSD

kboot: aarch64 trampoline implementation
ClosedPublic

Authored by imp on Jan 29 2023, 3:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
May 26 2024, 12:35 AM
Unknown Object (File)
May 26 2024, 12:35 AM
Unknown Object (File)
May 26 2024, 12:35 AM
Unknown Object (File)
May 26 2024, 12:35 AM
Unknown Object (File)
May 26 2024, 12:35 AM
Unknown Object (File)
May 26 2024, 12:35 AM
Unknown Object (File)
May 26 2024, 12:35 AM
Unknown Object (File)
May 24 2024, 4:04 AM

Details

Summary

Update exec.c (copyied from efi/loader/arch/arm64/exec.c) to allow
execution of aarch64 kernels. This includes a new trampile code that
handles copying the UEFI memory map, if available from the Linux FDT
provided PA. This is a complete implementation now, able to boot from
the LinuxBoot environment on an aarch64 server that onyl offers
LinuxBoot (though a workaround for the gitv3 inability to re-init is not
upstream in FreeBSD yet).

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

gbe added inline comments.
stand/kboot/arch/aarch64/tramp.S
36–37

Linux

Fix linux spelling, per review, and also make the comment make more sense.

rebase / refactor / redo

trampile -> trampoline, onyl -> only, gitv3 -> gicv3 in commit message

stand/kboot/arch/aarch64/tramp.S
46

installs or sets up, probably not both?

This revision is now accepted and ready to land.Feb 2 2023, 3:41 AM

fix spelling issues... also commit message fixed locally.

This revision now requires review to proceed.Feb 2 2023, 3:56 AM
andrew added inline comments.
stand/kboot/arch/aarch64/exec.c
59

This is likely to fail on a non-4k kernel. Should be ok for an initial port, but is something to be aware about.

184

Does it need to be physically contiguous? If so malloc might not if it spans a page boundary.

stand/kboot/arch/aarch64/tramp.S
78–79

You could make this an ldp instruction

85–86

And this

This revision is now accepted and ready to land.Feb 2 2023, 2:39 PM
This revision now requires review to proceed.Feb 2 2023, 6:06 PM

thanks for the assembler tips

stand/kboot/arch/aarch64/exec.c
59

yea, we just use it for the trampoline, which we put AFTER the kernel, and its size doesn't really matter that much..

I'll keep this in mind in the future and come up with a better way to deal with.

stand/kboot/arch/aarch64/exec.c
59

IMO it'd be nice to have some sort of comment to this effect here.

This revision is now accepted and ready to land.Feb 2 2023, 10:18 PM
This revision was automatically updated to reflect the committed changes.