• David Gibson's avatar
    iommu: Make sglists and dma_bdrv helpers use new universal DMA helpers · c65bcef3
    David Gibson authored
    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: default avatarDavid Gibson <david@gibson.dropbear.id.au>
    Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
pci.h 19.4 KB