public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tom Lyon <pugs@cisco.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Alex Williamson <alex.williamson@redhat.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	randy.dunlap@oracle.com, arnd@arndb.de, chrisw@sous-sol.org,
	joro@8bytes.org, hjk@linutronix.de, avi@redhat.com,
	gregkh@suse.de, aafabbri@cisco.com, scofeldm@cisco.com
Subject: Re: [PATCH V3] VFIO driver: Non-privileged user level PCI drivers
Date: Tue, 27 Jul 2010 15:13:14 -0700	[thread overview]
Message-ID: <201007271513.15093.pugs@cisco.com> (raw)
In-Reply-To: <20100719100617.GA31417@redhat.com>

[ Sorry for the long hiatus, I've been wrapped up in other issues.]

I think the fundamental issue to resolve is to decide on the model which the 
VFIO driver presents to its users.

Fundamentally, VFIO as part of the OS must protect the system from its users 
and also protect the users from each other.  No disagreement here.

But another fundamental purpose of an OS to to present an abstract model of 
the underlying hardware to its users, so that the users don't have to deal 
with the full complexity of the hardware.

So I think VFIO should present a 'virtual', abstracted PCI device to its users 
whereas Michael has argued for a simpler model of presenting the real PCI
device config registers while preventing writes only to the registers which 
would clearly disrupt the system.

Now, the virtual model *could* look little like the real hardware, and use 
bunches of ioctls for everything it needs, or it could look a lot like PCI and 
use reads and writes of the virtual PCI config registers to trigger its 
actions.  The latter makes things more amenable to those porting drivers from 
other environments.

I realize that to date the VFIO driver has been a  bit of a mish-mash between 
the ioctl and config based techniques; I intend to clean that up.  And, yes, 
the abstract model presented by VFIO will need plenty of documentation.

Since KVM/qemu already has its own notion of a virtual PCI device which it 
presents to the guest OS, we either need to reconcile VFIO and qemu, or 
provide a bypass of the VFIO virtual model.  This could be direct access 
through sysfs, or else an ioctl to VFIO.  Since I have no internals knowledge 
of qemu, I look to others to choose.

Other little things:
1. Yes, I can share some code with sysfs if I can get the right EXPORTs there.
2. I'll add multiple MSI support, but I wish to point out that even though the 
PCI MSI API supports it, none of the architectures do.
3. FLR needs work.  I was foolish enough to assume that FLR wouldn't reset 
BARs; now I know better.
4. I'll get rid of the vfio config_map in sysfs; it was there for debugging.
5. I'm still looking to support hotplug/unplug and power management stuff via 
generic netlink notifications.

  reply	other threads:[~2010-07-27 22:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-16 21:58 [PATCH V3] VFIO driver: Non-privileged user level PCI drivers Tom Lyon
2010-07-17  8:45 ` Piotr Jaroszyński
2010-07-20 20:20   ` Greg KH
2010-07-18  9:39 ` Michael S. Tsirkin
2010-07-19  4:56   ` Alex Williamson
2010-07-19 10:06     ` Michael S. Tsirkin
2010-07-27 22:13       ` Tom Lyon [this message]
2010-07-27 23:53         ` Michael S. Tsirkin
2010-07-28 21:14           ` Tom Lyon
2010-07-28 21:46             ` Michael S. Tsirkin
2010-07-28 21:57             ` Alex Williamson
2010-07-28 21:57               ` Michael S. Tsirkin
2010-07-28 22:13                 ` Alex Williamson
2010-07-29 14:27                   ` Michael S. Tsirkin
2010-07-30 20:42                     ` Alex Williamson

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=201007271513.15093.pugs@cisco.com \
    --to=pugs@cisco.com \
    --cc=aafabbri@cisco.com \
    --cc=alex.williamson@redhat.com \
    --cc=arnd@arndb.de \
    --cc=avi@redhat.com \
    --cc=chrisw@sous-sol.org \
    --cc=gregkh@suse.de \
    --cc=hjk@linutronix.de \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=randy.dunlap@oracle.com \
    --cc=scofeldm@cisco.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox