Skip to content

Commit f8934df

Browse files
yliu80acrnsi
authored andcommitted
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>
1 parent ea699af commit f8934df

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hypervisor/arch/x86/guest/vmexit.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,10 @@ static int32_t xsetbv_vmexit_handler(struct acrn_vcpu *vcpu)
347347

348348
static int32_t wbinvd_vmexit_handler(struct acrn_vcpu *vcpu)
349349
{
350-
if (!iommu_snoop_supported(vcpu->vm->iommu)) {
350+
if (has_rt_vm() == false) {
351351
cache_flush_invalidate_all();
352+
} else {
353+
walk_ept_table(vcpu->vm, ept_flush_leaf_page);
352354
}
353355

354356
return 0;

0 commit comments

Comments
 (0)