From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [RFC PATCH] kvm: Extend irqfd to support level interrupts Date: Mon, 18 Jun 2012 17:33:34 +0300 Message-ID: <4FDF3C3E.30000@redhat.com> References: <20120616163230.15204.61075.stgit@bling.home> <4FDEE0A3.80900@redhat.com> <4FDEEC52.8080806@siemens.com> <4FDEF5CD.8090806@redhat.com> <20120618101156.GB23134@redhat.com> <4FDEFF75.6060104@redhat.com> <1340029671.24037.218.camel@bling.home> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: "Michael S. Tsirkin" , Jan Kiszka , "mtosatti@redhat.com" , "kvm@vger.kernel.org" To: Alex Williamson Return-path: Received: from mx1.redhat.com ([209.132.183.28]:52111 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750792Ab2FROdj (ORCPT ); Mon, 18 Jun 2012 10:33:39 -0400 In-Reply-To: <1340029671.24037.218.camel@bling.home> Sender: kvm-owner@vger.kernel.org List-ID: On 06/18/2012 05:27 PM, Alex Williamson wrote: > On Mon, 2012-06-18 at 13:14 +0300, Avi Kivity wrote: >> On 06/18/2012 01:11 PM, Michael S. Tsirkin wrote: >> >> >> (vhost, >> >> msi-less ivshmem clone)? >> > >> > I guess vhost can poll eventfd and reinject an interrupt. >> > Of course to bypass qemu completely we also need to support reads over >> > ioeventfd somehow. >> > >> >> eventfd is not suitable for level triggered interrupts as far as I can >> tell. It's about passing edges, and level interrupts aren't. We need >> something like a pipe for communicating state (or just use KVM_IRQ_LINE). > > Isn't level just two edges with a state in between? Sure we may be > unnecessarily de-asserting for brief periods, but for an external > assigned device, we don't know whether it's unnecessary. Thanks, For an assigned device you have someone maintaining the state and keep pushing you edges as long as it's up. So it's okay for you to keep deasserting the interrupt as the device will fix it up for you. For an emulated device, you don't, so it isn't. btw, technically we're in the wrong here. An interrupt handler may read the irr and see an incorrect value. Of course no one does that so we can get away with it. -- error compiling committee.c: too many arguments to function