mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-07-06 20:09:01 +00:00
When CPU support MONITOR/MWAIT, OS prefer to use it enter deeper C-state. Now ACRN pass through MONITOR/MWAIT to guest. For vCPUs (ie vCPU A and vCPU B) share a pCPU, if vCPU A uses MWait to enter C state, vCPU B could run only after the time slice of vCPU A is expired. This time slice of vCPU A is gone to waste. For Local APIC pass-through (used for RTVM), the guest pay more attention to timeliness than power saving. So this patch hides MONITOR/MWAIT by: 1. Clear vCPUID.05H, vCPUID.01H:ECX.[bit 3] and MSR_IA32_MISC_ENABLE_MONITOR_ENA to tell the guest VM's vCPU does not support MONITOR/MAIT. 2. Enable MSR_IA32_MISC_ENABLE_MONITOR_ENA bit for MSR_IA32_MISC_ENABLE inject 'GP'. 3. Trap instruction 'MONITOR' and 'MWAIT' and inject 'UD'. 4. Clear vCPUID.07H:ECX.[bit 5] to hide 'UMONITOR/UMWAIT'. 5. Clear "enable user wait and pause" VM-execution control, so UMONITOR/MWAIT causes an 'UD'. Tracked-On: #8253 Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com> Reviewed-by: Fei Li <fei1.li@intel.com> |
||
---|---|---|
.. | ||
assign.h | ||
ept.h | ||
guest_memory.h | ||
guest_pm.h | ||
hyperv.h | ||
instr_emul.h | ||
lock_instr_emul.h | ||
nested.h | ||
optee.h | ||
trusty.h | ||
ucode.h | ||
vcat.h | ||
vcpu.h | ||
vcpuid.h | ||
vept.h | ||
virq.h | ||
virtual_cr.h | ||
vlapic.h | ||
vm_reset.h | ||
vm.h | ||
vmcs.h | ||
vmexit.h | ||
vmtrr.h | ||
vmx_io.h |