|
@@ -625,7 +625,9 @@ int kvm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0)
|
|
if ((cr0 ^ old_cr0) & update_bits)
|
|
if ((cr0 ^ old_cr0) & update_bits)
|
|
kvm_mmu_reset_context(vcpu);
|
|
kvm_mmu_reset_context(vcpu);
|
|
|
|
|
|
- if ((cr0 ^ old_cr0) & X86_CR0_CD)
|
|
|
|
|
|
+ if (((cr0 ^ old_cr0) & X86_CR0_CD) &&
|
|
|
|
+ kvm_arch_has_noncoherent_dma(vcpu->kvm) &&
|
|
|
|
+ !kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_CD_NW_CLEARED))
|
|
kvm_zap_gfn_range(vcpu->kvm, 0, ~0ULL);
|
|
kvm_zap_gfn_range(vcpu->kvm, 0, ~0ULL);
|
|
|
|
|
|
return 0;
|
|
return 0;
|