Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1257575
| From | Joerg Roedel <jroedel@suse.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/3] virtio_ring: Support DMA APIs |
| Date | 2015-10-28 03:10 +0100 |
| Message-ID | <qoolA-4PZ-1@gated-at.bofh.it> (permalink) |
| References | <qonzc-4kh-3@gated-at.bofh.it> <qonzc-4kh-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Andy, On Tue, Oct 27, 2015 at 06:17:09PM -0700, Andy Lutomirski wrote: > From: Andy Lutomirski <luto@amacapital.net> > > virtio_ring currently sends the device (usually a hypervisor) > physical addresses of its I/O buffers. This is okay when DMA > addresses and physical addresses are the same thing, but this isn't > always the case. For example, this never works on Xen guests, and > it is likely to fail if a physical "virtio" device ever ends up > behind an IOMMU or swiotlb. The overall code looks good, but I havn't seen and dma_sync* calls. When swiotlb=force is in use this would break. > + vq->vring.desc[head].addr = cpu_to_virtio64(_vq->vdev, vring_map_single( > + vq, > + desc, total_sg * sizeof(struct vring_desc), > + DMA_TO_DEVICE)); Nit: I think readability could be improved here by using a temporary variable for the return value of vring_map_single(). Joerg -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 2/3] virtio_ring: Support DMA APIs Andy Lutomirski <luto@kernel.org> - 2015-10-28 02:20 +0100
Re: [PATCH 2/3] virtio_ring: Support DMA APIs Joerg Roedel <jroedel@suse.de> - 2015-10-28 03:10 +0100
Re: [PATCH 2/3] virtio_ring: Support DMA APIs Andy Lutomirski <luto@amacapital.net> - 2015-10-28 03:20 +0100
Re: [PATCH 2/3] virtio_ring: Support DMA APIs Joerg Roedel <jroedel@suse.de> - 2015-10-28 03:30 +0100
Re: [PATCH 2/3] virtio_ring: Support DMA APIs Andy Lutomirski <luto@amacapital.net> - 2015-10-28 06:20 +0100
Re: [PATCH 2/3] virtio_ring: Support DMA APIs Christian Borntraeger <borntraeger@de.ibm.com> - 2015-10-28 03:30 +0100
Re: [PATCH 2/3] virtio_ring: Support DMA APIs Andy Lutomirski <luto@amacapital.net> - 2015-10-28 06:10 +0100
csiph-web