HomeFreeBSD

amd64: For non-PTI mode, do not initialize PCPU kcr3 to KPML4phys.

Description

amd64: For non-PTI mode, do not initialize PCPU kcr3 to KPML4phys.

Non-PTI mode does not switch kcr3, which means that kcr3 is almost
always stale. This is important for the NMI handler, which reloads
%cr3 with PCPU(kcr3) if the value is different from PMAP_NO_CR3.

The end result is that curpmap in NMI handler does not match the page
table loaded into hardware. The manifestation was copyin(9) looping
forever when a usermode access page fault cannot be resolved by
vm_fault() updating a different page table.

Reported by: mmacy
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Approved by: re (gjb)

Details

Provenance
kibAuthored on
Reviewer
markj
Parents
rS338458: wmt(4): Fix regression introduced in r337289
Branches
Unknown
Tags
Unknown