On 21/12/2022 12:12 am, Aaron Lewis wrote:
+static bool is_fixed_event_allowed(struct kvm_pmu_event_filter *filter, int idx) +{ + int fixed_idx = idx - INTEL_PMC_IDX_FIXED; + + if (filter->action == KVM_PMU_EVENT_DENY && + test_bit(fixed_idx, (ulong *)&filter->fixed_counter_bitmap)) + return false; + if (filter->action == KVM_PMU_EVENT_ALLOW && + !test_bit(fixed_idx, (ulong *)&filter->fixed_counter_bitmap)) + return false; + + return true; +}
Before masked event is introduced, the decision logic for fixed events is not yet covered
by existing and new selftests, which affects the review of new changes to this part. More selftests on fixed_event is appreciated and required.