diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2015-10-01 07:19:55 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-10-01 07:30:43 -0400 |
commit | bcf166a9942c3aabd8b752a7c38a49f57c54cfb8 (patch) | |
tree | dba718263b0c1e8d61a4f721ea9af7823ba95772 | |
parent | 625422f60c55bbc368b8568ff925770b36bfc189 (diff) |
Revert "KVM: svm: handle KVM_X86_QUIRK_CD_NW_CLEARED in svm_get_mt_mask"
This reverts commit 5492830370171b6a4ede8a3bfba687a8d0f25fa5.
It builds on the commit that is being reverted next.
Cc: stable@vger.kernel.org # 4.2+
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | arch/x86/kvm/svm.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 22601206ffd7..7c242b7007ac 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -1177,10 +1177,6 @@ static u64 svm_get_mt_mask(struct kvm_vcpu *vcpu, gfn_t gfn, bool is_mmio) | |||
1177 | if (!kvm_arch_has_assigned_device(vcpu->kvm)) | 1177 | if (!kvm_arch_has_assigned_device(vcpu->kvm)) |
1178 | return 0; | 1178 | return 0; |
1179 | 1179 | ||
1180 | if (!kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_CD_NW_CLEARED) && | ||
1181 | kvm_read_cr0(vcpu) & X86_CR0_CD) | ||
1182 | return _PAGE_NOCACHE; | ||
1183 | |||
1184 | mtrr = kvm_mtrr_get_guest_memory_type(vcpu, gfn); | 1180 | mtrr = kvm_mtrr_get_guest_memory_type(vcpu, gfn); |
1185 | return mtrr2protval[mtrr]; | 1181 | return mtrr2protval[mtrr]; |
1186 | } | 1182 | } |
@@ -1676,10 +1672,13 @@ static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) | |||
1676 | 1672 | ||
1677 | if (!vcpu->fpu_active) | 1673 | if (!vcpu->fpu_active) |
1678 | cr0 |= X86_CR0_TS; | 1674 | cr0 |= X86_CR0_TS; |
1679 | 1675 | /* | |
1680 | /* These are emulated via page tables. */ | 1676 | * re-enable caching here because the QEMU bios |
1681 | cr0 &= ~(X86_CR0_CD | X86_CR0_NW); | 1677 | * does not do it - this results in some delay at |
1682 | 1678 | * reboot | |
1679 | */ | ||
1680 | if (kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_CD_NW_CLEARED)) | ||
1681 | cr0 &= ~(X86_CR0_CD | X86_CR0_NW); | ||
1683 | svm->vmcb->save.cr0 = cr0; | 1682 | svm->vmcb->save.cr0 = cr0; |
1684 | mark_dirty(svm->vmcb, VMCB_CR); | 1683 | mark_dirty(svm->vmcb, VMCB_CR); |
1685 | update_cr0_intercept(svm); | 1684 | update_cr0_intercept(svm); |