Page MenuHomeFreeBSD

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

Authored by kib on Jan 27 2023, 10:53 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Aug 26, 6:45 AM
Unknown Object (File)
Fri, Aug 23, 1:34 PM
Unknown Object (File)
Fri, Aug 23, 1:34 PM
Unknown Object (File)
Fri, Aug 23, 1:34 PM
Unknown Object (File)
Fri, Aug 23, 1:00 PM
Unknown Object (File)
Tue, Aug 13, 10:55 AM
Unknown Object (File)
Aug 5 2024, 4:08 PM
Unknown Object (File)
Aug 3 2024, 11:47 PM
Subscribers

Details

Summary
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

Also

x86: add more definitions for XCR0 bits

This covers all currently defined bits, adding PKRU and TILE.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Jan 27 2023, 10:53 AM
This revision is now accepted and ready to land.Jan 27 2023, 2:44 PM

I think for bhyve I might need to mask PKU as well, but I can deal with that part. bhyve also has to prevent guests from setting the CR4 bit.