mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-06 09:06:30 +00:00
hypervisor: use "wbinvd" carefully in RT environment
Due to the side-effect to cache of "wbinvd" instruction, just apply it in case of noncoherent DMA. Tracked-On: #1824 Signed-off-by: Zheng, Gen <gen.zheng@intel.com> Reviewed-by: Binbin Wu <binbin.wu@intel.com>
This commit is contained in:
@@ -423,7 +423,9 @@ void vmx_write_cr0(struct acrn_vcpu *vcpu, uint64_t cr0)
|
||||
* disabled behavior
|
||||
*/
|
||||
exec_vmwrite64(VMX_GUEST_IA32_PAT_FULL, PAT_ALL_UC_VALUE);
|
||||
cache_flush_invalidate_all();
|
||||
if(!iommu_snoop_supported(vcpu->vm)) {
|
||||
cache_flush_invalidate_all();
|
||||
}
|
||||
} else {
|
||||
/* Restore IA32_PAT to enable cache again */
|
||||
exec_vmwrite64(VMX_GUEST_IA32_PAT_FULL,
|
||||
@@ -854,6 +856,8 @@ static void init_exec_ctrl(struct acrn_vcpu *vcpu)
|
||||
value32 |= VMX_PROCBASED_CTLS2_XSVE_XRSTR;
|
||||
}
|
||||
|
||||
value32 |= VMX_PROCBASED_CTLS2_WBINVD;
|
||||
|
||||
exec_vmwrite32(VMX_PROC_VM_EXEC_CONTROLS2, value32);
|
||||
pr_dbg("VMX_PROC_VM_EXEC_CONTROLS2: 0x%x ", value32);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user