From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [RFC PATCH 4/5] APIC/IOAPIC EOI callback Date: Sun, 11 Jul 2010 21:54:56 +0300 Message-ID: <20100711185456.GA11048@redhat.com> References: <20100711180910.20121.93313.stgit@localhost6.localdomain6> <20100711180936.20121.35376.stgit@localhost6.localdomain6> <4C3A09F3.8010304@redhat.com> <1278872784.20397.18.camel@x201> <4C3A0DE3.8010806@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Alex Williamson , kvm@vger.kernel.org, qemu-devel@nongnu.org, pugs@cisco.com, chrisw@redhat.com To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:51825 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754323Ab0GKTAR (ORCPT ); Sun, 11 Jul 2010 15:00:17 -0400 Content-Disposition: inline In-Reply-To: <4C3A0DE3.8010806@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Jul 11, 2010 at 09:30:59PM +0300, Avi Kivity wrote: > On 07/11/2010 09:26 PM, Alex Williamson wrote: > >On Sun, 2010-07-11 at 21:14 +0300, Avi Kivity wrote: > >>On 07/11/2010 09:09 PM, Alex Williamson wrote: > >>>For device assignment, we need to know when the VM writes an end > >>>of interrupt to the APIC, which allows us to de-assert the interrupt > >>>line and clear the DisINTx bit. Add a new wrapper for ioapic > >>>generated interrupts with a callback on eoi and create an interface > >>>for drivers to be notified on eoi. > >>> > >>You aren't going to get this with kvm's in-kernel irqchip, so we need a > >>new interface there. > >Registering an eventfd for the eoi seems like a reasonable alternative. > > I'm worried about that racing (with what?) With device asserting the interrupt? Need to make sure that all possible scenarious work well: device asserts interrupt driver clears interrupt device asserts interrupt eoi device asserts interrupt driver clears interrupt eoi device asserts interrupt etc Not that I see issues, these are things we need to check. > >I also need to figure out how to avoid bouncing the vfio interrupt > >events through qemu, but it's a functional start. Thanks, > > I thought the scheduler has/wants to have something that moves the > irq to whatever thread it wakes up. With irqfd, it would flow > naturally. > > -- > I have a truly marvellous patch that fixes the bug which this > signature is too narrow to contain.