Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull kvm fixes from Paolo Bonzini:
"Two small fixes, one of which was being worked around in selftests"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
KVM: x86: Retry page fault if MMU reload is pending and root has no sp
KVM: selftests: vmx_pmu_msrs_test: Drop tests mangling guest visible CPUIDs
KVM: x86: Drop guest CPUID check for host initiated writes to MSR_IA32_PERF_CAPABILITIES

+16 -19
+15 -1
arch/x86/kvm/mmu/mmu.c
··· 3987 3987 static bool is_page_fault_stale(struct kvm_vcpu *vcpu, 3988 3988 struct kvm_page_fault *fault, int mmu_seq) 3989 3989 { 3990 - if (is_obsolete_sp(vcpu->kvm, to_shadow_page(vcpu->arch.mmu->root_hpa))) 3990 + struct kvm_mmu_page *sp = to_shadow_page(vcpu->arch.mmu->root_hpa); 3991 + 3992 + /* Special roots, e.g. pae_root, are not backed by shadow pages. */ 3993 + if (sp && is_obsolete_sp(vcpu->kvm, sp)) 3994 + return true; 3995 + 3996 + /* 3997 + * Roots without an associated shadow page are considered invalid if 3998 + * there is a pending request to free obsolete roots. The request is 3999 + * only a hint that the current root _may_ be obsolete and needs to be 4000 + * reloaded, e.g. if the guest frees a PGD that KVM is tracking as a 4001 + * previous root, then __kvm_mmu_prepare_zap_page() signals all vCPUs 4002 + * to reload even if no vCPU is actively using the root. 4003 + */ 4004 + if (!sp && kvm_test_request(KVM_REQ_MMU_RELOAD, vcpu)) 3991 4005 return true; 3992 4006 3993 4007 return fault->slot &&
+1 -1
arch/x86/kvm/x86.c
··· 3413 3413 3414 3414 if (!msr_info->host_initiated) 3415 3415 return 1; 3416 - if (guest_cpuid_has(vcpu, X86_FEATURE_PDCM) && kvm_get_msr_feature(&msr_ent)) 3416 + if (kvm_get_msr_feature(&msr_ent)) 3417 3417 return 1; 3418 3418 if (data & ~msr_ent.data) 3419 3419 return 1;
-17
tools/testing/selftests/kvm/x86_64/vmx_pmu_msrs_test.c
··· 110 110 ret = _vcpu_set_msr(vm, 0, MSR_IA32_PERF_CAPABILITIES, PMU_CAP_LBR_FMT); 111 111 TEST_ASSERT(ret == 0, "Bad PERF_CAPABILITIES didn't fail."); 112 112 113 - /* testcase 4, set capabilities when we don't have PDCM bit */ 114 - entry_1_0->ecx &= ~X86_FEATURE_PDCM; 115 - vcpu_set_cpuid(vm, VCPU_ID, cpuid); 116 - ret = _vcpu_set_msr(vm, 0, MSR_IA32_PERF_CAPABILITIES, host_cap.capabilities); 117 - TEST_ASSERT(ret == 0, "Bad PERF_CAPABILITIES didn't fail."); 118 - 119 - /* testcase 5, set capabilities when we don't have PMU version bits */ 120 - entry_1_0->ecx |= X86_FEATURE_PDCM; 121 - eax.split.version_id = 0; 122 - entry_1_0->ecx = eax.full; 123 - vcpu_set_cpuid(vm, VCPU_ID, cpuid); 124 - ret = _vcpu_set_msr(vm, 0, MSR_IA32_PERF_CAPABILITIES, PMU_CAP_FW_WRITES); 125 - TEST_ASSERT(ret == 0, "Bad PERF_CAPABILITIES didn't fail."); 126 - 127 - vcpu_set_msr(vm, 0, MSR_IA32_PERF_CAPABILITIES, 0); 128 - ASSERT_EQ(vcpu_get_msr(vm, VCPU_ID, MSR_IA32_PERF_CAPABILITIES), 0); 129 - 130 113 kvm_vm_free(vm); 131 114 }