Re: [PATCH 2/2] KVM: selftests: Report enable_pmu module value when test is skipped

From: Sean Christopherson
Date: Tue Feb 14 2023 - 13:03:48 EST


On Tue, Feb 14, 2023, Like Xu wrote:
> From: Like Xu <likexu@xxxxxxxxxxx>
>
> Running x86_64/pmu_event_filter_test with enable_pmu globally disabled
> will report the following skipping prompt:
> 1..0 # SKIP - Requirement not met: use_intel_pmu() || use_amd_pmu()
> this can be confusing, so add a check on enable_pmu.
>
> Signed-off-by: Like Xu <likexu@xxxxxxxxxxx>
> ---
> tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c b/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c
> index bad7ef8c5b92..070bc8a60a7f 100644
> --- a/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c
> +++ b/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c
> @@ -771,6 +771,7 @@ int main(int argc, char *argv[])
> TEST_REQUIRE(kvm_has_cap(KVM_CAP_PMU_EVENT_FILTER));
> TEST_REQUIRE(kvm_has_cap(KVM_CAP_PMU_EVENT_MASKED_EVENTS));
>
> + TEST_REQUIRE(get_kvm_param_bool("enable_pmu"));

I think it makes sense to put this at the very top, just in case more requirements
that depend on enable_pmu get added in the future. I can do that when applying.

I'll plan on grabbing this for 6.4.

Thanks!