HomeFreeBSD

Swap order of dererencing PCPU curpmap and checking for usermode in

Description

Swap order of dererencing PCPU curpmap and checking for usermode in
trap_pfault() KPTI violation check.

EFI RT may set curpmap to NULL for the duration of the call for some
machines (PCID but no INVPCID). Since apparently EFI RT code must be
ready for exceptions from the calls, avoid dereferencing curpmap until
we know that this call does not come from usermode.

Reviewed by: kevans
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (rgrimes)
Differential revision: https://reviews.freebsd.org/D16972

Details

Provenance
kibAuthored on
Reviewer
kevans
Differential Revision
D16972: Catch exceptions during EFI RT calls on amd64.
Parents
rS338433: Normalize use of semicolon with EFI_TIME_LOCK macros.
Branches
Unknown
Tags
Unknown