diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2012-06-27 14:50:40 +1000 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-06-27 16:33:25 -0500 |
commit | c65bcef30659442a45ed0842de80d246d0162fd7 (patch) | |
tree | 618cbb6e19627aef4627b15ba6380306530dd3f9 /dma.h | |
parent | 9ac6a217f26d2044929ac4261826d24cc8c3dda5 (diff) | |
download | qemu-c65bcef30659442a45ed0842de80d246d0162fd7.zip qemu-c65bcef30659442a45ed0842de80d246d0162fd7.tar.gz qemu-c65bcef30659442a45ed0842de80d246d0162fd7.tar.bz2 |
iommu: Make sglists and dma_bdrv helpers use new universal DMA helpers
dma-helpers.c contains a number of helper functions for doing
scatter/gather DMA, and various block device related DMA. Currently,
these directly access guest memory using cpu_physical_memory_*(),
assuming no IOMMU translation.
This patch updates this code to use the new universal DMA helper
functions. qemu_sglist_init() now takes a DMAContext * to describe
the DMA address space in which the scatter/gather will take place.
We minimally update the callers qemu_sglist_init() to pass NULL
(i.e. no translation, same as current behaviour). Some of those
callers should pass something else in some cases to allow proper IOMMU
translation in future, but that will be fixed in later patches.
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'dma.h')
-rw-r--r-- | dma.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -27,6 +27,7 @@ struct QEMUSGList { int nsg; int nalloc; size_t size; + DMAContext *dma; }; #if defined(TARGET_PHYS_ADDR_BITS) @@ -134,7 +135,7 @@ struct ScatterGatherEntry { dma_addr_t len; }; -void qemu_sglist_init(QEMUSGList *qsg, int alloc_hint); +void qemu_sglist_init(QEMUSGList *qsg, int alloc_hint, DMAContext *dma); void qemu_sglist_add(QEMUSGList *qsg, dma_addr_t base, dma_addr_t len); void qemu_sglist_destroy(QEMUSGList *qsg); #endif |