diff mbox series

[3/4] few fixes for pmu_lbr test

Message ID 20210914163008.309356-4-mlevitsk@redhat.com (mailing list archive)
State New, archived
Headers show
Series AMD's LBR test for nesting and few more fixes | expand

Commit Message

Maxim Levitsky Sept. 14, 2021, 4:30 p.m. UTC
* don't run this test on AMD since AMD's LBR is not the same as Intel's LBR
and needs a different test.

* don't run this test on 32 bit as it is not built for 32 bit anyway

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
---
 x86/pmu_lbr.c     | 8 ++++++++
 x86/unittests.cfg | 1 +
 2 files changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/x86/pmu_lbr.c b/x86/pmu_lbr.c
index 3bd9e9f..5d6c424 100644
--- a/x86/pmu_lbr.c
+++ b/x86/pmu_lbr.c
@@ -68,6 +68,12 @@  int main(int ac, char **av)
 	int max, i;
 
 	setup_vm();
+
+	if (!is_intel()) {
+		report_skip("PMU_LBR test is for intel CPU's only");
+		return 0;
+	}
+
 	perf_cap = rdmsr(MSR_IA32_PERF_CAPABILITIES);
 	eax.full = id.a;
 
@@ -83,6 +89,8 @@  int main(int ac, char **av)
 	printf("PMU version:		 %d\n", eax.split.version_id);
 	printf("LBR version:		 %ld\n", perf_cap & PMU_CAP_LBR_FMT);
 
+
+
 	/* Look for LBR from and to MSRs */
 	lbr_from = MSR_LBR_CORE_FROM;
 	lbr_to = MSR_LBR_CORE_TO;
diff --git a/x86/unittests.cfg b/x86/unittests.cfg
index d5efab0..e3c8a98 100644
--- a/x86/unittests.cfg
+++ b/x86/unittests.cfg
@@ -180,6 +180,7 @@  extra_params = -cpu max
 check = /proc/sys/kernel/nmi_watchdog=0
 
 [pmu_lbr]
+arch = x86_64
 file = pmu_lbr.flat
 extra_params = -cpu host,migratable=no
 check = /sys/module/kvm/parameters/ignore_msrs=N