HomeFreeBSD

amd64: rework AP startup

Description

amd64: rework AP startup

Stop using temporal page table with 1:1 mapping of low 1G populated over
the whole VA. Use 1:1 mapping of low 4G temporarily installed in the
normal kernel page table.

The features are:

  • now there is one less step for startup asm to perform
  • the startup code still needs to be at lower 1G because CPU starts in real mode. But everything else can be located anywhere in low 4G because it is accessed by non-paged 32bit protected mode. Note that kernel page table root page is at low 4G, as well as the kernel itself.
  • the page table pages can be allocated by normal allocator, there is no need to carve them from the phys_avail segments at very early time. The allocation of the page for startup code still requires some magic. Pages are freed after APs are ignited.
  • la57 startup for APs is less tricky, we directly load the final page table and do not need to tweak the paging mode.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31121

Details

Provenance
kibAuthored on Jul 10 2021, 7:38 PM
Reviewer
markj
Differential Revision
D31121: amd64 UEFI boot: stop copying staging area to 2M phys
Parents
rGd96f55bc7159: linuxkpi: remove global atomic counter of the task allocations
Branches
Unknown
Tags
Unknown