All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Yoder Stuart-B08248 <B08248@freescale.com>
Cc: Wood Scott-B07421 <B07421@freescale.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Alexander Graf <agraf@suse.de>,
	Bhushan Bharat-R65777 <R65777@freescale.com>,
	Sethi Varun-B16395 <B16395@freescale.com>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	Antonios Motakis <a.motakis@virtualopensystems.com>,
	"kvm@vger.kernel.org list" <kvm@vger.kernel.org>,
	"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>
Subject: Re: RFC: vfio interface for platform devices
Date: Tue, 16 Jul 2013 22:01:24 +0000	[thread overview]
Message-ID: <1374012084.8183.338@snotra> (raw)
In-Reply-To: <9F6FE96B71CF29479FF1CDC8046E150364E322@039-SN1MPN1-004.039d.mgd.msft.net> (from B08248@freescale.com on Tue Jul 16 16:51:12 2013)

On 07/16/2013 04:51:12 PM, Yoder Stuart-B08248 wrote:
> > > 3.  VFIO_DEVICE_GET_REGION_INFO
> > >
> > >    No changes needed, except perhaps adding a new flag.  Freescale
> > > has some
> > >    devices with regions that must be mapped cacheable.
> >
> > While I don't object to making the information available to the user
> > just in case, the main thing we need here is to influence what the
> > kernel does when the user tries to map it.  At least on PPC it's  
> not up
> > to userspace to select whether a mmap is cacheable.
> 
> If user space really can't do anything with the 'cacheable'
> flag, do you think there is good reason to keep it?   Will it
> help any decision that user space makes?  Maybe we should just
> drop it.

As long as we can be sure all architectures will map things correctly  
without any flags needing to be specified, that's fine.

> > >    struct vfio_path_info {
> > >         __u32   argsz;
> > >         __u32   flags;
> > >    #define VFIO_DEVTREE_INFO_RANGES      (1 << 3) /* the region  
> is a
> > > "ranges" property */
> >
> > What about distinguishing a normal interrupt from one found in an
> > interrupt-map?
> 
> I'm not sure we need that.  The kernel needs to use the interrupt
> map to get interrupts hooked up right, but all user space needs to
> know is that there are N interrupts and possibly device tree
> paths to help user space interpret which interrupt is which.

What if the interrupt map is for devices without explicit nodes, such  
as with a PCI controller (ignore the fact that we would normally use  
vfio_pci for the indivdual PCI devices instead)?

You could say the same thing about ranges -- why expose ranges instead  
of the individual child node regs after translation?

> > In the case of both ranges and interrupt-maps, we'll also want to
> > decide what the policy is for when to expose them directly, versus  
> just
> > using them to translate regs and interrupts of child nodes
> 
> Yes, not sure the best approach there...but guess we can cross
> that bridge when we implement this.  It doesn't affect this
> interface.

It does affect the interface, because if you allow either of them to be  
mapped directly (rather than implicitly used when mapping a child  
node), you need a way to indicate which type of resource it is you're  
describing (as you already do for reg/ranges).

It also affects how vfio device binding is done, even if only to the  
point of specifying default behavior in the absence of knobs which  
change whether interrupt maps and/or ranges are mapped.

> > >         __u8    path[];         /* output: Full path to associated
> > > device tree node */
> >
> > How does the caller know what size buffer to supply for this?

Ping

-Scott

WARNING: multiple messages have this Message-ID (diff)
From: Scott Wood <scottwood@freescale.com>
To: Yoder Stuart-B08248 <B08248@freescale.com>
Cc: Wood Scott-B07421 <B07421@freescale.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Alexander Graf <agraf@suse.de>,
	Bhushan Bharat-R65777 <R65777@freescale.com>,
	Sethi Varun-B16395 <B16395@freescale.com>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	Antonios Motakis <a.motakis@virtualopensystems.com>,
	"kvm@vger.kernel.org list" <kvm@vger.kernel.org>,
	"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>
Subject: Re: RFC: vfio interface for platform devices
Date: Tue, 16 Jul 2013 17:01:24 -0500	[thread overview]
Message-ID: <1374012084.8183.338@snotra> (raw)
In-Reply-To: <9F6FE96B71CF29479FF1CDC8046E150364E322@039-SN1MPN1-004.039d.mgd.msft.net> (from B08248@freescale.com on Tue Jul 16 16:51:12 2013)

On 07/16/2013 04:51:12 PM, Yoder Stuart-B08248 wrote:
> > > 3.  VFIO_DEVICE_GET_REGION_INFO
> > >
> > >    No changes needed, except perhaps adding a new flag.  Freescale
> > > has some
> > >    devices with regions that must be mapped cacheable.
> >
> > While I don't object to making the information available to the user
> > just in case, the main thing we need here is to influence what the
> > kernel does when the user tries to map it.  At least on PPC it's  
> not up
> > to userspace to select whether a mmap is cacheable.
> 
> If user space really can't do anything with the 'cacheable'
> flag, do you think there is good reason to keep it?   Will it
> help any decision that user space makes?  Maybe we should just
> drop it.

As long as we can be sure all architectures will map things correctly  
without any flags needing to be specified, that's fine.

> > >    struct vfio_path_info {
> > >         __u32   argsz;
> > >         __u32   flags;
> > >    #define VFIO_DEVTREE_INFO_RANGES      (1 << 3) /* the region  
> is a
> > > "ranges" property */
> >
> > What about distinguishing a normal interrupt from one found in an
> > interrupt-map?
> 
> I'm not sure we need that.  The kernel needs to use the interrupt
> map to get interrupts hooked up right, but all user space needs to
> know is that there are N interrupts and possibly device tree
> paths to help user space interpret which interrupt is which.

What if the interrupt map is for devices without explicit nodes, such  
as with a PCI controller (ignore the fact that we would normally use  
vfio_pci for the indivdual PCI devices instead)?

You could say the same thing about ranges -- why expose ranges instead  
of the individual child node regs after translation?

> > In the case of both ranges and interrupt-maps, we'll also want to
> > decide what the policy is for when to expose them directly, versus  
> just
> > using them to translate regs and interrupts of child nodes
> 
> Yes, not sure the best approach there...but guess we can cross
> that bridge when we implement this.  It doesn't affect this
> interface.

It does affect the interface, because if you allow either of them to be  
mapped directly (rather than implicitly used when mapping a child  
node), you need a way to indicate which type of resource it is you're  
describing (as you already do for reg/ranges).

It also affects how vfio device binding is done, even if only to the  
point of specifying default behavior in the absence of knobs which  
change whether interrupt maps and/or ranges are mapped.

> > >         __u8    path[];         /* output: Full path to associated
> > > device tree node */
> >
> > How does the caller know what size buffer to supply for this?

Ping

-Scott

  parent reply	other threads:[~2013-07-16 22:01 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-02 23:25 RFC: vfio interface for platform devices Yoder Stuart-B08248
2013-07-02 23:25 ` Yoder Stuart-B08248
2013-07-03  1:07 ` Alexander Graf
2013-07-03  1:07 ` Alexander Graf
2013-07-03  1:07   ` Alexander Graf
2013-07-03 18:51   ` Scott Wood
2013-07-03 18:51   ` Scott Wood
2013-07-03 18:51     ` Scott Wood
2013-07-03 19:08     ` Yoder Stuart-B08248
2013-07-03 19:08       ` Yoder Stuart-B08248
2013-07-03  3:07 ` Alex Williamson
2013-07-03  3:07   ` Alex Williamson
2013-07-03 10:44   ` Antonios Motakis
2013-07-03 10:44     ` Antonios Motakis
2013-07-03 19:23     ` Yoder Stuart-B08248
2013-07-03 19:23     ` Yoder Stuart-B08248
2013-07-03 19:23       ` Yoder Stuart-B08248
2013-07-03 10:44   ` Antonios Motakis
2013-07-03 17:20   ` Yoder Stuart-B08248
2013-07-03 17:20     ` Yoder Stuart-B08248
2013-07-03 21:40 ` RFC: vfio interface for platform devices (v2) Yoder Stuart-B08248
2013-07-03 21:40   ` Yoder Stuart-B08248
2013-07-03 22:53   ` Alex Williamson
2013-07-03 22:53     ` Alex Williamson
2013-07-03 23:06     ` Scott Wood
2013-07-03 23:06     ` Scott Wood
2013-07-03 23:06       ` Scott Wood
2013-07-16 21:57     ` Yoder Stuart-B08248
2013-07-16 21:57       ` Yoder Stuart-B08248
2013-07-16 21:57     ` Yoder Stuart-B08248
2013-07-03 22:53   ` Alex Williamson
2013-07-04 14:44   ` Mario Smarduch
2013-07-04 14:44   ` Mario Smarduch
2013-07-04 14:44     ` Mario Smarduch
2013-07-04 14:47     ` Alexander Graf
2013-07-04 14:47     ` Alexander Graf
2013-07-04 14:47       ` Alexander Graf
2013-07-16 15:25     ` Yoder Stuart-B08248
2013-07-03 22:31 ` RFC: vfio interface for platform devices Scott Wood
2013-07-03 22:31   ` Scott Wood
2013-07-16 21:51   ` Yoder Stuart-B08248
2013-07-16 22:01     ` Scott Wood
2013-07-16 22:01     ` Scott Wood [this message]
2013-07-16 22:01       ` Scott Wood
2013-07-16 22:41       ` Yoder Stuart-B08248
2013-07-16 22:50         ` Scott Wood
2013-07-16 22:50         ` Scott Wood
2013-07-16 22:50           ` Scott Wood
2013-07-16 21:51   ` Yoder Stuart-B08248
2013-07-03 22:31 ` Scott Wood
  -- strict thread matches above, loose matches on Subject: below --
2013-07-02 23:25 Yoder Stuart-B08248

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=1374012084.8183.338@snotra \
    --to=scottwood@freescale.com \
    --cc=B07421@freescale.com \
    --cc=B08248@freescale.com \
    --cc=B16395@freescale.com \
    --cc=R65777@freescale.com \
    --cc=a.motakis@virtualopensystems.com \
    --cc=agraf@suse.de \
    --cc=alex.williamson@redhat.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=virtualization@lists.linux-foundation.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.