aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2013-10-30 13:02:23 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2013-10-30 14:02:13 -0400
commitd96eb2c6f480769bff32054e78b964860dae4d56 (patch)
tree48245bcee8cd688c11c2974c4a0c7391660dd423 /arch/x86
parentec53500fae421e07c5d035918ca454a429732ef4 (diff)
kvm/x86: Convert iommu_flags to iommu_noncoherent
Default to operating in coherent mode. This simplifies the logic when we switch to a model of registering and unregistering noncoherent I/O with KVM. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/include/asm/kvm_host.h2
-rw-r--r--arch/x86/kvm/vmx.c2
-rw-r--r--arch/x86/kvm/x86.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 5cbf3166257c..91b35e4005d3 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -564,7 +564,7 @@ struct kvm_arch {
564 564
565 struct list_head assigned_dev_head; 565 struct list_head assigned_dev_head;
566 struct iommu_domain *iommu_domain; 566 struct iommu_domain *iommu_domain;
567 int iommu_flags; 567 bool iommu_noncoherent;
568 struct kvm_pic *vpic; 568 struct kvm_pic *vpic;
569 struct kvm_ioapic *vioapic; 569 struct kvm_ioapic *vioapic;
570 struct kvm_pit *vpit; 570 struct kvm_pit *vpit;
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 6850b0f1d52b..727a5e980c43 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -7446,7 +7446,7 @@ static u64 vmx_get_mt_mask(struct kvm_vcpu *vcpu, gfn_t gfn, bool is_mmio)
7446 if (is_mmio) 7446 if (is_mmio)
7447 ret = MTRR_TYPE_UNCACHABLE << VMX_EPT_MT_EPTE_SHIFT; 7447 ret = MTRR_TYPE_UNCACHABLE << VMX_EPT_MT_EPTE_SHIFT;
7448 else if (vcpu->kvm->arch.iommu_domain && 7448 else if (vcpu->kvm->arch.iommu_domain &&
7449 !(vcpu->kvm->arch.iommu_flags & KVM_IOMMU_CACHE_COHERENCY)) 7449 vcpu->kvm->arch.iommu_noncoherent)
7450 ret = kvm_get_guest_memory_type(vcpu, gfn) << 7450 ret = kvm_get_guest_memory_type(vcpu, gfn) <<
7451 VMX_EPT_MT_EPTE_SHIFT; 7451 VMX_EPT_MT_EPTE_SHIFT;
7452 else 7452 else
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 15f9540a2b1f..92ad83e5b132 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2719,7 +2719,7 @@ static void wbinvd_ipi(void *garbage)
2719static bool need_emulate_wbinvd(struct kvm_vcpu *vcpu) 2719static bool need_emulate_wbinvd(struct kvm_vcpu *vcpu)
2720{ 2720{
2721 return vcpu->kvm->arch.iommu_domain && 2721 return vcpu->kvm->arch.iommu_domain &&
2722 !(vcpu->kvm->arch.iommu_flags & KVM_IOMMU_CACHE_COHERENCY); 2722 vcpu->kvm->arch.iommu_noncoherent;
2723} 2723}
2724 2724
2725void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) 2725void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)