[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/13] hw/dma/xlnx_csu_dma: don't throw guest errors when stopping
From: |
Peter Maydell |
Subject: |
[PULL 13/13] hw/dma/xlnx_csu_dma: don't throw guest errors when stopping the SRC DMA |
Date: |
Mon, 27 Nov 2023 17:08:23 +0000 |
From: Frederic Konrad <fkonrad@amd.com>
UG1087 states for the source channel that: if SIZE is programmed to 0, and the
DMA is started, the interrupts DONE and MEM_DONE will be asserted.
This implies that it is allowed for the guest to stop the source DMA by writing
a size of 0 to the SIZE register, so remove the LOG_GUEST_ERROR in that case.
While at it remove the comment marking the SIZE register as write-only.
See:
https://docs.xilinx.com/r/en-US/ug1087-zynq-ultrascale-registers/CSUDMA_SRC_SIZE-CSUDMA-Register
Signed-off-by: Frederic Konrad <fkonrad@amd.com>
Reviewed-by: Francisco Iglesias <francisco.iglesias@amd.com>
Message-id: 20231124143505.1493184-4-fkonrad@amd.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/dma/xlnx_csu_dma.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/hw/dma/xlnx_csu_dma.c b/hw/dma/xlnx_csu_dma.c
index 531013f35aa..bc1505aade7 100644
--- a/hw/dma/xlnx_csu_dma.c
+++ b/hw/dma/xlnx_csu_dma.c
@@ -39,7 +39,7 @@
REG32(ADDR, 0x0)
FIELD(ADDR, ADDR, 2, 30) /* wo */
REG32(SIZE, 0x4)
- FIELD(SIZE, SIZE, 2, 27) /* wo */
+ FIELD(SIZE, SIZE, 2, 27)
FIELD(SIZE, LAST_WORD, 0, 1) /* rw, only exists in SRC */
REG32(STATUS, 0x8)
FIELD(STATUS, DONE_CNT, 13, 3) /* wtc */
@@ -335,10 +335,14 @@ static uint64_t addr_pre_write(RegisterInfo *reg,
uint64_t val)
static uint64_t size_pre_write(RegisterInfo *reg, uint64_t val)
{
XlnxCSUDMA *s = XLNX_CSU_DMA(reg->opaque);
+ uint64_t size = val & R_SIZE_SIZE_MASK;
if (s->regs[R_SIZE] != 0) {
- qemu_log_mask(LOG_GUEST_ERROR,
- "%s: Starting DMA while already running.\n", __func__);
+ if (size || s->is_dst) {
+ qemu_log_mask(LOG_GUEST_ERROR,
+ "%s: Starting DMA while already running.\n",
+ __func__);
+ }
}
if (!s->is_dst) {
@@ -346,7 +350,7 @@ static uint64_t size_pre_write(RegisterInfo *reg, uint64_t
val)
}
/* Size is word aligned */
- return val & R_SIZE_SIZE_MASK;
+ return size;
}
static uint64_t size_post_read(RegisterInfo *reg, uint64_t val)
--
2.34.1
- [PULL 03/13] hw/net/can/xlnx-zynqmp: Avoid underflow while popping TX FIFOs, (continued)
- [PULL 03/13] hw/net/can/xlnx-zynqmp: Avoid underflow while popping TX FIFOs, Peter Maydell, 2023/11/27
- [PULL 06/13] hw/virtio: Free VirtIOIOMMUPCI::vdev.reserved_regions[] on finalize(), Peter Maydell, 2023/11/27
- [PULL 04/13] hw/net/can/xlnx-zynqmp: Avoid underflow while popping RX FIFO, Peter Maydell, 2023/11/27
- [PULL 07/13] hw/misc/mps2-scc: Free MPS2SCC::oscclk[] array on finalize(), Peter Maydell, 2023/11/27
- [PULL 05/13] hw/virtio: Add VirtioPCIDeviceTypeInfo::instance_finalize field, Peter Maydell, 2023/11/27
- [PULL 12/13] hw/misc, hw/ssi: Fix some URLs for AMD / Xilinx models, Peter Maydell, 2023/11/27
- [PULL 09/13] hw/nvram/xlnx-efuse-ctrl: Free XlnxVersalEFuseCtrl[] "pg0-lock" array, Peter Maydell, 2023/11/27
- [PULL 02/13] target/arm: Handle overflow in calculation of next timer tick, Peter Maydell, 2023/11/27
- [PULL 08/13] hw/nvram/xlnx-efuse: Free XlnxEFuse::ro_bits[] array on finalize(), Peter Maydell, 2023/11/27
- [PULL 10/13] hw/input/stellaris_gamepad: Free StellarisGamepad::keycodes[] array, Peter Maydell, 2023/11/27
- [PULL 13/13] hw/dma/xlnx_csu_dma: don't throw guest errors when stopping the SRC DMA,
Peter Maydell <=
- [PULL 11/13] hw/ssi/xilinx_spips: fix an out of bound access, Peter Maydell, 2023/11/27
- Re: [PULL 00/13] target-arm queue, Stefan Hajnoczi, 2023/11/28
- Re: [PULL 00/13] target-arm queue, Stefan Hajnoczi, 2023/11/28