Commit b1b70562 authored by Sean Christopherson's avatar Sean Christopherson
Browse files

KVM: selftests: Assert that full-width PMC writes are supported if PDCM=1

KVM emulates full-width PMC writes in software, assert that KVM reports
full-width writes as supported if PERF_CAPABILITIES is supported.

Link: https://lore.kernel.org/r/20230311004618.920745-11-seanjc@google.com


Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 710fb612
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -110,6 +110,9 @@ int main(int argc, char *argv[])
	host_cap.capabilities = kvm_get_feature_msr(MSR_IA32_PERF_CAPABILITIES);
	host_cap.capabilities &= (PMU_CAP_FW_WRITES | PMU_CAP_LBR_FMT);

	TEST_ASSERT(host_cap.full_width_write,
		    "Full-width writes should always be supported");

	test_basic_perf_capabilities(host_cap);
	test_fungible_perf_capabilities(host_cap);
	test_immutable_perf_capabilities(host_cap);