With "use TPR shadow" the CR8 of a guest is the TPR in its virtual-APIC
page, and the guest has a VM exit when the TPR goes below a threshold.
Windows uses CR8 all the time, and a hypervisor that runs it wants this
control. L1 is now offered it for L2.
- vmcs02 gets the control, the address of L1's virtual-APIC page and L1's TPR threshold, and the CPU does the rest. The page stays held while L2 runs, as L1's bitmaps do. A CPU takes any address for the page; when L1 gives one that is not memory of the VM, vmcs02 gets a page that nothing else uses.
- With the TPR shadow L2's CR8 is not L1's TPR, so vmcs02 has "CR8-load exiting" and "CR8-store exiting" only if L1 has set them.
- The checks of the SDM (27.2.1.1): the address of the page, bits 31:4 of the TPR threshold, and the threshold against the TPR in the page.
AI assistance: as D61708, this change was developed with an AI assistant (Anthropic's Claude) under my direction. The assistant wrote the code and this description. The tests in the test plan were run on real hardware.
Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com>
Sponsored by: keelos.dev