57 lines
2.3 KiB
Diff
57 lines
2.3 KiB
Diff
|
|
From 46e7b55f326a115f42019add488a1ca1887aa89c Mon Sep 17 00:00:00 2001
|
||
|
|
From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@redhat.com>
|
||
|
|
Date: Thu, 3 Sep 2020 09:28:49 +0200
|
||
|
|
Subject: [PATCH 02/25] dma: Let dma_memory_valid() take MemTxAttrs argument
|
||
|
|
MIME-Version: 1.0
|
||
|
|
Content-Type: text/plain; charset=UTF-8
|
||
|
|
Content-Transfer-Encoding: 8bit
|
||
|
|
|
||
|
|
Let devices specify transaction attributes when calling
|
||
|
|
dma_memory_valid().
|
||
|
|
|
||
|
|
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-2-philmd@redhat.com>
|
||
|
|
---
|
||
|
|
include/hw/ppc/spapr_vio.h | 2 +-
|
||
|
|
include/sysemu/dma.h | 4 ++--
|
||
|
|
2 files changed, 3 insertions(+), 3 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/include/hw/ppc/spapr_vio.h b/include/hw/ppc/spapr_vio.h
|
||
|
|
index 4bea87f39c..4c45f1579f 100644
|
||
|
|
--- a/include/hw/ppc/spapr_vio.h
|
||
|
|
+++ b/include/hw/ppc/spapr_vio.h
|
||
|
|
@@ -91,7 +91,7 @@ static inline void spapr_vio_irq_pulse(SpaprVioDevice *dev)
|
||
|
|
static inline bool spapr_vio_dma_valid(SpaprVioDevice *dev, uint64_t taddr,
|
||
|
|
uint32_t size, DMADirection dir)
|
||
|
|
{
|
||
|
|
- return dma_memory_valid(&dev->as, taddr, size, dir);
|
||
|
|
+ return dma_memory_valid(&dev->as, taddr, size, dir, MEMTXATTRS_UNSPECIFIED);
|
||
|
|
}
|
||
|
|
|
||
|
|
static inline int spapr_vio_dma_read(SpaprVioDevice *dev, uint64_t taddr,
|
||
|
|
diff --git a/include/sysemu/dma.h b/include/sysemu/dma.h
|
||
|
|
index 3201e7901d..296f3b57c9 100644
|
||
|
|
--- a/include/sysemu/dma.h
|
||
|
|
+++ b/include/sysemu/dma.h
|
||
|
|
@@ -73,11 +73,11 @@ static inline void dma_barrier(AddressSpace *as, DMADirection dir)
|
||
|
|
* dma_memory_{read,write}() and check for errors */
|
||
|
|
static inline bool dma_memory_valid(AddressSpace *as,
|
||
|
|
dma_addr_t addr, dma_addr_t len,
|
||
|
|
- DMADirection dir)
|
||
|
|
+ DMADirection dir, MemTxAttrs attrs)
|
||
|
|
{
|
||
|
|
return address_space_access_valid(as, addr, len,
|
||
|
|
dir == DMA_DIRECTION_FROM_DEVICE,
|
||
|
|
- MEMTXATTRS_UNSPECIFIED);
|
||
|
|
+ attrs);
|
||
|
|
}
|
||
|
|
|
||
|
|
static inline MemTxResult dma_memory_rw_relaxed(AddressSpace *as,
|
||
|
|
--
|
||
|
|
2.27.0
|
||
|
|
|