All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: kvm@vger.kernel.org
Cc: Paolo Bonzini <pbonzini@redhat.com>, Andrew Jones <drjones@redhat.com>
Subject: [PATCH kvm-unit-tests 3/6] x86/pmu: expect failure with nmi_watchdog
Date: Mon, 14 Dec 2015 22:24:18 +0100	[thread overview]
Message-ID: <1450128261-21170-4-git-send-email-rkrcmar@redhat.com> (raw)
In-Reply-To: <1450128261-21170-1-git-send-email-rkrcmar@redhat.com>

Host's nmi_watchdog takes one slot, making the "all counters" unit-test
fail.  We know exactly what happens, mark it as expected failure.

PMU test is now executed regardless of host_nmi_watchdog.

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
---
 x86/pmu.c         | 9 ++++++++-
 x86/unittests.cfg | 3 +--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/x86/pmu.c b/x86/pmu.c
index c68980044dee..4ca93235b977 100644
--- a/x86/pmu.c
+++ b/x86/pmu.c
@@ -92,6 +92,7 @@ struct pmu_event {
 };
 
 static int num_counters;
+bool host_nmi_watchdog;
 
 char *buf;
 
@@ -291,7 +292,7 @@ static void check_counters_many(void)
 		if (!verify_counter(&cnt[i]))
 			break;
 
-	report("all counters", i == n);
+	report_xfail("all counters", host_nmi_watchdog, i == n);
 }
 
 static void check_counter_overflow(void)
@@ -374,6 +375,7 @@ static void check_rdpmc(void)
 
 int main(int ac, char **av)
 {
+	int i;
 	struct cpuid id = cpuid(10);
 
 	setup_vm();
@@ -385,6 +387,11 @@ int main(int ac, char **av)
 	ebx.full = id.b;
 	edx.full = id.d;
 
+	/* XXX: horrible command line parsing */
+	for (i = 1; i < ac; i++)
+		if (!strcmp(av[i], "host_nmi_watchdog=1"))
+			host_nmi_watchdog = true;
+
 	if (!eax.split.version_id) {
 		printf("No pmu is detected!\n");
 		return report_summary();
diff --git a/x86/unittests.cfg b/x86/unittests.cfg
index ffffc15c86df..6b94ad93dcf0 100644
--- a/x86/unittests.cfg
+++ b/x86/unittests.cfg
@@ -106,8 +106,7 @@ file = msr.flat
 
 [pmu]
 file = pmu.flat
-extra_params = -cpu host
-check = /proc/sys/kernel/nmi_watchdog=0
+extra_params = -cpu host -append "host_nmi_watchdog=`cat /proc/sys/kernel/nmi_watchdog`"
 
 [port80]
 file = port80.flat
-- 
2.6.4


  parent reply	other threads:[~2015-12-14 21:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-14 21:24 [PATCH kvm-unit-tests 0/6] Improve the output of test runners Radim Krčmář
2015-12-14 21:24 ` [PATCH kvm-unit-tests 1/6] lib/report: allow test skipping Radim Krčmář
2015-12-14 22:00   ` Andrew Jones
2015-12-14 22:12     ` Andrew Jones
2015-12-15 12:54       ` Radim Krčmář
2015-12-14 21:24 ` [PATCH kvm-unit-tests 2/6] x86/*: report skipped tests Radim Krčmář
2015-12-14 22:07   ` Andrew Jones
2015-12-15 12:58     ` Radim Krčmář
2015-12-14 21:24 ` Radim Krčmář [this message]
2015-12-14 22:05   ` [PATCH kvm-unit-tests 3/6] x86/pmu: expect failure with nmi_watchdog Andrew Jones
2015-12-15 13:01     ` Radim Krčmář
2015-12-15 15:33       ` Andrew Jones
2015-12-14 21:24 ` [PATCH kvm-unit-tests 4/6] run_tests: generalize check Radim Krčmář
2015-12-14 22:11   ` Andrew Jones
2015-12-15 13:05     ` Radim Krčmář
2015-12-14 21:24 ` [PATCH kvm-unit-tests 5/6] x86/hyperv_synic: check for support before testing Radim Krčmář
2015-12-14 21:24 ` [PATCH kvm-unit-tests 6/6] run_tests: print summary Radim Krčmář
2015-12-14 22:20 ` [PATCH kvm-unit-tests 0/6] Improve the output of test runners Andrew Jones
2015-12-15 13:10   ` Radim Krčmář
2015-12-15 10:19 ` Paolo Bonzini
2015-12-15 13:13   ` Radim Krčmář
2015-12-15 15:37     ` Andrew Jones

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=1450128261-21170-4-git-send-email-rkrcmar@redhat.com \
    --to=rkrcmar@redhat.com \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /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.