All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <dwg@au1.ibm.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	chrisw@sous-sol.org, aik@au1.ibm.com, pmac@au1.ibm.com,
	joerg.roedel@amd.com, agraf@suse.de, benve@cisco.com,
	aafabbri@cisco.com, B08248@freescale.com, B07421@freescale.com,
	avi@redhat.com, kvm@vger.kernel.org, qemu-devel@nongnu.org,
	iommu@lists.linux-foundation.org, linux-pci@vger.kernel.org
Subject: Re: [RFC PATCH] vfio: VFIO Driver core framework
Date: Tue, 15 Nov 2011 11:00:50 +1100	[thread overview]
Message-ID: <20111115000050.GA4882@truffala.fritz.box> (raw)
In-Reply-To: <1321049456.2682.220.camel@bling.home>

On Fri, Nov 11, 2011 at 03:10:56PM -0700, Alex Williamson wrote:
> Thanks Konrad!  Comments inline.
> On Fri, 2011-11-11 at 12:51 -0500, Konrad Rzeszutek Wilk wrote:
> > On Thu, Nov 03, 2011 at 02:12:24PM -0600, Alex Williamson wrote:
[snip]
> > > +The GET_NUM_REGIONS ioctl tells us how many regions the device supports:
> > > +
> > > +#define VFIO_DEVICE_GET_NUM_REGIONS     _IOR(';', 109, int)
> > 
> > Don't want __u32?
> 
> It could be, not sure if it buys us anything maybe even restricts us.
> We likely don't need 2^32 regions (famous last words?), so we could
> later define <0 to something?

As a rule, it's best to use explicit fixed width types for all ioctl()
arguments, to avoid compat hell for 32-bit userland on 64-bit kernel
setups.

[snip]
> > > +Again, zero count entries are allowed (vfio-pci uses a static interrupt
> > > +type to index mapping).
> > 
> > I am not really sure what that means.
> 
> This is so PCI can expose:
> 
> enum {
>         VFIO_PCI_INTX_IRQ_INDEX,
>         VFIO_PCI_MSI_IRQ_INDEX,
>         VFIO_PCI_MSIX_IRQ_INDEX,
>         VFIO_PCI_NUM_IRQS
> };
> 
> So like regions it always exposes 3 IRQ indexes where count=0 if the
> device doesn't actually support that type of interrupt.  I just want to
> spell out that bus drivers have this kind of flexibility.

I knew what you were aiming for, so I could see what you meant here,
but I don't think the doco is very clearly expressed at all.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson


WARNING: multiple messages have this Message-ID (diff)
From: David Gibson <dwg@au1.ibm.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: aafabbri@cisco.com, aik@au1.ibm.com, kvm@vger.kernel.org,
	pmac@au1.ibm.com, joerg.roedel@amd.com,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	agraf@suse.de, qemu-devel@nongnu.org, chrisw@sous-sol.org,
	B08248@freescale.com, iommu@lists.linux-foundation.org,
	avi@redhat.com, linux-pci@vger.kernel.org, B07421@freescale.com,
	benve@cisco.com
Subject: Re: [Qemu-devel] [RFC PATCH] vfio: VFIO Driver core framework
Date: Tue, 15 Nov 2011 11:00:50 +1100	[thread overview]
Message-ID: <20111115000050.GA4882@truffala.fritz.box> (raw)
In-Reply-To: <1321049456.2682.220.camel@bling.home>

On Fri, Nov 11, 2011 at 03:10:56PM -0700, Alex Williamson wrote:
> Thanks Konrad!  Comments inline.
> On Fri, 2011-11-11 at 12:51 -0500, Konrad Rzeszutek Wilk wrote:
> > On Thu, Nov 03, 2011 at 02:12:24PM -0600, Alex Williamson wrote:
[snip]
> > > +The GET_NUM_REGIONS ioctl tells us how many regions the device supports:
> > > +
> > > +#define VFIO_DEVICE_GET_NUM_REGIONS     _IOR(';', 109, int)
> > 
> > Don't want __u32?
> 
> It could be, not sure if it buys us anything maybe even restricts us.
> We likely don't need 2^32 regions (famous last words?), so we could
> later define <0 to something?

As a rule, it's best to use explicit fixed width types for all ioctl()
arguments, to avoid compat hell for 32-bit userland on 64-bit kernel
setups.

[snip]
> > > +Again, zero count entries are allowed (vfio-pci uses a static interrupt
> > > +type to index mapping).
> > 
> > I am not really sure what that means.
> 
> This is so PCI can expose:
> 
> enum {
>         VFIO_PCI_INTX_IRQ_INDEX,
>         VFIO_PCI_MSI_IRQ_INDEX,
>         VFIO_PCI_MSIX_IRQ_INDEX,
>         VFIO_PCI_NUM_IRQS
> };
> 
> So like regions it always exposes 3 IRQ indexes where count=0 if the
> device doesn't actually support that type of interrupt.  I just want to
> spell out that bus drivers have this kind of flexibility.

I knew what you were aiming for, so I could see what you meant here,
but I don't think the doco is very clearly expressed at all.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

  reply	other threads:[~2011-11-15  0:13 UTC|newest]

Thread overview: 156+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-03 20:12 [RFC PATCH] vfio: VFIO Driver core framework Alex Williamson
2011-11-03 20:12 ` [Qemu-devel] " Alex Williamson
2011-11-09  4:17 ` Aaron Fabbri
2011-11-09  4:17   ` [Qemu-devel] " Aaron Fabbri
2011-11-09  4:41   ` Alex Williamson
2011-11-09  4:41     ` [Qemu-devel] " Alex Williamson
2011-11-09  4:41     ` Alex Williamson
2011-11-09  4:17 ` Aaron Fabbri
2011-11-09  8:11 ` Christian Benvenuti (benve)
2011-11-09  8:11 ` Christian Benvenuti (benve)
2011-11-09  8:11   ` [Qemu-devel] " Christian Benvenuti (benve)
2011-11-09 18:02   ` Alex Williamson
2011-11-09 18:02     ` [Qemu-devel] " Alex Williamson
2011-11-09 21:08     ` Christian Benvenuti (benve)
2011-11-09 21:08       ` [Qemu-devel] " Christian Benvenuti (benve)
2011-11-09 21:08       ` Christian Benvenuti (benve)
2011-11-09 23:40       ` Alex Williamson
2011-11-09 23:40         ` [Qemu-devel] " Alex Williamson
2011-11-10  0:57 ` Christian Benvenuti (benve)
2011-11-10  0:57 ` Christian Benvenuti (benve)
2011-11-10  0:57   ` [Qemu-devel] " Christian Benvenuti (benve)
2011-11-11 18:04   ` Alex Williamson
2011-11-11 18:04     ` [Qemu-devel] " Alex Williamson
2011-11-11 18:04     ` Alex Williamson
2011-11-11 22:22     ` Christian Benvenuti (benve)
2011-11-11 22:22       ` [Qemu-devel] " Christian Benvenuti (benve)
2011-11-11 22:22       ` Christian Benvenuti (benve)
2011-11-14 22:59       ` Alex Williamson
2011-11-14 22:59         ` [Qemu-devel] " Alex Williamson
2011-11-14 22:59         ` Alex Williamson
2011-11-15  0:05         ` David Gibson
2011-11-15  0:05           ` [Qemu-devel] " David Gibson
2011-11-15  0:49           ` Benjamin Herrenschmidt
2011-11-15  0:49             ` [Qemu-devel] " Benjamin Herrenschmidt
2011-11-15  0:49             ` Benjamin Herrenschmidt
2011-11-11 17:51 ` Konrad Rzeszutek Wilk
2011-11-11 17:51   ` [Qemu-devel] " Konrad Rzeszutek Wilk
2011-11-11 17:51   ` Konrad Rzeszutek Wilk
2011-11-11 22:10   ` Alex Williamson
2011-11-11 22:10     ` [Qemu-devel] " Alex Williamson
2011-11-15  0:00     ` David Gibson [this message]
2011-11-15  0:00       ` David Gibson
2011-11-16 16:52     ` Konrad Rzeszutek Wilk
2011-11-16 16:52       ` [Qemu-devel] " Konrad Rzeszutek Wilk
2011-11-16 16:52       ` Konrad Rzeszutek Wilk
2011-11-17 20:22       ` Alex Williamson
2011-11-17 20:22         ` [Qemu-devel] " Alex Williamson
2011-11-17 20:22         ` Alex Williamson
2011-11-17 20:56         ` Scott Wood
2011-11-17 20:56           ` [Qemu-devel] " Scott Wood
2011-11-16 17:47     ` Scott Wood
2011-11-16 17:47       ` [Qemu-devel] " Scott Wood
2011-11-17 20:52       ` Alex Williamson
2011-11-17 20:52         ` [Qemu-devel] " Alex Williamson
2011-11-17 20:52         ` Alex Williamson
2011-11-12  0:14 ` Scott Wood
2011-11-12  0:14   ` [Qemu-devel] " Scott Wood
2011-11-14 20:54   ` Alex Williamson
2011-11-14 20:54     ` [Qemu-devel] " Alex Williamson
2011-11-14 20:54     ` Alex Williamson
2011-11-14 21:46     ` Alex Williamson
2011-11-14 21:46       ` [Qemu-devel] " Alex Williamson
2011-11-14 22:26     ` Scott Wood
2011-11-14 22:26       ` [Qemu-devel] " Scott Wood
2011-11-14 22:48       ` Alexander Graf
2011-11-14 22:48         ` [Qemu-devel] " Alexander Graf
2011-11-15  2:29     ` Alex Williamson
2011-11-15  2:29       ` [Qemu-devel] " Alex Williamson
2011-11-15  2:29       ` Alex Williamson
2011-11-15  6:34 ` David Gibson
2011-11-15  6:34   ` [Qemu-devel] " David Gibson
2011-11-15 18:01   ` Alex Williamson
2011-11-15 18:01     ` [Qemu-devel] " Alex Williamson
2011-11-15 18:01     ` Alex Williamson
2011-11-17  0:02     ` David Gibson
2011-11-17  0:02       ` [Qemu-devel] " David Gibson
2011-11-18 20:32       ` Alex Williamson
2011-11-18 20:32         ` [Qemu-devel] " Alex Williamson
2011-11-18 20:32         ` Alex Williamson
2011-11-18 21:09         ` Scott Wood
2011-11-18 21:09           ` [Qemu-devel] " Scott Wood
2011-11-18 21:09           ` Scott Wood
2011-11-22 19:16           ` [Qemu-devel] " Alex Williamson
2011-11-22 19:16             ` Alex Williamson
2011-11-22 20:00             ` Scott Wood
2011-11-22 20:00               ` Scott Wood
2011-11-22 21:28               ` Alex Williamson
2011-11-22 21:28                 ` Alex Williamson
2011-11-22 21:28                 ` Alex Williamson
2011-11-21  2:47         ` David Gibson
2011-11-21  2:47           ` [Qemu-devel] " David Gibson
2011-11-22 18:22           ` Alex Williamson
2011-11-22 18:22             ` [Qemu-devel] " Alex Williamson
2011-11-22 18:22             ` Alex Williamson
2011-11-15 20:10   ` Scott Wood
2011-11-15 20:10     ` [Qemu-devel] " Scott Wood
2011-11-15 21:40     ` Aaron Fabbri
2011-11-15 21:40       ` [Qemu-devel] " Aaron Fabbri
2011-11-15 21:40       ` Aaron Fabbri
2011-11-15 22:29       ` Scott Wood
2011-11-15 22:29         ` [Qemu-devel] " Scott Wood
2011-11-16 23:34         ` Alex Williamson
2011-11-16 23:34           ` [Qemu-devel] " Alex Williamson
2011-11-16 23:34           ` Alex Williamson
2011-11-15 20:10   ` Scott Wood
2011-11-29  1:52 ` Alexey Kardashevskiy
2011-11-29  1:52   ` [Qemu-devel] " Alexey Kardashevskiy
2011-11-29  2:01   ` Alexey Kardashevskiy
2011-11-29  2:01     ` [Qemu-devel] " Alexey Kardashevskiy
2011-11-29  2:11     ` Alexey Kardashevskiy
2011-11-29  2:11       ` [Qemu-devel] " Alexey Kardashevskiy
2011-11-29  3:54     ` Alex Williamson
2011-11-29  3:54       ` [Qemu-devel] " Alex Williamson
2011-11-29  3:54       ` Alex Williamson
2011-11-29 19:26       ` Alex Williamson
2011-11-29 19:26         ` [Qemu-devel] " Alex Williamson
2011-11-29 23:20         ` Stuart Yoder
2011-11-29 23:20           ` Stuart Yoder
2011-11-29 23:44           ` Alex Williamson
2011-11-29 23:44             ` Alex Williamson
2011-11-29 23:44             ` Alex Williamson
2011-11-30 15:41             ` [Qemu-devel] " Stuart Yoder
2011-11-30 15:41               ` Stuart Yoder
2011-11-30 16:58               ` Alex Williamson
2011-11-30 16:58                 ` Alex Williamson
2011-11-30 16:58                 ` Alex Williamson
2011-12-01 20:58                 ` [Qemu-devel] " Stuart Yoder
2011-12-01 20:58                   ` Stuart Yoder
2011-12-01 21:25                   ` Alex Williamson
2011-12-01 21:25                     ` Alex Williamson
2011-12-01 21:25                     ` Alex Williamson
2011-12-02 14:40                     ` [Qemu-devel] " Stuart Yoder
2011-12-02 14:40                       ` Stuart Yoder
2011-12-02 18:11                       ` Bhushan Bharat-R65777
2011-12-02 18:11                         ` Bhushan Bharat-R65777
2011-12-02 18:27                         ` Scott Wood
2011-12-02 18:27                           ` Scott Wood
2011-12-02 18:35                           ` Bhushan Bharat-R65777
2011-12-02 18:35                             ` Bhushan Bharat-R65777
2011-12-02 18:45                           ` Bhushan Bharat-R65777
2011-12-02 18:45                             ` Bhushan Bharat-R65777
2011-12-02 18:52                             ` Scott Wood
2011-12-02 18:52                               ` Scott Wood
2011-12-02 18:21                       ` Scott Wood
2011-12-02 18:21                         ` Scott Wood
2011-11-29  3:46   ` Alex Williamson
2011-11-29  3:46     ` [Qemu-devel] " Alex Williamson
2011-11-29  3:46     ` Alex Williamson
2011-11-29  4:34     ` Alexey Kardashevskiy
2011-11-29  4:34       ` [Qemu-devel] " Alexey Kardashevskiy
2011-11-29  5:48       ` Alex Williamson
2011-11-29  5:48         ` [Qemu-devel] " Alex Williamson
2011-11-29  5:48         ` Alex Williamson
2011-12-02  5:06         ` Alexey Kardashevskiy
2011-12-02  5:06           ` [Qemu-devel] " Alexey Kardashevskiy
2011-12-02  5:06           ` Alexey Kardashevskiy

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=20111115000050.GA4882@truffala.fritz.box \
    --to=dwg@au1.ibm.com \
    --cc=B07421@freescale.com \
    --cc=B08248@freescale.com \
    --cc=aafabbri@cisco.com \
    --cc=agraf@suse.de \
    --cc=aik@au1.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=avi@redhat.com \
    --cc=benve@cisco.com \
    --cc=chrisw@sous-sol.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joerg.roedel@amd.com \
    --cc=konrad.wilk@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=pmac@au1.ibm.com \
    --cc=qemu-devel@nongnu.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.