From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device Date: Wed, 20 Oct 2010 19:11:39 +0200 Message-ID: <20101020171139.GA24188@redhat.com> References: <1287563192-29685-1-git-send-email-sheng@linux.intel.com> <4CBEBB85.4000706@redhat.com> <20101020104447.GD12878@redhat.com> <1287586034.3007.12.camel@x201> <4CBF0985.408@redhat.com> <1287589134.3007.45.camel@x201> <4CBF10AC.30309@redhat.com> <20101020155944.GA23185@redhat.com> <4CBF1541.703@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Alex Williamson , Sheng Yang , Marcelo Tosatti , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:25982 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752866Ab0JTRSL (ORCPT ); Wed, 20 Oct 2010 13:18:11 -0400 Content-Disposition: inline In-Reply-To: <4CBF1541.703@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Oct 20, 2010 at 06:13:53PM +0200, Avi Kivity wrote: > On 10/20/2010 05:59 PM, Michael S. Tsirkin wrote: > >> > >> One ugly way is to use two eventfds, one counting mask events, one > >> counting unmask events. The difference is the value if the masked > >> bit. > >> > >> Another option is to use > >> http://permalink.gmane.org/gmane.linux.kernel.commits.head/188038 > >> which allows kvm to maintain a counter using eventfd. The vfio > >> state machine then looks like: > >> > >> interrupt: > >> if counter == 0 mask interrupts, set pending bit, wait for counter > >> to become 1 > >> if counter == 1 forward it > >> counter becomes 1: unmask, forward interrupt if pending > > > >One issue is that this page has a ton of other info. > >KVM would have to keep all that in kernel... > > Or we'd make kvm an "accelerator" and pass through other accesses to > userspace. I don't like it because it's a blurry programming model. Not sure I understand. > At the very least it has to be documented very well. > > -- > I have a truly marvellous patch that fixes the bug which this > signature is too narrow to contain.