From: Neo Jia <cjia@nvidia.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: "Ruan, Shuai" <shuai.ruan@intel.com>,
"Tian, Kevin" <kevin.tian@intel.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"Song, Jike" <jike.song@intel.com>,
Kirti Wankhede <kwankhede@nvidia.com>,
"kraxel@redhat.com" <kraxel@redhat.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"Lv, Zhiyuan" <zhiyuan.lv@intel.com>
Subject: Re: [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU
Date: Fri, 11 Mar 2016 10:18:14 -0800 [thread overview]
Message-ID: <20160311181814.GA21896@nvidia.com> (raw)
In-Reply-To: <20160311105624.3811eac6@t450s.home>
On Fri, Mar 11, 2016 at 10:56:24AM -0700, Alex Williamson wrote:
> On Fri, 11 Mar 2016 08:55:44 -0800
> Neo Jia <cjia@nvidia.com> wrote:
>
> > > > Alex, what's your opinion on this?
> > >
> > > The sticky point is how vfio, which is only handling the vGPU, has a
> > > reference to the physical GPU on which to call DMA API operations. If
> > > that reference is provided by the vendor vGPU driver, for example
> > > vgpu_dma_do_translate_for_pci(gpa, pci_dev), I don't see any reason to
> > > be opposed to such an API. I would not condone vfio deriving or owning
> > > a reference to the physical device on its own though, that's in the
> > > realm of the vendor vGPU driver. It does seem a bit cleaner and should
> > > reduce duplicate code if the vfio vGPU iommu interface could handle the
> > > iommu mapping for the vendor vgpu driver when necessary. Thanks,
> >
> > Hi Alex,
> >
> > Since we don't want to allow vfio iommu to derive or own a reference to the
> > physical device, I think it is still better not providing such pci_dev to the
> > vfio iommu type1 driver.
> >
> > Also, I need to point out that if the vfio iommu is going to set up iommu page
> > table for the real underlying physical device, giving the fact of single RID we
> > are all having here, the iommu mapping code has to return the new "IOVA" that is
> > mapped to the HPA, which the GPU vendro driver will have to put on its DMA
> > engine. This is very different than the current VFIO IOMMU mapping logic.
> >
> > And we still have to provide another interface to translate the GPA to
> > HPA for CPU mapping.
> >
> > In the current RFC, we only need to have a single interface to provide the most
> > basic information to the GPU vendor driver and without taking the risk of
> > leaking a ref to VFIO IOMMU.
>
> I don't see this as some fundamental difference of opinion, it's really
> just whether vfio provides a "pin this GFN and return the HPA" function
> or whether that function could be extended to include "... and also map
> it through the DMA API for the provided device and return the host
> IOVA". It might even still be a single function to vfio for CPU vs
> device mapping where the device and IOVA return pointer are NULL when
> only pinning is required for CPU access (though maybe there are better
> ways to provide CPU access than pinning). A wrapper could even give the
> appearance that those are two separate functions.
>
> So long as vfio isn't owning or deriving the device for the DMA API
> calls and we don't introduce some complication in page accounting, this
> really just seems like a question of whether moving the DMA API
> handling into vfio is common between the vendor vGPU drivers and are we
> reducing the overall amount and complexity of code by giving the vendor
> drivers the opportunity to do both operations with one interface.
Hi Alex,
OK, I will look into of adding such facilitation and probably include it in a
bit later rev of VGPU IOMMU if we don't run any surprise or the issues you
mentioned above.
Thanks,
Neo
> If as Kevin suggest it also provides some additional abstractions
> for Xen vs KVM, even better. Thanks,
>
> Alex
WARNING: multiple messages have this Message-ID (diff)
From: Neo Jia <cjia@nvidia.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: "Ruan, Shuai" <shuai.ruan@intel.com>,
"Tian, Kevin" <kevin.tian@intel.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"Song, Jike" <jike.song@intel.com>,
Kirti Wankhede <kwankhede@nvidia.com>,
"kraxel@redhat.com" <kraxel@redhat.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"Lv, Zhiyuan" <zhiyuan.lv@intel.com>
Subject: Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU
Date: Fri, 11 Mar 2016 10:18:14 -0800 [thread overview]
Message-ID: <20160311181814.GA21896@nvidia.com> (raw)
In-Reply-To: <20160311105624.3811eac6@t450s.home>
On Fri, Mar 11, 2016 at 10:56:24AM -0700, Alex Williamson wrote:
> On Fri, 11 Mar 2016 08:55:44 -0800
> Neo Jia <cjia@nvidia.com> wrote:
>
> > > > Alex, what's your opinion on this?
> > >
> > > The sticky point is how vfio, which is only handling the vGPU, has a
> > > reference to the physical GPU on which to call DMA API operations. If
> > > that reference is provided by the vendor vGPU driver, for example
> > > vgpu_dma_do_translate_for_pci(gpa, pci_dev), I don't see any reason to
> > > be opposed to such an API. I would not condone vfio deriving or owning
> > > a reference to the physical device on its own though, that's in the
> > > realm of the vendor vGPU driver. It does seem a bit cleaner and should
> > > reduce duplicate code if the vfio vGPU iommu interface could handle the
> > > iommu mapping for the vendor vgpu driver when necessary. Thanks,
> >
> > Hi Alex,
> >
> > Since we don't want to allow vfio iommu to derive or own a reference to the
> > physical device, I think it is still better not providing such pci_dev to the
> > vfio iommu type1 driver.
> >
> > Also, I need to point out that if the vfio iommu is going to set up iommu page
> > table for the real underlying physical device, giving the fact of single RID we
> > are all having here, the iommu mapping code has to return the new "IOVA" that is
> > mapped to the HPA, which the GPU vendro driver will have to put on its DMA
> > engine. This is very different than the current VFIO IOMMU mapping logic.
> >
> > And we still have to provide another interface to translate the GPA to
> > HPA for CPU mapping.
> >
> > In the current RFC, we only need to have a single interface to provide the most
> > basic information to the GPU vendor driver and without taking the risk of
> > leaking a ref to VFIO IOMMU.
>
> I don't see this as some fundamental difference of opinion, it's really
> just whether vfio provides a "pin this GFN and return the HPA" function
> or whether that function could be extended to include "... and also map
> it through the DMA API for the provided device and return the host
> IOVA". It might even still be a single function to vfio for CPU vs
> device mapping where the device and IOVA return pointer are NULL when
> only pinning is required for CPU access (though maybe there are better
> ways to provide CPU access than pinning). A wrapper could even give the
> appearance that those are two separate functions.
>
> So long as vfio isn't owning or deriving the device for the DMA API
> calls and we don't introduce some complication in page accounting, this
> really just seems like a question of whether moving the DMA API
> handling into vfio is common between the vendor vGPU drivers and are we
> reducing the overall amount and complexity of code by giving the vendor
> drivers the opportunity to do both operations with one interface.
Hi Alex,
OK, I will look into of adding such facilitation and probably include it in a
bit later rev of VGPU IOMMU if we don't run any surprise or the issues you
mentioned above.
Thanks,
Neo
> If as Kevin suggest it also provides some additional abstractions
> for Xen vs KVM, even better. Thanks,
>
> Alex
next prev parent reply other threads:[~2016-03-11 18:18 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-23 16:24 [RFC PATCH v2 1/3] vGPU Core driver Kirti Wankhede
2016-02-23 16:24 ` [Qemu-devel] " Kirti Wankhede
2016-02-23 16:24 ` [RFC PATCH v2 2/3] VFIO driver for vGPU device Kirti Wankhede
2016-02-23 16:24 ` [Qemu-devel] " Kirti Wankhede
2016-02-23 16:24 ` [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU Kirti Wankhede
2016-02-23 16:24 ` [Qemu-devel] " Kirti Wankhede
2016-03-02 8:38 ` Jike Song
2016-03-02 8:38 ` [Qemu-devel] " Jike Song
2016-03-04 7:00 ` Neo Jia
2016-03-04 7:00 ` [Qemu-devel] " Neo Jia
2016-03-07 6:07 ` Jike Song
2016-03-07 6:07 ` [Qemu-devel] " Jike Song
2016-03-08 0:31 ` Neo Jia
2016-03-08 0:31 ` [Qemu-devel] " Neo Jia
2016-03-10 3:10 ` Jike Song
2016-03-10 3:10 ` [Qemu-devel] " Jike Song
2016-03-11 4:19 ` Neo Jia
2016-03-11 4:19 ` [Qemu-devel] " Neo Jia
2016-03-11 4:46 ` Tian, Kevin
2016-03-11 4:46 ` [Qemu-devel] " Tian, Kevin
2016-03-11 6:10 ` Neo Jia
2016-03-11 6:10 ` [Qemu-devel] " Neo Jia
2016-03-11 8:06 ` Tian, Kevin
2016-03-11 8:06 ` [Qemu-devel] " Tian, Kevin
2016-03-11 16:13 ` Alex Williamson
2016-03-11 16:13 ` [Qemu-devel] " Alex Williamson
2016-03-11 16:55 ` Neo Jia
2016-03-11 16:55 ` [Qemu-devel] " Neo Jia
2016-03-11 17:56 ` Alex Williamson
2016-03-11 17:56 ` [Qemu-devel] " Alex Williamson
2016-03-11 18:18 ` Neo Jia [this message]
2016-03-11 18:18 ` Neo Jia
2016-02-29 5:39 ` [RFC PATCH v2 1/3] vGPU Core driver Tian, Kevin
2016-02-29 5:39 ` [Qemu-devel] " Tian, Kevin
2016-02-29 23:17 ` Neo Jia
2016-02-29 23:17 ` [Qemu-devel] " Neo Jia
2016-03-01 3:10 ` Jike Song
2016-03-01 3:10 ` [Qemu-devel] " Jike Song
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=20160311181814.GA21896@nvidia.com \
--to=cjia@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=jike.song@intel.com \
--cc=kevin.tian@intel.com \
--cc=kraxel@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kwankhede@nvidia.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=shuai.ruan@intel.com \
--cc=zhiyuan.lv@intel.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 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.