From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH v3 4/9] x86/pmu: expect failure with nmi_watchdog Date: Tue, 19 Apr 2016 13:57:13 +0200 Message-ID: <20160419115712.GC11472@potion.brq.redhat.com> References: <1460753571-20732-1-git-send-email-rkrcmar@redhat.com> <1460753571-20732-5-git-send-email-rkrcmar@redhat.com> <20160419064422.grxi36r2nmgmns7g@hawk.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, Paolo Bonzini To: Andrew Jones Return-path: Received: from mx1.redhat.com ([209.132.183.28]:40299 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752007AbcDSL5Q (ORCPT ); Tue, 19 Apr 2016 07:57:16 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1308F62644 for ; Tue, 19 Apr 2016 11:57:16 +0000 (UTC) Content-Disposition: inline In-Reply-To: <20160419064422.grxi36r2nmgmns7g@hawk.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: 2016-04-19 08:44+0200, Andrew Jones: > On Fri, Apr 15, 2016 at 10:52:46PM +0200, Radim Kr=C4=8Dm=C3=A1=C5=99= wrote: > > Host's nmi_watchdog takes one slot, making the "all counters" unit-= test > > fail. We know exactly what happens, mark it as expected failure. > >=20 > > PMU test is now executed regardless of host_nmi_watchdog. > >=20 > > Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 > > --- > > x86/pmu.c | 9 ++++++++- > > x86/unittests.cfg | 3 +-- > > 2 files changed, 9 insertions(+), 3 deletions(-) > >=20 > > 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++) >=20 > This should be i =3D 0. Yes, I know, that's a crappy inconsistency we > have. I have somewhere low on the todo an item to try and find a way > for argv[0] to be the testname, but it's probably not worth it... > Hmm, an easy good 'nuff solution might be to always have argv[0] be > "TEST" or some such though. argv[0] is the test name for me ... if I modify the loop to print them all, then % /x86-run x86/pmu.flat -append "a b c" 0: x86/pmu.flat 1: a 2: b 3: c >> + if (!strcmp(av[i], "host_nmi_watchdog=3D1")) >> + host_nmi_watchdog =3D true; >=20 > You could use lib/util's parse_keyval here instead. Wow, so it didn't have to be horrible ...