[kvm-unit-tests PATCH v3 7/7] x86/pmu: Run the "emulation" test iff forced emulation is available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Run the PMU's emulation testcase if and only if forced emulation is
available, and do so without requiring the user to manually specify they
want to run the emulation testcase.

Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
---
 x86/pmu.c         | 17 ++++++++---------
 x86/unittests.cfg |  7 -------
 2 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/x86/pmu.c b/x86/pmu.c
index 457c5b9..d59baf1 100644
--- a/x86/pmu.c
+++ b/x86/pmu.c
@@ -655,17 +655,16 @@ int main(int ac, char **av)
 
 	apic_write(APIC_LVTPC, PC_VECTOR);
 
-	if (ac > 1 && !strcmp(av[1], "emulation")) {
+	if (is_fep_available())
 		check_emulated_instr();
-	} else {
+
+	check_counters();
+
+	if (rdmsr(MSR_IA32_PERF_CAPABILITIES) & PMU_CAP_FW_WRITES) {
+		gp_counter_base = MSR_IA32_PMC0;
+		report_prefix_push("full-width writes");
 		check_counters();
-
-		if (rdmsr(MSR_IA32_PERF_CAPABILITIES) & PMU_CAP_FW_WRITES) {
-			gp_counter_base = MSR_IA32_PMC0;
-			report_prefix_push("full-width writes");
-			check_counters();
-			check_gp_counters_write_width();
-		}
+		check_gp_counters_write_width();
 	}
 
 	return report_summary();
diff --git a/x86/unittests.cfg b/x86/unittests.cfg
index 01d775e..ed65185 100644
--- a/x86/unittests.cfg
+++ b/x86/unittests.cfg
@@ -198,13 +198,6 @@ check = /sys/module/kvm/parameters/ignore_msrs=N
 check = /proc/sys/kernel/nmi_watchdog=0
 accel = kvm
 
-[pmu_emulation]
-file = pmu.flat
-arch = x86_64
-extra_params = -cpu max -append emulation
-check = /sys/module/kvm/parameters/force_emulation_prefix=Y
-accel = kvm
-
 [vmware_backdoors]
 file = vmware_backdoors.flat
 extra_params = -machine vmport=on -cpu max
-- 
2.37.1.559.g78731f0fdb-goog




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux