Skip to content

Commit 0e67147

Browse files
committed
KVM: selftests: Drop the "feature event" param from guest test helpers
Now that validation of event count is tied to hardware support for event, and not to guest support for an event, drop the unused "event" parameter from the various helpers. No functional change intended. Link: https://lore.kernel.org/r/20250117234204.2600624-5-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent e327630 commit 0e67147

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

tools/testing/selftests/kvm/x86/pmu_counters_test.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,7 @@ static uint8_t guest_get_pmu_version(void)
148148
* Sanity check that in all cases, the event doesn't count when it's disabled,
149149
* and that KVM correctly emulates the write of an arbitrary value.
150150
*/
151-
static void guest_assert_event_count(uint8_t idx,
152-
struct kvm_x86_pmu_feature event,
153-
uint32_t pmc, uint32_t pmc_msr)
151+
static void guest_assert_event_count(uint8_t idx, uint32_t pmc, uint32_t pmc_msr)
154152
{
155153
uint64_t count;
156154

@@ -223,7 +221,7 @@ do { \
223221
); \
224222
} while (0)
225223

226-
#define GUEST_TEST_EVENT(_idx, _event, _pmc, _pmc_msr, _ctrl_msr, _value, FEP) \
224+
#define GUEST_TEST_EVENT(_idx, _pmc, _pmc_msr, _ctrl_msr, _value, FEP) \
227225
do { \
228226
wrmsr(_pmc_msr, 0); \
229227
\
@@ -234,17 +232,16 @@ do { \
234232
else \
235233
GUEST_MEASURE_EVENT(_ctrl_msr, _value, "nop", FEP); \
236234
\
237-
guest_assert_event_count(_idx, _event, _pmc, _pmc_msr); \
235+
guest_assert_event_count(_idx, _pmc, _pmc_msr); \
238236
} while (0)
239237

240-
static void __guest_test_arch_event(uint8_t idx, struct kvm_x86_pmu_feature event,
241-
uint32_t pmc, uint32_t pmc_msr,
238+
static void __guest_test_arch_event(uint8_t idx, uint32_t pmc, uint32_t pmc_msr,
242239
uint32_t ctrl_msr, uint64_t ctrl_msr_value)
243240
{
244-
GUEST_TEST_EVENT(idx, event, pmc, pmc_msr, ctrl_msr, ctrl_msr_value, "");
241+
GUEST_TEST_EVENT(idx, pmc, pmc_msr, ctrl_msr, ctrl_msr_value, "");
245242

246243
if (is_forced_emulation_enabled)
247-
GUEST_TEST_EVENT(idx, event, pmc, pmc_msr, ctrl_msr, ctrl_msr_value, KVM_FEP);
244+
GUEST_TEST_EVENT(idx, pmc, pmc_msr, ctrl_msr, ctrl_msr_value, KVM_FEP);
248245
}
249246

250247
static void guest_test_arch_event(uint8_t idx)
@@ -280,7 +277,7 @@ static void guest_test_arch_event(uint8_t idx)
280277
if (guest_has_perf_global_ctrl)
281278
wrmsr(MSR_CORE_PERF_GLOBAL_CTRL, BIT_ULL(i));
282279

283-
__guest_test_arch_event(idx, gp_event, i, base_pmc_msr + i,
280+
__guest_test_arch_event(idx, i, base_pmc_msr + i,
284281
MSR_P6_EVNTSEL0 + i, eventsel);
285282
}
286283

@@ -295,7 +292,7 @@ static void guest_test_arch_event(uint8_t idx)
295292

296293
wrmsr(MSR_CORE_PERF_FIXED_CTR_CTRL, FIXED_PMC_CTRL(i, FIXED_PMC_KERNEL));
297294

298-
__guest_test_arch_event(idx, fixed_event, i | INTEL_RDPMC_FIXED,
295+
__guest_test_arch_event(idx, i | INTEL_RDPMC_FIXED,
299296
MSR_CORE_PERF_FIXED_CTR0 + i,
300297
MSR_CORE_PERF_GLOBAL_CTRL,
301298
FIXED_PMC_GLOBAL_CTRL_ENABLE(i));

0 commit comments

Comments
 (0)