]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/x86/kvm/svm.c
Revert "KVM: SVM: Sync g_pat with guest-written PAT value"
[karo-tx-linux.git] / arch / x86 / kvm / svm.c
index 94b7d15db3fc91f3a70d665892f6f41832145c22..22601206ffd7c466a4300a6103db981775f7f478 100644 (file)
@@ -1167,11 +1167,14 @@ static u64 svm_get_mt_mask(struct kvm_vcpu *vcpu, gfn_t gfn, bool is_mmio)
        u8 mtrr;
 
        /*
-        * 1. MMIO: trust guest MTRR, so same as item 3.
+        * 1. MMIO: always map as UC
         * 2. No passthrough: always map as WB, and force guest PAT to WB as well
         * 3. Passthrough: can't guarantee the result, try to trust guest.
         */
-       if (!is_mmio && !kvm_arch_has_assigned_device(vcpu->kvm))
+       if (is_mmio)
+               return _PAGE_NOCACHE;
+
+       if (!kvm_arch_has_assigned_device(vcpu->kvm))
                return 0;
 
        if (!kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_CD_NW_CLEARED) &&
@@ -3351,16 +3354,6 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr)
        case MSR_VM_IGNNE:
                vcpu_unimpl(vcpu, "unimplemented wrmsr: 0x%x data 0x%llx\n", ecx, data);
                break;
-       case MSR_IA32_CR_PAT:
-               if (npt_enabled) {
-                       if (!kvm_mtrr_valid(vcpu, MSR_IA32_CR_PAT, data))
-                               return 1;
-                       vcpu->arch.pat = data;
-                       svm_set_guest_pat(svm, &svm->vmcb->save.g_pat);
-                       mark_dirty(svm->vmcb, VMCB_NPT);
-                       break;
-               }
-               /* fall through */
        default:
                return kvm_set_msr_common(vcpu, msr);
        }