Page MenuHomeFreeBSD

amd64: stop doing special allocation for the AP startup trampoline
ClosedPublic

Authored by kib on Jul 29 2021, 12:27 AM.

Details

Summary

There is no reason now why do we need to allocate trampoline page very early in the boot process. The only requirement for the page is that it is below 1M to be usable by the real mode during init. This can be handled by vm_alloc_contig() when we do the startup.

Also assert that startup trampoline fits into single page. In principle we can do multi-page allocation if needed, but it is not.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

kib requested review of this revision.Jul 29 2021, 12:27 AM
kib created this revision.

The only requirement for the page is that it is below 1G to be usable by the real mode during init.

Should be 1M.

x86_smp.h still declares alloc_ap_trampoline() on amd64. Perhaps just wrap the declaration with an ifdef i386?

sys/amd64/amd64/mp_machdep.c
341

I think boot_address can become a local variable which gets passed to start_ap().

kib edited the summary of this revision. (Show Details)

Make boot_address local for amd64/mp_machdep.c.
Brace i386 specific definitions in x86/include
Fix typo in summary
Fix several more cases where lower memory touched by EFI booted kernel (will be a separate commit)

This revision is now accepted and ready to land.Jul 29 2021, 1:27 PM