From: Alex Williamson <alex.williamson@redhat.com>
To: Gavin Shan <shangw@linux.vnet.ibm.com>
Cc: aik@ozlabs.ru, linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org
Subject: Re: [PATCH 2/3] VFIO: VFIO_DEVICE_SET_ADDR_MAPPING command
Date: Fri, 15 Mar 2013 13:29:00 -0600 [thread overview]
Message-ID: <1363375740.16793.12.camel@ul30vt.home> (raw)
In-Reply-To: <1363332390-12754-3-git-send-email-shangw@linux.vnet.ibm.com>
On Fri, 2013-03-15 at 15:26 +0800, Gavin Shan wrote:
> The address (domain/bus/slot/function) of the passed PCI device
> looks quite different from perspective of host and guest. Some
> architectures like PPC need to setup the mapping in host. The patch
> introduces additional VFIO device IOCTL command to address that.
Could you explain further how this will be used? How the device is
exposed to a guest is entirely a userspace construct, so why does vfio
need to know or care about this? I had assumed for AER that QEMU would
do the translation from host to guest address space.
> Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
> ---
> include/uapi/linux/vfio.h | 16 ++++++++++++++++
> 1 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
> index 6e58d9b..ecc4f38 100644
> --- a/include/uapi/linux/vfio.h
> +++ b/include/uapi/linux/vfio.h
> @@ -289,6 +289,22 @@ struct vfio_irq_set {
> */
> #define VFIO_DEVICE_RESET _IO(VFIO_TYPE, VFIO_BASE + 11)
>
> +/**
> + * VFIO_DEVICE_SET_ADDR_MAPPING - _IO(VFIO_TYPE, VFIO_BASE + 12)
> + *
> + * The address, which comprised of domain/bus/slot/function looks
> + * different between host and guest. We need to setup the mapping
> + * in host for some architectures like PPC so that the passed PCI
> + * devices could support RTAS smoothly.
> + */
> +struct vfio_addr_mapping {
> + __u64 buid;
What's a buid? Thanks,
Alex
> + __u8 bus;
> + __u8 slot;
> + __u8 func;
> +};
> +#define VFIO_DEVICE_SET_ADDR_MAPPING _IO(VFIO_TYPE, VFIO_BASE + 12)
> +
> /*
> * The VFIO-PCI bus driver makes use of the following fixed region and
> * IRQ index mapping. Unimplemented regions return a size of zero.
next prev parent reply other threads:[~2013-03-15 19:30 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-15 7:26 [PATCH 0/3] VFIO change for EEH support Gavin Shan
2013-03-15 7:26 ` [PATCH 1/3] VFIO: Architecture dependent VFIO device operations Gavin Shan
2013-03-15 7:26 ` [PATCH 2/3] VFIO: VFIO_DEVICE_SET_ADDR_MAPPING command Gavin Shan
2013-03-15 19:29 ` Alex Williamson [this message]
2013-03-16 1:34 ` Gavin Shan
2013-03-16 5:37 ` Benjamin Herrenschmidt
2013-03-18 21:01 ` Alex Williamson
2013-03-19 3:24 ` Gavin Shan
2013-03-19 4:18 ` Alex Williamson
2013-03-19 4:45 ` Benjamin Herrenschmidt
2013-03-20 18:48 ` Alex Williamson
2013-03-20 19:31 ` Benjamin Herrenschmidt
2013-03-20 19:46 ` Alex Williamson
2013-03-21 2:09 ` Gavin Shan
2013-03-15 7:26 ` [PATCH 3/3] VFIO: Direct access config reg without capability Gavin Shan
2013-03-15 19:41 ` Alex Williamson
2013-03-16 3:34 ` Gavin Shan
2013-03-16 5:30 ` Benjamin Herrenschmidt
2013-03-18 21:15 ` Alex Williamson
2013-03-21 0:58 ` 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=1363375740.16793.12.camel@ul30vt.home \
--to=alex.williamson@redhat.com \
--cc=aik@ozlabs.ru \
--cc=kvm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=shangw@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).