All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zide Chen <zide.chen@intel.com>
To: kvm@vger.kernel.org
Cc: Zide Chen <zide.chen@intel.com>, Dapeng Mi <dapeng1.mi@linux.intel.com>
Subject: [kvm-unit-test PATCH 3/3] x86/pmu: Execute PEBS test only if PEBSRecordFormat >= 4
Date: Mon, 18 Nov 2024 14:52:07 -0800	[thread overview]
Message-ID: <20241118225207.16596-3-zide.chen@intel.com> (raw)
In-Reply-To: <20241118225207.16596-1-zide.chen@intel.com>

Before adaptive PEBS v4, the PEBS record format is not determined by
MSR_PEBS_DATA_CFG, but by IA32_PERF_CAPABILITIES.PEBS_FMT[11:8] (< 4),
which is not covered by this unit test.

We don't want additional implementation to support such legacy
platforms, instead, we can exclude them from the test to avoid test
failures.

Technically, it seems checking IA32_PERF_CAPABILITIES.PEBS_BASELINE[14]
is more reasonable.  But this bit is not exposed to the guest in the
current KVM emulated vPMU implementation, and if we use it as a filter,
it will filter out all platforms.

Signed-off-by: Zide Chen <zide.chen@intel.com>
Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
---
 x86/pmu_pebs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/x86/pmu_pebs.c b/x86/pmu_pebs.c
index 6b4a5ed3b91e..6396d51c6b49 100644
--- a/x86/pmu_pebs.c
+++ b/x86/pmu_pebs.c
@@ -404,8 +404,8 @@ int main(int ac, char **av)
 	} else if (!pmu_has_pebs()) {
 		report_skip("PEBS required PMU version 2, reported version is %d", pmu.version);
 		return report_summary();
-	} else if (!pmu_pebs_format()) {
-		report_skip("PEBS not enumerated in PERF_CAPABILITIES");
+	} else if (pmu_pebs_format() < 4) {
+		report_skip("This test supports PEBS_Record_Format >= 4 only");
 		return report_summary();
 	} else if (rdmsr(MSR_IA32_MISC_ENABLE) & MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL) {
 		report_skip("PEBS unavailable according to MISC_ENABLE");
-- 
2.34.1


  parent reply	other threads:[~2024-11-18 22:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-18 22:52 [kvm-unit-test PATCH 1/3] nVMX: fixed-function performance counters could be not contiguous Zide Chen
2024-11-18 22:52 ` [kvm-unit-test PATCH 2/3] x86/pmu: Fixed PEBS basic record parsing issue Zide Chen
2024-11-18 22:52 ` Zide Chen [this message]
2025-02-24 17:24 ` [kvm-unit-test PATCH 1/3] nVMX: fixed-function performance counters could be not contiguous Sean Christopherson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241118225207.16596-3-zide.chen@intel.com \
    --to=zide.chen@intel.com \
    --cc=dapeng1.mi@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.