hv: ept: set snp control when modify

Current, SNP control bit is only set in ept_mr_add for cacheable memory.
However, memory type for VM0 is added as uncacheable type.
So SNP control is not set for VM0.
Add code to set SNP control bit for cacheable memory when ept modification.

Tracked-On: #1762
Signed-off-by: Binbin Wu <binbin.wu@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Binbin Wu 2018-11-08 16:06:04 +08:00 committed by lijinxia
parent 66f133bf45
commit 5a1f24473d

View File

@ -212,6 +212,10 @@ void ept_mr_modify(struct acrn_vm *vm, uint64_t *pml4_page,
dev_dbg(ACRN_DBG_EPT, "%s,vm[%d] gpa 0x%llx size 0x%llx\n", __func__, vm->vm_id, gpa, size);
if ((prot_set & EPT_MT_MASK) != EPT_UNCACHED) {
prot_set |= EPT_SNOOP_CTRL;
}
mmu_modify_or_del(pml4_page, gpa, size, prot_set, prot_clr, &vm->arch_vm.ept_mem_ops, MR_MODIFY);
foreach_vcpu(i, vm, vcpu) {