diff options
-rw-r--r-- | arch/x86/kvm/x86.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index a24bae0a83a2..30723a4122cd 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -625,7 +625,9 @@ int kvm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) | |||
625 | if ((cr0 ^ old_cr0) & update_bits) | 625 | if ((cr0 ^ old_cr0) & update_bits) |
626 | kvm_mmu_reset_context(vcpu); | 626 | kvm_mmu_reset_context(vcpu); |
627 | 627 | ||
628 | if ((cr0 ^ old_cr0) & X86_CR0_CD) | 628 | if (((cr0 ^ old_cr0) & X86_CR0_CD) && |
629 | kvm_arch_has_noncoherent_dma(vcpu->kvm) && | ||
630 | !kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_CD_NW_CLEARED)) | ||
629 | kvm_zap_gfn_range(vcpu->kvm, 0, ~0ULL); | 631 | kvm_zap_gfn_range(vcpu->kvm, 0, ~0ULL); |
630 | 632 | ||
631 | return 0; | 633 | return 0; |