Page MenuHomeFreeBSD

kboot: aarch64 trampoline implementation
ClosedPublic

Authored by imp on Jan 29 2023, 3:15 PM.
Tags
None
Referenced Files
F81936302: D38258.diff
Tue, Apr 23, 11:13 AM
Unknown Object (File)
Mon, Apr 22, 9:11 AM
Unknown Object (File)
Mar 22 2024, 9:57 PM
Unknown Object (File)
Mar 22 2024, 9:57 PM
Unknown Object (File)
Mar 22 2024, 9:57 PM
Unknown Object (File)
Mar 22 2024, 9:57 PM
Unknown Object (File)
Mar 22 2024, 9:57 PM
Unknown Object (File)
Mar 22 2024, 9:53 PM

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 Skipped
Unit
Tests Skipped
Build Status
Buildable 49472
Build 46362: arc lint + arc unit

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

86–87

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.