Re: [PATCH v3 3/4] KVM: selftests: Check if event filter meets expectations on fixed counters

From: Sean Christopherson
Date: Wed Jun 28 2023 - 17:29:08 EST


On Wed, Jun 07, 2023, Jinrong Liang wrote:
> + /*
> + * Check the fixed performance counter can count normally works when
> + * KVM userspace doesn't set any pmu filter.
> + */
> + TEST_ASSERT(run_vcpu_to_sync(vcpu),
> + "Fixed counter does not exist or does not work as expected.");

No punctuation, and print the unexpected return value so that debug isn't too
painful.

> +
> + for (i = 0; i < BIT(nr_fixed_counters); i++) {
> + bitmap = BIT(i);
> + count = test_with_fixed_counter_filter(vcpu, KVM_PMU_EVENT_ALLOW,
> + bitmap);
> + TEST_ASSERT(!!count == !!(bitmap & BIT(idx)),
> + "Fixed event filter does not work as expected.");

No punctuation please.

> +
> + count = test_with_fixed_counter_filter(vcpu, KVM_PMU_EVENT_DENY,
> + bitmap);
> + TEST_ASSERT(!!count == !(bitmap & BIT(idx)),
> + "Fixed event filter does not work as expected.");
> + }
> +}