Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x64/vmcs: Temporarily clear CR3[11:0] on promote (#584)
As part of the PTI patches, Linux now uses PCIDs to reduce the cost of context switches. The current PCID is given by CR3[11:0], and if this is not zero when CR4.PCIDE is set on a write to CR4, a #GP is raised. The promotion bug described in #573 was due to Bareflank restoring the guest CR3 (in which CR3[11:0] was nonzero), and then restoring the guest CR4, which was setting CR4.PCIDE. The resulting #GP was raised with nothing to handle it, leading to a triple fault. Now Bareflank writes a copy of the guest CR3 with bits 11-0 clear, then writes the guest's CR4. Once the CR4 is written, the guest's original CR3 is restored.
- Loading branch information