From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCHv3 RFC] uio: add generic driver for PCI 2.3 devices Date: Wed, 15 Jul 2009 08:00:23 +0300 Message-ID: <20090715050023.GA14749@redhat.com> References: <20090713161606.GA10804@redhat.com> <20090714180338.GH25507@x200.localdomain> <20090714184850.GA16885@redhat.com> <20090714232507.GM25507@x200.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: anthony@codemonkey.ws, avi@redhat.com, kvm@vger.kernel.org To: Chris Wright Return-path: Received: from mx2.redhat.com ([66.187.237.31]:48238 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750781AbZGOFBN (ORCPT ); Wed, 15 Jul 2009 01:01:13 -0400 Content-Disposition: inline In-Reply-To: <20090714232507.GM25507@x200.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Jul 14, 2009 at 04:25:07PM -0700, Chris Wright wrote: > * Michael S. Tsirkin (mst@redhat.com) wrote: > > On Tue, Jul 14, 2009 at 11:03:38AM -0700, Chris Wright wrote: > > > * Michael S. Tsirkin (mst@redhat.com) wrote: > > > > - remove irqcontrol: user can enable interrupts by > > > > writing command register directly > > > > > > Sorry if I gave you the impression that removing was needed. > > > I actually think the irqcontrol was useful since it's atomic. > > > > What I'm saying, it is not strictly needed (user can safely write 0 in > > that register and worst case you just get an extra interrupt). So let's > > make the decision on what does irqcontrol do when we have a pressing > > need for an extra kernel/user interface. > > OK. My concern is theoretical (as in the current design wouldn't > trigger an issue): > > cmd = pread() > ------+ > \ > cmd &= ~INTX_DISABLE +----+ > / | > -------+ | > pwrite(cmd) | > - > During this window Command Reg can change[1] and cmd is stale > > [1] due to irqhandler (doesn't matter in this case since it touches > same bit). or due to some other thread updating Command Reg (also > doesn't matter since this does not happen right now). Right. Note that the limitation that only a single thread should touch config space through sysfs applies to any sub-byte field. If we wanted to make such ops atomic, pci devices would need some kind of compare and swap ioctl. -- MST