[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support fo
From: |
Jike Song |
Subject: |
Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU |
Date: |
Mon, 7 Mar 2016 14:07:15 +0800 |
Hi Neo,
On Fri, Mar 4, 2016 at 3:00 PM, Neo Jia <address@hidden> wrote:
> On Wed, Mar 02, 2016 at 04:38:34PM +0800, Jike Song wrote:
>> On 02/24/2016 12:24 AM, Kirti Wankhede wrote:
>> > + vgpu_dma->size = map->size;
>> > +
>> > + vgpu_link_dma(vgpu_iommu, vgpu_dma);
>>
>> Hi Kirti & Neo,
>>
>> seems that no one actually setup mappings for IOMMU here?
>>
>
> Hi Jike,
>
> Yes.
>
> The actual mapping should be done by the host kernel driver after calling the
> translation/pinning API vgpu_dma_do_translate.
Thanks for the reply. I mis-deleted the mail in my intel account, so
reply with private mail account, sorry for that.
In vgpu_dma_do_translate():
for (i = 0; i < count; i++) {
{snip}
dma_addr_t iova = gfn_buffer[i] << PAGE_SHIFT;
vgpu_dma = vgpu_find_dma(vgpu_iommu, iova, 0 /* size */);
remote_vaddr = vgpu_dma->vaddr + iova - vgpu_dma->iova;
if (get_user_pages_unlocked(NULL, mm, remote_vaddr, 1, 1, 0, page) == 1) {
pfn = page_to_pfn(page[0]);
}
gfn_buffer[i] = pfn;
}
If I understand correctly, the purpose of above code, is given an
array of gfns, try to pin & return associated pfns. There is still no
IOMMU mappings here. Is it supposed to be the caller who should set
up IOMMU by DMA api such as dma_map_page(), after calling
vgpu_dma_do_translate()?
--
Thanks,
Jike
- Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU, Jike Song, 2016/03/02
- Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU, Neo Jia, 2016/03/04
- Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU,
Jike Song <=
- Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU, Neo Jia, 2016/03/07
- Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU, Jike Song, 2016/03/09
- Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU, Neo Jia, 2016/03/10
- Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU, Tian, Kevin, 2016/03/10
- Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU, Neo Jia, 2016/03/11
- Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU, Tian, Kevin, 2016/03/11
- Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU, Alex Williamson, 2016/03/11
- Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU, Neo Jia, 2016/03/11
- Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU, Alex Williamson, 2016/03/11
- Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU, Neo Jia, 2016/03/11