From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: Re: [PATCH kvm-unit-tests 3/6] x86/pmu: expect failure with nmi_watchdog Date: Mon, 14 Dec 2015 16:05:50 -0600 Message-ID: <20151214220550.GC3633@hawk.localdomain> References: <1450128261-21170-1-git-send-email-rkrcmar@redhat.com> <1450128261-21170-4-git-send-email-rkrcmar@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, Paolo Bonzini To: Radim =?utf-8?B?S3LEjW3DocWZ?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:42827 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753559AbbLNWF4 (ORCPT ); Mon, 14 Dec 2015 17:05:56 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 1C97B8E222 for ; Mon, 14 Dec 2015 22:05:56 +0000 (UTC) Content-Disposition: inline In-Reply-To: <1450128261-21170-4-git-send-email-rkrcmar@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Dec 14, 2015 at 10:24:18PM +0100, Radim Kr=C4=8Dm=C3=A1=C5=99 w= rote: > Host's nmi_watchdog takes one slot, making the "all counters" unit-te= st > 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..4ca93235b977 100644 > --- a/x86/pmu.c > +++ b/x86/pmu.c > @@ -92,6 +92,7 @@ struct pmu_event { > }; > =20 > static int num_counters; > +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); How about outputting "host_nmi_watchdog=3D%d" as well? > } > =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/s= ys/kernel/nmi_watchdog`" > =20 > [port80] > file =3D port80.flat > --=20 > 2.6.4 >=20 > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html