From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PATCH kvm-unit-tests v2 07/12] x86/pmu: expect failure with nmi_watchdog Date: Thu, 17 Dec 2015 18:53:38 +0100 Message-ID: <1450374823-7648-8-git-send-email-rkrcmar@redhat.com> References: <1450374823-7648-1-git-send-email-rkrcmar@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Paolo Bonzini , Andrew Jones To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:49366 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753614AbbLQRyQ (ORCPT ); Thu, 17 Dec 2015 12:54:16 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 0B8AB693CE for ; Thu, 17 Dec 2015 17:54:16 +0000 (UTC) In-Reply-To: <1450374823-7648-1-git-send-email-rkrcmar@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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=C4=8Dm=C3=A1=C5=99 --- v2: - host_nmi_watchdog made static =20 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..70e9b3a41e96 100644 --- a/x86/pmu.c +++ b/x86/pmu.c @@ -92,6 +92,7 @@ struct pmu_event { }; =20 static int num_counters; +static bool host_nmi_watchdog; =20 char *buf; =20 @@ -291,7 +292,7 @@ static void check_counters_many(void) if (!verify_counter(&cnt[i])) break; =20 - report("all counters", i =3D=3D n); + report_xfail("all counters", host_nmi_watchdog, i =3D=3D n); } =20 static void check_counter_overflow(void) @@ -374,6 +375,7 @@ static void check_rdpmc(void) =20 int main(int ac, char **av) { + int i; struct cpuid id =3D cpuid(10); =20 setup_vm(); @@ -385,6 +387,11 @@ int main(int ac, char **av) ebx.full =3D id.b; edx.full =3D id.d; =20 + /* XXX: horrible command line parsing */ + for (i =3D 1; i < ac; i++) + if (!strcmp(av[i], "host_nmi_watchdog=3D1")) + host_nmi_watchdog =3D 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 =3D msr.flat =20 [pmu] file =3D pmu.flat -extra_params =3D -cpu host -check =3D /proc/sys/kernel/nmi_watchdog=3D0 +extra_params =3D -cpu host -append "host_nmi_watchdog=3D`cat /proc/sys= /kernel/nmi_watchdog`" =20 [port80] file =3D port80.flat --=20 2.6.4