Re: [PATCH v5] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices

Avi Kivity
2010-06-29T12:35:42Z

On 06/29/2010 03:28 PM, Roedel, Joerg wrote:
>
>> Do you mean, KVM_IOMMU_CACHE_COHERENCY should be set for the AMD IOMMU?
>>
> No, as far as I understand it the KVM_IOMMU_CACHE_COHERENCY flag is only
> there because there are VT-d IOMMUs that does not support the snoop
> force bit. In the AMD IOMMU case all hardware has this feature, the
> IOMMU driver just has to use it for IOMMU-API page-tables too. This is
> currently not the case. So this is only an IOMMU driver change.
>

The flag indicates to kvm that it doesn't need to worry about iommu
cache coherency issues (for example, it can ignore wbinvd), so it needs
to be set. THe following code

if (iommu_domain_has_cap(kvm->arch.iommu_domain,
IOMMU_CAP_CACHE_COHERENCY))
kvm->arch.iommu_flags |= KVM_IOMMU_CACHE_COHERENCY;

does this, so it looks like you need to return true for
iommu_domain_has_cap() after the change. So far only the intel iommu
supports it.

--
error compiling committee.c: too many arguments to function