[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 10/23] dma: Let dma_buf_rw() take MemTxAttrs argument
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 10/23] dma: Let dma_buf_rw() take MemTxAttrs argument |
Date: |
Thu, 23 Dec 2021 12:55:41 +0100 |
Let devices specify transaction attributes when calling dma_buf_rw().
Keep the default MEMTXATTRS_UNSPECIFIED in the 2 callers.
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
softmmu/dma-helpers.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/softmmu/dma-helpers.c b/softmmu/dma-helpers.c
index 7f37548394e..fa81d2b386c 100644
--- a/softmmu/dma-helpers.c
+++ b/softmmu/dma-helpers.c
@@ -295,7 +295,7 @@ BlockAIOCB *dma_blk_write(BlockBackend *blk,
static uint64_t dma_buf_rw(void *buf, int32_t len, QEMUSGList *sg,
- DMADirection dir)
+ DMADirection dir, MemTxAttrs attrs)
{
uint8_t *ptr = buf;
uint64_t resid;
@@ -307,8 +307,7 @@ static uint64_t dma_buf_rw(void *buf, int32_t len,
QEMUSGList *sg,
while (len > 0) {
ScatterGatherEntry entry = sg->sg[sg_cur_index++];
int32_t xfer = MIN(len, entry.len);
- dma_memory_rw(sg->as, entry.base, ptr, xfer, dir,
- MEMTXATTRS_UNSPECIFIED);
+ dma_memory_rw(sg->as, entry.base, ptr, xfer, dir, attrs);
ptr += xfer;
len -= xfer;
resid -= xfer;
@@ -319,12 +318,14 @@ static uint64_t dma_buf_rw(void *buf, int32_t len,
QEMUSGList *sg,
uint64_t dma_buf_read(void *ptr, int32_t len, QEMUSGList *sg)
{
- return dma_buf_rw(ptr, len, sg, DMA_DIRECTION_FROM_DEVICE);
+ return dma_buf_rw(ptr, len, sg, DMA_DIRECTION_FROM_DEVICE,
+ MEMTXATTRS_UNSPECIFIED);
}
uint64_t dma_buf_write(void *ptr, int32_t len, QEMUSGList *sg)
{
- return dma_buf_rw(ptr, len, sg, DMA_DIRECTION_TO_DEVICE);
+ return dma_buf_rw(ptr, len, sg, DMA_DIRECTION_TO_DEVICE,
+ MEMTXATTRS_UNSPECIFIED);
}
void dma_acct_start(BlockBackend *blk, BlockAcctCookie *cookie,
--
2.33.1
- [PATCH v2 00/23] hw: Have DMA APIs take MemTxAttrs arg & propagate MemTxResult (full), Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 01/23] dma: Let dma_memory_valid() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 02/23] dma: Let dma_memory_set() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 03/23] dma: Let dma_memory_rw_relaxed() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 04/23] dma: Let dma_memory_rw() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 05/23] dma: Let dma_memory_read/write() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 06/23] dma: Let dma_memory_map() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 07/23] dma: Have dma_buf_rw() take a void pointer, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 08/23] dma: Have dma_buf_read() / dma_buf_write() take a void pointer, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 09/23] dma: Let pci_dma_rw() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 10/23] dma: Let dma_buf_rw() take MemTxAttrs argument,
Philippe Mathieu-Daudé <=
- [PATCH v2 11/23] dma: Let dma_buf_write() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 12/23] dma: Let dma_buf_read() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 13/23] dma: Let dma_buf_rw() propagate MemTxResult, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 14/23] dma: Let dma_buf_read() / dma_buf_write() propagate MemTxResult, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 15/23] dma: Let st*_dma() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 16/23] dma: Let ld*_dma() take MemTxAttrs argument, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 17/23] dma: Let st*_dma() propagate MemTxResult, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 18/23] dma: Let ld*_dma() propagate MemTxResult, Philippe Mathieu-Daudé, 2021/12/23
- [PATCH v2 19/23] hw/scsi/megasas: Use uint32_t for reply queue head/tail values, Philippe Mathieu-Daudé, 2021/12/23