From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH 1/1 V3] kernel/kvm: fix improper nmi emulation Date: Sun, 16 Oct 2011 11:05:19 +0200 Message-ID: <4E9A9E4F.6070305@web.de> References: <20110913093835.GB4265@localhost.localdomain> <20110914093441.e2bb305c.kamezawa.hiroyu@jp.fujitsu.com> <4E705BC3.5000508@cn.fujitsu.com> <20110915164704.9cacd407.kamezawa.hiroyu@jp.fujitsu.com> <4E71B28F.7030201@cn.fujitsu.com> <4E72F3BA.2000603@jp.fujitsu.com> <4E73200A.7040908@jp.fujitsu.com> <4E76C6AA.9080403@cn.fujitsu.com> <4E7B04DC.1030407@cn.fujitsu.com> <4E7B4B8F.507@siemens.com> <4E7C51E4.2000503@cn.fujitsu.com> <4E7F3585.40108@redhat.com> <4E7F635E.6080009@web.de> <4E8035F9.9080908@redhat.com> <4E928B4E.2080207@cn.fujitsu.com> <4E92C86D.9000701@redhat.com> <4E947628.6020105@cn.fujitsu.com> <4E94858C.7060307@web.de> <4E978857.1080106@cn.fujitsu.com> <4E9A9BB5.60008@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig2F2F68907E0AFBAB91B0C4E7" Cc: Lai Jiangshan , Kenji Kaneshige , KAMEZAWA Hiroyuki , "kvm@vger.kernel.org" , "qemu-devel@nongnu.org" To: Avi Kivity Return-path: Received: from fmmailgate01.web.de ([217.72.192.221]:45136 "EHLO fmmailgate01.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753112Ab1JPJIw (ORCPT ); Sun, 16 Oct 2011 05:08:52 -0400 Received: from moweb002.kundenserver.de (moweb002.kundenserver.de [172.19.20.108]) by fmmailgate01.web.de (Postfix) with ESMTP id B31D019CED8F9 for ; Sun, 16 Oct 2011 11:05:25 +0200 (CEST) In-Reply-To: <4E9A9BB5.60008@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig2F2F68907E0AFBAB91B0C4E7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2011-10-16 10:54, Avi Kivity wrote: > On 10/14/2011 02:54 AM, Lai Jiangshan wrote: >> From: Kenji Kaneshige >> >> Currently, NMI interrupt is blindly sent to all the vCPUs when NMI >> button event happens. This doesn't properly emulate real hardware on >> which NMI button event triggers LINT1. Because of this, NMI is sent to= >> the processor even when LINT1 is maskied in LVT. For example, this >> causes the problem that kdump initiated by NMI sometimes doesn't work >> on KVM, because kdump assumes NMI is masked on CPUs other than CPU0. >> >> With this patch, KVM_NMI ioctl is handled as follows. >> >> - When in-kernel irqchip is enabled, KVM_NMI ioctl is handled as a >> request of triggering LINT1 on the processor. LINT1 is emulated in >> in-kernel irqchip. >> >> - When in-kernel irqchip is disabled, KVM_NMI ioctl is handled as a >> request of injecting NMI to the processor. This assumes LINT1 is >> already emulated in userland. >> >> (laijs) Add KVM_NMI API document >> >> Signed-off-by: Kenji Kaneshige >> Tested-by: Lai Jiangshan >> >=20 > Patch looks good, but please add your own sign-off (it needs to be adde= d > even if you just forward the patch, and even more if you modify it). >=20 + KVM_CAP_LAPIC_NMI + documentation of KVM_CAP_LAPIC_NMI vs. !KVM_CAP_LAPIC_NMI So you prefer this approach over V5 / KVM_SET_LINT1? Just to make sure we are all looking at the full picture. Jan --------------enig2F2F68907E0AFBAB91B0C4E7 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.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk6anlIACgkQitSsb3rl5xTj0QCfXEP0xXXU3iXoR+dP1fwsOMXl asMAoNWy/pdxiWfwfDPomsZRP80LbY+m =RR9E -----END PGP SIGNATURE----- --------------enig2F2F68907E0AFBAB91B0C4E7-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFMiF-00064o-7h for qemu-devel@nongnu.org; Sun, 16 Oct 2011 05:08:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RFMiD-00041Q-Mq for qemu-devel@nongnu.org; Sun, 16 Oct 2011 05:08:55 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:45094) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFMiD-00041I-4v for qemu-devel@nongnu.org; Sun, 16 Oct 2011 05:08:53 -0400 Received: from moweb002.kundenserver.de (moweb002.kundenserver.de [172.19.20.108]) by fmmailgate01.web.de (Postfix) with ESMTP id A453F19CED8F4 for ; Sun, 16 Oct 2011 11:05:25 +0200 (CEST) Message-ID: <4E9A9E4F.6070305@web.de> Date: Sun, 16 Oct 2011 11:05:19 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <20110913093835.GB4265@localhost.localdomain> <20110914093441.e2bb305c.kamezawa.hiroyu@jp.fujitsu.com> <4E705BC3.5000508@cn.fujitsu.com> <20110915164704.9cacd407.kamezawa.hiroyu@jp.fujitsu.com> <4E71B28F.7030201@cn.fujitsu.com> <4E72F3BA.2000603@jp.fujitsu.com> <4E73200A.7040908@jp.fujitsu.com> <4E76C6AA.9080403@cn.fujitsu.com> <4E7B04DC.1030407@cn.fujitsu.com> <4E7B4B8F.507@siemens.com> <4E7C51E4.2000503@cn.fujitsu.com> <4E7F3585.40108@redhat.com> <4E7F635E.6080009@web.de> <4E8035F9.9080908@redhat.com> <4E928B4E.2080207@cn.fujitsu.com> <4E92C86D.9000701@redhat.com> <4E947628.6020105@cn.fujitsu.com> <4E94858C.7060307@web.de> <4E978857.1080106@cn.fujitsu.com> <4E9A9BB5.60008@redhat.com> In-Reply-To: <4E9A9BB5.60008@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig2F2F68907E0AFBAB91B0C4E7" Subject: Re: [Qemu-devel] [PATCH 1/1 V3] kernel/kvm: fix improper nmi emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: "qemu-devel@nongnu.org" , "kvm@vger.kernel.org" , Lai Jiangshan , KAMEZAWA Hiroyuki , Kenji Kaneshige This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig2F2F68907E0AFBAB91B0C4E7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2011-10-16 10:54, Avi Kivity wrote: > On 10/14/2011 02:54 AM, Lai Jiangshan wrote: >> From: Kenji Kaneshige >> >> Currently, NMI interrupt is blindly sent to all the vCPUs when NMI >> button event happens. This doesn't properly emulate real hardware on >> which NMI button event triggers LINT1. Because of this, NMI is sent to= >> the processor even when LINT1 is maskied in LVT. For example, this >> causes the problem that kdump initiated by NMI sometimes doesn't work >> on KVM, because kdump assumes NMI is masked on CPUs other than CPU0. >> >> With this patch, KVM_NMI ioctl is handled as follows. >> >> - When in-kernel irqchip is enabled, KVM_NMI ioctl is handled as a >> request of triggering LINT1 on the processor. LINT1 is emulated in >> in-kernel irqchip. >> >> - When in-kernel irqchip is disabled, KVM_NMI ioctl is handled as a >> request of injecting NMI to the processor. This assumes LINT1 is >> already emulated in userland. >> >> (laijs) Add KVM_NMI API document >> >> Signed-off-by: Kenji Kaneshige >> Tested-by: Lai Jiangshan >> >=20 > Patch looks good, but please add your own sign-off (it needs to be adde= d > even if you just forward the patch, and even more if you modify it). >=20 + KVM_CAP_LAPIC_NMI + documentation of KVM_CAP_LAPIC_NMI vs. !KVM_CAP_LAPIC_NMI So you prefer this approach over V5 / KVM_SET_LINT1? Just to make sure we are all looking at the full picture. Jan --------------enig2F2F68907E0AFBAB91B0C4E7 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.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk6anlIACgkQitSsb3rl5xTj0QCfXEP0xXXU3iXoR+dP1fwsOMXl asMAoNWy/pdxiWfwfDPomsZRP80LbY+m =RR9E -----END PGP SIGNATURE----- --------------enig2F2F68907E0AFBAB91B0C4E7--