HomeFreeBSD

amd64: fix switching to the pmap with pti disabled.

Description

amd64: fix switching to the pmap with pti disabled.

When the pmap with pti disabled (i.e. pm_ucr3 == PMAP_NO_CR3) is
activated, tss.rsp0 was not updated. Any interrupt that happen before
next context switch would use pti trampoline stack for hardware frame
but fault and interrupt handlers are not prepared to this. Correctly
update tss.rsp0 for both PMAP_NO_CR3 and pti pmaps.

Note that this case, pti = 1 but pmap->pm_ucr3 == PMAP_NO_CR3 is not
used at the moment.

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

Details

Provenance
kibAuthored on
Reviewer
markj
Differential Revision
D19514: KPTI: add control from proccontrol(8)
Parents
rS345225: amd64: rewrite cpu_switch.S fragment to reload tss.rsp0 on context switch.
Branches
Unknown
Tags
Unknown