From: Like Xu <likexu@xxxxxxxxxxx> This test case uses MSR_IA32_PERFCTR0 to count branch instructions and PERFCTR1 to count instruction events. The same correspondence should be maintained at report(), specifically this should use status bit 1 for instructions and bit 0 for branches. Fixes: 20cf914 ("x86/pmu: Test PMU virtualization on emulated instructions") Reported-by: Sandipan Das <sandipan.das@xxxxxxx> Signed-off-by: Like Xu <likexu@xxxxxxxxxxx> --- x86/pmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x86/pmu.c b/x86/pmu.c index c8a2e91..d303a36 100644 --- a/x86/pmu.c +++ b/x86/pmu.c @@ -512,8 +512,8 @@ static void check_emulated_instr(void) "branch count"); // Additionally check that those counters overflowed properly. status = rdmsr(MSR_CORE_PERF_GLOBAL_STATUS); - report(status & 1, "instruction counter overflow"); - report(status & 2, "branch counter overflow"); + report(status & 1, "branch counter overflow"); + report(status & 2, "instruction counter overflow"); report_prefix_pop(); } -- 2.38.1