public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
To: Alex Williamson
	<alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Wood Scott-B07421
	<B07421-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
	"kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"qemu-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org"
	<qemu-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org>,
	"agraf-l3A5Bk7waGM@public.gmane.org"
	<agraf-l3A5Bk7waGM@public.gmane.org>,
	Yoder Stuart-B08248
	<B08248-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
	"iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org"
	<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	Bhushan Bharat-R65777
	<R65777-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Subject: Re: RFC: vfio API changes needed for powerpc
Date: Tue, 2 Apr 2013 17:50:35 -0500	[thread overview]
Message-ID: <1364943035.24520.28@snotra> (raw)
In-Reply-To: <1364938725.2882.184.camel-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org> (from alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org on Tue Apr  2 16:38:45 2013)

On 04/02/2013 04:38:45 PM, Alex Williamson wrote:
> On Tue, 2013-04-02 at 16:08 -0500, Stuart Yoder wrote:
> > On Tue, Apr 2, 2013 at 3:57 PM, Scott Wood  
> <scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.org> wrote:
> > >> >    C.  Explicit mapping using normal DMA map.  The last idea  
> is that
> > >> >        we would introduce a new ioctl to give user-space an fd  
> to
> > >> >        the MSI bank, which could be mmapped.  The flow would be
> > >> >        something like this:
> > >> >           -for each group user space calls new ioctl
> > >> > VFIO_GROUP_GET_MSI_FD
> > >> >           -user space mmaps the fd, getting a vaddr
> > >> >           -user space does a normal DMA map for desired iova
> > >> >        This approach makes everything explicit, but adds a new  
> ioctl
> > >> >        applicable most likely only to the PAMU (type2 iommu).
> > >>
> > >> And the DMA_MAP of that mmap then allows userspace to select the  
> window
> > >> used?  This one seems like a lot of overhead, adding a new  
> ioctl, new
> > >> fd, mmap, special mapping path, etc.
> > >
> > >
> > > There's going to be special stuff no matter what.  This would  
> keep it
> > > separated from the IOMMU map code.
> > >
> > > I'm not sure what you mean by "overhead" here... the runtime  
> overhead of
> > > setting things up is not particularly relevant as long as it's  
> reasonable.
> > > If you mean development and maintenance effort, keeping things  
> well
> > > separated should help.
> >
> > We don't need to change DMA_MAP.  If we can simply add a new "type  
> 2"
> > ioctl that allows user space to set which windows are MSIs, it  
> seems vastly
> > less complex than an ioctl to supply a new fd, mmap of it, etc.
> >
> > So maybe 2 ioctls:
> >     VFIO_IOMMU_GET_MSI_COUNT

Do you mean a count of actual MSIs or a count of MSI banks used by the  
whole VFIO group?

> >     VFIO_IOMMU_MAP_MSI(iova, size)

Not sure how you mean "size" to be used -- for MPIC it would be 4K per  
bank, and you can only map one bank at a time (which bank you're  
mapping should be a parameter, if only so that the kernel doesn't have  
to keep iteration state for you).

> How are MSIs related to devices on PAMU?

PAMU doesn't care about MSIs.  The relation of individual MSIs to a  
device is standard PCI stuff.  Each MSI bank (which is part of the  
MPIC, not PAMU) can hold numerous MSIs.  The VFIO user would want to  
map all MSI banks that are in use by any of the devices in the group.   
Ideally we'd let the VFIO grouping influence the allocation of MSIs.

> On x86 MSI count is very
> device specific, which means it wold be a VFIO_DEVICE_* ioctl  
> (actually
> VFIO_DEVICE_GET_IRQ_INFO does this for us on x86).  The trouble with  
> it
> being a device ioctl is that you need to get the device FD, but the
> IOMMU protection needs to be established before you can get that... so
> there's an ordering problem if you need it from the device before
> configuring the IOMMU.  Thanks,

What do you mean by "IOMMU protection needs to be established"?   
Wouldn't we just start with no mappings in place?

-Scott

  parent reply	other threads:[~2013-04-02 22:50 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-02 17:32 RFC: vfio API changes needed for powerpc Yoder Stuart-B08248
     [not found] ` <9F6FE96B71CF29479FF1CDC8046E15035A0F13-TcFNo7jSaXOLgTCmFNXF2K4g8xLGJsHaLnY5E4hWTkheoWH0uzbU5w@public.gmane.org>
2013-04-02 19:39   ` Scott Wood
2013-04-02 20:38     ` Stuart Yoder
2013-04-02 20:47       ` Scott Wood
2013-04-02 20:58         ` Stuart Yoder
2013-04-02 20:32   ` Alex Williamson
     [not found]     ` <1364934737.2882.149.camel-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>
2013-04-02 20:54       ` Stuart Yoder
     [not found]         ` <CALRxmdBrW5HUpprhWLr9-U8_t5LBuaPEtWP9vQGOAfyOQ0eV9A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-04-02 21:16           ` Alex Williamson
     [not found]             ` <1364937371.2882.166.camel-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>
2013-04-02 22:13               ` Scott Wood
2013-04-03  2:54                 ` Alex Williamson
2013-04-02 20:57       ` Scott Wood
2013-04-02 21:08         ` Stuart Yoder
     [not found]           ` <CALRxmdCe-RMZuhPSviQsQUxWZbxXABOZDsM8ZoNaqrp=xH+TaA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-04-02 21:38             ` Alex Williamson
     [not found]               ` <1364938725.2882.184.camel-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>
2013-04-02 22:50                 ` Scott Wood [this message]
2013-04-03  3:37                   ` Alex Williamson
2013-04-03 19:09                     ` Stuart Yoder
     [not found]                       ` <CALRxmdDHYp1+svjwDrhMc9w2p7H8t87PphEZ1t+97C-EHDR+3g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-04-03 19:18                         ` Scott Wood
2013-04-03 19:43                           ` Stuart Yoder
     [not found]                             ` <CALRxmdAbVFbPUCDV1fHauAeQxDQWDC8SjsQn-Xyn3PbzKhFjmQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-04-03 20:00                               ` Scott Wood
2013-04-03 19:23                         ` Alex Williamson
2013-04-03 19:26                       ` Scott Wood
     [not found]                     ` <1364960240.2882.230.camel-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>
2013-04-03 21:19                       ` Scott Wood
2013-04-03 18:32                   ` Stuart Yoder
2013-04-03 18:39                     ` Scott Wood
2013-04-02 21:55             ` Scott Wood
2013-04-02 21:32         ` Alex Williamson
     [not found]           ` <1364938324.2882.179.camel-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>
2013-04-02 22:44             ` Scott Wood
2013-04-03  3:12               ` Alex Williamson
2013-04-03 18:25                 ` Stuart Yoder
     [not found]                 ` <1364958751.2882.209.camel-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>
2013-04-03 21:25                   ` Scott Wood

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=1364943035.24520.28@snotra \
    --to=scottwood-kzfg59tc24xl57midrcfdg@public.gmane.org \
    --cc=B07421-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=B08248-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=R65777-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=agraf-l3A5Bk7waGM@public.gmane.org \
    --cc=alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=qemu-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox