@@ -889,6 +889,7 @@ static void test_fixed_ctr_action_and_bitmap(struct kvm_vcpu *vcpu,
uint32_t bitmap;
uint64_t count;
bool expected;
+ struct kvm_pmu_event_filter *f;
/*
* Check the fixed performance counter can count normally works when
@@ -902,6 +903,19 @@ static void test_fixed_ctr_action_and_bitmap(struct kvm_vcpu *vcpu,
expected = fixed_ctr_is_allowed(fixed_ctr_idx, actions[i], bitmap);
count = test_fixed_ctr_with_filter(vcpu, actions[i], bitmap);
+ TEST_ASSERT(expected == !!count,
+ "Fixed event filter does not work as expected.");
+
+ /*
+ * Check that setting both events[] and fixed_counter_bitmap
+ * does not affect the consistency of the fixed ctrs' behaviour.
+ *
+ * Note, the fixed_counter_bitmap rule has high priority.
+ */
+ f = event_filter(actions[i]);
+ f->fixed_counter_bitmap = bitmap;
+ count = test_with_filter(vcpu, f);
+
TEST_ASSERT(expected == !!count,
"Fixed event filter does not work as expected.");
}