The ASID allocation in SVM is incorrect because it allocates a single ASID for

all vcpus belonging to a guest. This means that when different vcpus belonging
to the same guest are executing on the same host cpu there may be "leakage"
in the mappings created by one vcpu to another.

The proper fix for this is being worked on and will be committed shortly.

In the meantime workaround this bug by flushing the guest TLB entries on every
VM entry.

Submitted by:	Anish Gupta (akgupt3@gmail.com)
This commit is contained in:
Neel Natu 2013-10-21 23:46:37 +00:00
parent 4599af439f
commit ab76fd5833
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/bhyve_svm/; revision=256867

View File

@ -955,8 +955,13 @@ svm_vmrun(void *arg, int vcpu, register_t rip)
/* Can't use any cached VMCB state by cpu.*/
ctrl->vmcb_clean = VMCB_CACHE_NONE;
} else {
/* Don't flush TLB since guest ASID is unchanged. */
ctrl->tlb_ctrl = VMCB_TLB_FLUSH_NOTHING;
/*
* XXX: Using same ASID for all vcpus of a VM will cause TLB
* corruption. This can easily be produced by muxing two vcpus
* on same core.
* For now, flush guest TLB for every vmrun.
*/
ctrl->tlb_ctrl = VMCB_TLB_FLUSH_GUEST;
/*
* This is the same cpu on which vcpu last ran so don't