]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
amd64: For non-PTI mode, do not initialize PCPU kcr3 to KPML4phys.
authorKonstantin Belousov <kib@FreeBSD.org>
Tue, 4 Sep 2018 19:26:54 +0000 (19:26 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Tue, 4 Sep 2018 19:26:54 +0000 (19:26 +0000)
commite21c5abc2a941c4b8ee2e434f5aea2dcdc7edb36
treef6215f3936c406b2646a3e309c44dc15aa7f54cc
parent316086bd6c8be194ae394ae72fa3b70cf8899050
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)
sys/amd64/amd64/pmap.c