mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 02:58:29 +00:00
dma: Let dma_memory_map() take MemTxAttrs argument
Let devices specify transaction attributes when calling dma_memory_map(). Patch created mechanically using spatch with this script: @@ expression E1, E2, E3, E4; @@ - dma_memory_map(E1, E2, E3, E4) + dma_memory_map(E1, E2, E3, E4, MEMTXATTRS_UNSPECIFIED) Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Li Qiang <liq3ea@gmail.com> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20211223115554.3155328-7-philmd@redhat.com>
This commit is contained in:
@@ -373,7 +373,8 @@ static ssize_t gpadl_iter_io(GpadlIter *iter, void *buf, uint32_t len)
|
||||
|
||||
maddr = (iter->gpadl->gfns[idx] << TARGET_PAGE_BITS) | off_in_page;
|
||||
|
||||
iter->map = dma_memory_map(iter->as, maddr, &mlen, iter->dir);
|
||||
iter->map = dma_memory_map(iter->as, maddr, &mlen, iter->dir,
|
||||
MEMTXATTRS_UNSPECIFIED);
|
||||
if (mlen != pgleft) {
|
||||
dma_memory_unmap(iter->as, iter->map, mlen, iter->dir, 0);
|
||||
iter->map = NULL;
|
||||
@@ -490,7 +491,8 @@ int vmbus_map_sgl(VMBusChanReq *req, DMADirection dir, struct iovec *iov,
|
||||
goto err;
|
||||
}
|
||||
|
||||
iov[ret_cnt].iov_base = dma_memory_map(sgl->as, a, &l, dir);
|
||||
iov[ret_cnt].iov_base = dma_memory_map(sgl->as, a, &l, dir,
|
||||
MEMTXATTRS_UNSPECIFIED);
|
||||
if (!l) {
|
||||
ret = -EFAULT;
|
||||
goto err;
|
||||
@@ -566,7 +568,7 @@ static vmbus_ring_buffer *ringbuf_map_hdr(VMBusRingBufCommon *ringbuf)
|
||||
dma_addr_t mlen = sizeof(*rb);
|
||||
|
||||
rb = dma_memory_map(ringbuf->as, ringbuf->rb_addr, &mlen,
|
||||
DMA_DIRECTION_FROM_DEVICE);
|
||||
DMA_DIRECTION_FROM_DEVICE, MEMTXATTRS_UNSPECIFIED);
|
||||
if (mlen != sizeof(*rb)) {
|
||||
dma_memory_unmap(ringbuf->as, rb, mlen,
|
||||
DMA_DIRECTION_FROM_DEVICE, 0);
|
||||
|
||||
Reference in New Issue
Block a user