From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCHv0 dont apply] RFC: kvm eoi PV using shared memory Date: Tue, 10 Apr 2012 20:06:59 +0300 Message-ID: <20120410170658.GA21805@redhat.com> References: <20120410132756.GA14101@redhat.com> <4F843DAA.1000808@redhat.com> <20120410142616.GB19556@redhat.com> <4F8444AE.4020504@redhat.com> <20120410145351.GE19556@redhat.com> <4F844B23.3050506@redhat.com> <20120410151441.GA20259@redhat.com> <4F845AFA.2010709@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:10393 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753147Ab2DJRGq (ORCPT ); Tue, 10 Apr 2012 13:06:46 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3AH6jBu025754 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 10 Apr 2012 13:06:45 -0400 Content-Disposition: inline In-Reply-To: <4F845AFA.2010709@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Apr 10, 2012 at 07:08:26PM +0300, Avi Kivity wrote: > On 04/10/2012 06:14 PM, Michael S. Tsirkin wrote: > > On Tue, Apr 10, 2012 at 06:00:51PM +0300, Avi Kivity wrote: > > > On 04/10/2012 05:53 PM, Michael S. Tsirkin wrote: > > > > > > > > > > > > Yes. But we can and it's easier than figuring out priorities. > > > > > > I am guessing such collisions are rare, right? > > > > > > > > > > It's pretty easy, if there is something in IRR but > > > > > kvm_lapic_has_interrupt() returns -1, then we need to disable eoi avoidance. > > > > > > > > I only see kvm_apic_has_interrupt - is this what you mean? > > > > > > Yes, sorry. > > > > > > It's not clear whether to do the check in kvm_apic_has_interrupt() or > > > kvm_apic_get_interrupt() - the latter is called only after interrupts > > > are enabled, so it looks like a better place (EOIs while interrupts are > > > disabled have no effect). But need to make sure those functions are > > > actually called, since they're protected by KVM_REQ_EVENT. > > > > Sorry not sure what you mean by "make sure" - read the code carefully? > > Yes. And I mean, get called at the right time. OK, Review will help here. > > > > > > Better to keep everything per-cpu. The code is in virt/kvm/ioapic.c > > > > Hmm. Disabling for level handles the ack notifiers > > issue as well, which I forgot about. > > It's a tough call. You think looking at > > TMR in kvm_get_apic_interrupt is safe? > > Yes, it's read only from the guest point of view IIRC. > > > > > > > > > > Why do we care about > > > > > level-triggered interrupts? Everything uses MSI or edge-triggered > > > > > IOAPIC interrupts these days. > > > > > > > > Well lots of emulated devices don't yet. > > > > They probably should but it's nice to be able to > > > > test with e.g. e1000 emulation not just virtio. > > > > > > > > > e1000 doesn't support msi? > > > > qemu emulation doesn't. > > > > Can be changed if someone's really interested. But really, avoiding > EOIs for e1000 won't help it much. It will help test EOI avoidance. > -- > error compiling committee.c: too many arguments to function