On 1/22/2025 12:13 AM, Sean Christopherson wrote: > On Mon, Jan 20, 2025, Dapeng Mi wrote: >> On 1/18/2025 1:11 AM, Sean Christopherson wrote: >>> @@ -98,14 +149,12 @@ static uint8_t guest_get_pmu_version(void) >>> * Sanity check that in all cases, the event doesn't count when it's disabled, >>> * and that KVM correctly emulates the write of an arbitrary value. >>> */ >>> -static void guest_assert_event_count(uint8_t idx, >>> - struct kvm_x86_pmu_feature event, >>> - uint32_t pmc, uint32_t pmc_msr) >>> +static void guest_assert_event_count(uint8_t idx, uint32_t pmc, uint32_t pmc_msr) >>> { >>> uint64_t count; >>> >>> count = _rdpmc(pmc); >>> - if (!this_pmu_has(event)) >>> + if (!(hardware_pmu_arch_events & BIT(idx))) >>> goto sanity_checks; >>> >>> switch (idx) { >>> @@ -126,7 +175,9 @@ static void guest_assert_event_count(uint8_t idx, >>> GUEST_ASSERT_NE(count, 0); >>> break; >>> case INTEL_ARCH_TOPDOWN_SLOTS_INDEX: >>> - GUEST_ASSERT(count >= NUM_INSNS_RETIRED); >>> + __GUEST_ASSERT(count < NUM_INSNS_RETIRED, >> shouldn't be "__GUEST_ASSERT(count >= NUM_INSNS_RETIRED," ? > Yes. I had intentionally inverted the check to verify the assert message and > forgot to flip it back before hitting "send". Thankfully, I didn't forget before > posting formally[*]. Ugh, but I did forget to Cc you on that series, sorry :-/ > > [*] https://lore.kernel.org/all/20250117234204.2600624-6-seanjc@xxxxxxxxxx Good to know. Thanks. >