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: Thu, 21 Oct 2010 00:06:52 +0200 Message-ID: <20101020220652.GC27220@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> <20101020144644.GB22204@redhat.com> <1287587232.3007.26.camel@x201> <20101020151334.GD22204@redhat.com> <1287605581.3007.59.camel@x201> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , Sheng Yang , Marcelo Tosatti , kvm@vger.kernel.org To: Alex Williamson Return-path: Received: from mx1.redhat.com ([209.132.183.28]:13184 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755048Ab0JTWNX (ORCPT ); Wed, 20 Oct 2010 18:13:23 -0400 Content-Disposition: inline In-Reply-To: <1287605581.3007.59.camel@x201> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Oct 20, 2010 at 02:13:01PM -0600, Alex Williamson wrote: > On Wed, 2010-10-20 at 17:13 +0200, Michael S. Tsirkin wrote: > > On Wed, Oct 20, 2010 at 09:07:12AM -0600, Alex Williamson wrote: > > > On Wed, 2010-10-20 at 16:46 +0200, Michael S. Tsirkin wrote: > > > > On Wed, Oct 20, 2010 at 08:47:14AM -0600, Alex Williamson wrote: > > > > > It would probably make sense to request a mask/unmask ioctl in VFIO for > > > > > MSI-X, then perhaps the pending bits would only support read/write (no > > > > > mmap), so we could avoid an ioctl there. > > > > > > > > Why not mask/unmask with a write? > > > > > > That would be possible too, only trouble is then we have QEMU > > > intercepting and interpreting the write as well as VFIO intercepting and > > > interpreting the write. > > > If VFIO is only masking off the mask bit, > > > that'd be pretty trivial though. > > > > I just mean write() instead of an ioctl() > > Hmm, looking back through my vfio driver, I actually have some code that > passes guest writes of the vector control field down to vfio. With > interrupt remapping support, vfio should pass these to the device > masking the interrupt at the source so we don't even need pending bit > emulation. No, that would conflict with kernel using mask bits. If we do this this direct access is very wrong, we must use kernel APIs for this. > Then we just need to make sure we only filter out the vector > table for read/write of the page it lives on so we can support the PBA > being on the same page. > > Alex > >