From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: nmi is broken? Date: Sun, 24 Apr 2011 16:08:03 +0200 Message-ID: <4DB42EC3.3090002@web.de> References: <87sjtbe7fz.fsf@devron.myhome.or.jp> <877hak1t1s.fsf@devron.myhome.or.jp> <4DB3C6D3.9040703@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigA605BF5013688117465EF601" Cc: OGAWA Hirofumi , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from fmmailgate01.web.de ([217.72.192.221]:51602 "EHLO fmmailgate01.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755079Ab1DXOII (ORCPT ); Sun, 24 Apr 2011 10:08:08 -0400 In-Reply-To: <4DB3C6D3.9040703@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA605BF5013688117465EF601 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2011-04-24 08:44, Avi Kivity wrote: > On 04/24/2011 01:50 AM, OGAWA Hirofumi wrote: >> OGAWA Hirofumi writes: >> >> > I noticed recently NMI on guest kernel is not working well.=20 >> host/guest >> > kernel is 2.6.39-rc4, and using vmx. >> > >> > And test code is something like the following: >> > >> > local_irq_disable(); >> > for (i =3D 0; i< 10; i++) { >> > int cpu =3D get_cpu(); >> > printk("%s: nmi %u, lapic %u\n", __FUNCTION__, >> > nmi_count(cpu), irq_stat[cpu].apic_timer_irqs); >> > mdelay(1000); >> > put_cpu(); >> > } >> > >> > the result is both of nmi and lapic are not increased. If I used >> > -no-kvm-irqchip, it works fine (increase nmi only). So, it seems to= be >> > the bug of kvm driver side. >> >> With some debug, the cause seems to be in pit_do_work(). With the >> following patch, NMI watchdog seems to be working correctly (if irq >> disabled for long time, NMI watchdog can detect it). >> >> Is the following patch right? >=20 > This would cause IRQs to be delivered even if the PIT is masked, no? >=20 > Are you in fact using the PIT? Linux prefers the HPET, and in my > experience the -no-hpet option makes NMIs work. BTW, that's another bug of the in-kernel PIT model: It disables the timer in HPET legacy mode even if we are aware of NMI watchdog receivers. Actually, the whole legacy disabling looks a bit strange in the PIT (mode hackery + flag testing...). While this should be fixed/refactored, adding basic perf support to KVM will be the only option long-term as Linux dropped virtual-wire NMI watchdog support some releases ago. Jan --------------enigA605BF5013688117465EF601 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAk20LsYACgkQitSsb3rl5xR1VACfWmk/A3+saNlJbAvCoZcA4TZw UVYAoN94Iwr1k8XV9t+e+Ba+GO0WbA+7 =mPsV -----END PGP SIGNATURE----- --------------enigA605BF5013688117465EF601--