From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/1 V5] kernel/kvm: introduce KVM_SET_LINT1 and fix improper nmi emulation Date: Mon, 17 Oct 2011 11:49:52 +0200 Message-ID: <4E9BFA40.5070806@redhat.com> 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> <4E928B54.1070707@cn.fujitsu.com> <4E92958E.9000509@web.de> <4E9476E2.1070804@cn.fujitsu.com> <4E948842.4030406@web.de> <4E978827.6070008@cn.fujitsu.com> <4E97CE42.9020102@web.de> <4E97D85C.7070107@cn.fujitsu.com> <4E97DB62.9020605@web.de> <4E97FAC7.6080007@cn.fujitsu.com> <4E9A A657.1050503@redhat.com> <4E9BF821.2070805@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Jan Kiszka , Kenji Kaneshige , KAMEZAWA Hiroyuki , "qemu-devel@nongnu.org" , "kvm@vger.kernel.org" To: Lai Jiangshan Return-path: Received: from mx1.redhat.com ([209.132.183.28]:1025 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752509Ab1JQJuD (ORCPT ); Mon, 17 Oct 2011 05:50:03 -0400 In-Reply-To: <4E9BF821.2070805@cn.fujitsu.com> Sender: kvm-owner@vger.kernel.org List-ID: On 10/17/2011 11:40 AM, Lai Jiangshan wrote: > >> > > > > LINT1 may have been programmed as a level -triggered interrupt instead > > of edge triggered (NMI or interrupt). We can use the ioctl argument for > > the level (and pressing the NMI button needs to pulse the level to 1 and > > back to 0). > > > > Hi, Avi, Jan, > > Which approach you prefer to? > I need to know the result before wasting too much time to respin > the approach. Yes, sorry about the slow and sometimes conflicting feedback. > 1) Fix KVM_NMI emulation approach (which is v3 patchset) > - It directly fixes the problem and matches the > real hard ware more, but it changes KVM_NMI bahavior. > - Require both kernel-site and userspace-site fix. > > 2) Get the LAPIC state from kernel irqchip, and inject NMI if it is allowed > (which is v4 patchset) > - Simple, don't changes any kernel behavior. > - Only need the userspace-site fix > > 3) Add KVM_SET_LINT1 approach (which is v5 patchset) > - don't changes the kernel's KVM_NMI behavior. > - much complex > - Require both kernel-site and userspace-site fix. > - userspace-site should also handle the !KVM_SET_LINT1 > condition, it uses all the 2) approach' code. it means > this approach equals the 2) approach + KVM_SET_LINT1 ioctl. > > This is an urgent bug of us, we need to settle it down soo While (1) is simple, it overloads a single ioctl with two meanings, that's not so good. Whether we do (1) or (3), we need (2) as well, for older kernels. So I recommend first focusing on (2) and merging it, then doing (3). (note an additional issue with 3 is whether to make it a vm or vcpu ioctl - we've been assuming vcpu ioctl but it's not necessarily the best choice). -- error compiling committee.c: too many arguments to function