From: "Michael S. Tsirkin" <mst@redhat.com>
To: Chris Wright <chrisw@redhat.com>
Cc: anthony@codemonkey.ws, avi@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCHv3 RFC] uio: add generic driver for PCI 2.3 devices
Date: Wed, 15 Jul 2009 08:00:23 +0300 [thread overview]
Message-ID: <20090715050023.GA14749@redhat.com> (raw)
In-Reply-To: <20090714232507.GM25507@x200.localdomain>
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
next prev parent reply other threads:[~2009-07-15 5:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-13 16:16 [PATCHv3 RFC] uio: add generic driver for PCI 2.3 devices Michael S. Tsirkin
2009-07-14 18:03 ` Chris Wright
2009-07-14 18:48 ` Michael S. Tsirkin
2009-07-14 23:25 ` Chris Wright
2009-07-15 5:00 ` Michael S. Tsirkin [this message]
2009-07-15 19:29 ` Chris Wright
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090715050023.GA14749@redhat.com \
--to=mst@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=avi@redhat.com \
--cc=chrisw@redhat.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.