mirror of
https://github.com/torvalds/linux.git
synced 2024-11-16 17:12:06 +00:00
KVM: selftests: vmx_pmu_msrs_test: Drop tests mangling guest visible CPUIDs
Host initiated writes to MSR_IA32_PERF_CAPABILITIES should not depend
on guest visible CPUIDs and (incorrect) KVM logic implementing it is
about to change. Also, KVM_SET_CPUID{,2} after KVM_RUN is now forbidden
and causes test to fail.
Reported-by: kernel test robot <oliver.sang@intel.com>
Fixes: feb627e8d6
("KVM: x86: Forbid KVM_SET_CPUID{,2} after KVM_RUN")
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20211216165213.338923-2-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
1aa2abb33a
commit
0b091a43d7
@ -110,22 +110,5 @@ int main(int argc, char *argv[])
|
||||
ret = _vcpu_set_msr(vm, 0, MSR_IA32_PERF_CAPABILITIES, PMU_CAP_LBR_FMT);
|
||||
TEST_ASSERT(ret == 0, "Bad PERF_CAPABILITIES didn't fail.");
|
||||
|
||||
/* testcase 4, set capabilities when we don't have PDCM bit */
|
||||
entry_1_0->ecx &= ~X86_FEATURE_PDCM;
|
||||
vcpu_set_cpuid(vm, VCPU_ID, cpuid);
|
||||
ret = _vcpu_set_msr(vm, 0, MSR_IA32_PERF_CAPABILITIES, host_cap.capabilities);
|
||||
TEST_ASSERT(ret == 0, "Bad PERF_CAPABILITIES didn't fail.");
|
||||
|
||||
/* testcase 5, set capabilities when we don't have PMU version bits */
|
||||
entry_1_0->ecx |= X86_FEATURE_PDCM;
|
||||
eax.split.version_id = 0;
|
||||
entry_1_0->ecx = eax.full;
|
||||
vcpu_set_cpuid(vm, VCPU_ID, cpuid);
|
||||
ret = _vcpu_set_msr(vm, 0, MSR_IA32_PERF_CAPABILITIES, PMU_CAP_FW_WRITES);
|
||||
TEST_ASSERT(ret == 0, "Bad PERF_CAPABILITIES didn't fail.");
|
||||
|
||||
vcpu_set_msr(vm, 0, MSR_IA32_PERF_CAPABILITIES, 0);
|
||||
ASSERT_EQ(vcpu_get_msr(vm, VCPU_ID, MSR_IA32_PERF_CAPABILITIES), 0);
|
||||
|
||||
kvm_vm_free(vm);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user