HomeFreeBSD

amd64: do not enable PKRU if user disabled saving PKRU register in xsave mask

Description

amd64: do not enable PKRU if user disabled saving PKRU register in xsave mask

This is done by reverting CR4_PKE bit, because we perform %CR4
initialization in initializecpu(), and the function is called before
xsave_mask is read. To not redo the whole early initialization
sequence for the corner case, this should be good enough.

Reported by: jhb
Reviewed by: jhb, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D38219

Details

Provenance
kibAuthored on Jan 27 2023, 10:45 AM
Reviewer
jhb
Differential Revision
D38219: amd64: do not enable PKRU if user disabled saving PKRU register in xsave mask
Parents
rG11989314dc4a: x86: add more definitions for XCR0 bits
Branches
Unknown
Tags
Unknown