HV: implement wbinvd instruction emulation

wbinvd is used to write back all modified cache lines in the processor's
internal cache to main memory and invalidates(flushes) the internal caches.

Using clflushopt instructions to emulate wbinvd to flush each
guest vm memory, if CLFLUSHOPT is not supported, boot will fail.

Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Yuan Liu 2019-06-13 20:37:38 +08:00 committed by ACRN System Integration
parent ea699af861
commit f8934df355
1 changed files with 3 additions and 1 deletions

View File

@ -347,8 +347,10 @@ static int32_t xsetbv_vmexit_handler(struct acrn_vcpu *vcpu)
static int32_t wbinvd_vmexit_handler(struct acrn_vcpu *vcpu)
{
if (!iommu_snoop_supported(vcpu->vm->iommu)) {
if (has_rt_vm() == false) {
cache_flush_invalidate_all();
} else {
walk_ept_table(vcpu->vm, ept_flush_leaf_page);
}
return 0;