Page MenuHomeFreeBSD

x86: improve reservation of AP trampoline memory
ClosedPublic

Authored by royger on Mar 28 2018, 11:14 AM.
Tags
None
Referenced Files
F166205501: D14878.id.diff
Wed, Aug 12, 8:46 AM
F166115914: D14878.diff
Tue, Aug 11, 8:41 PM
Unknown Object (File)
Mon, Aug 10, 2:52 AM
Unknown Object (File)
Sat, Aug 8, 4:28 PM
Unknown Object (File)
Sat, Aug 8, 12:58 AM
Unknown Object (File)
Fri, Aug 7, 7:35 AM
Unknown Object (File)
Jun 23 2026, 11:04 AM
Unknown Object (File)
Jun 10 2026, 2:26 AM
Subscribers

Details

Summary

So that it doesn't rely on physmap[1] containing an address below
1MiB. Instead scan the full physmap and search for a suitable address
to place the trampoline code (below 1MiB) and the initial memory pages
(below 4GiB).

Sponsored by: Citrix Systems R&D

Test Plan

Tested on amd64, only build-tested on i386.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/i386/i386/mp_machdep.c
148 ↗(On Diff #40834)

Can you share this function between 386 and amd64 ?

sys/sys/param.h
367 ↗(On Diff #40834)

This should be committed separately.

Thanks, new version coming up.

sys/i386/i386/mp_machdep.c
148 ↗(On Diff #40834)

Yes, I've placed it in mp_x86.c

sys/sys/param.h
367 ↗(On Diff #40834)

OK, I can do this. IMO I don't like to introduce functions/macros/whatever without a caller on the same patch.

royger marked 2 inline comments as done.
  • share the trampoline allocation logic between i386 and amd64.
  • Define bootMP_size in assembly for amd64 also (so it can be set at link time).
  • Define GiB/MiB in a pre-patch.
This revision is now accepted and ready to land.Apr 4 2018, 2:01 PM
This revision was automatically updated to reflect the committed changes.