qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Francisco Iglesias <francisco.iglesias@amd.com>
To: Frederic Konrad <fkonrad@amd.com>, qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, peter.maydell@linaro.org,
	edgar.iglesias@gmail.com, alistair@alistair23.me,
	luc.michel@amd.com
Subject: Re: [PATCH v1 3/3] hw/dma/xlnx_csu_dma: don't throw guest errors when stopping the SRC DMA
Date: Fri, 24 Nov 2023 17:37:26 +0100	[thread overview]
Message-ID: <3adbe20a-f871-48a8-8d4c-b9f0965b459f@amd.com> (raw)
In-Reply-To: <20231124143505.1493184-4-fkonrad@amd.com>



On 2023-11-24 15:35, Frederic Konrad wrote:
> 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>

> ---
>   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 531013f35a..bc1505aade 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)


  reply	other threads:[~2023-11-24 16:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-24 14:35 [PATCH v1 0/3] ZynqMP / Versal: various fixes Frederic Konrad
2023-11-24 14:35 ` [PATCH v1 1/3] hw/ssi/xilinx_spips: fix an out of bound access Frederic Konrad
2023-11-24 16:13   ` Francisco Iglesias
2023-12-06  0:14   ` Alistair Francis
2023-11-24 14:35 ` [PATCH v1 2/3] fix some url for amd / xilinx models Frederic Konrad
2023-11-24 16:17   ` Francisco Iglesias
2023-12-06  0:15   ` Alistair Francis
2023-11-24 14:35 ` [PATCH v1 3/3] hw/dma/xlnx_csu_dma: don't throw guest errors when stopping the SRC DMA Frederic Konrad
2023-11-24 16:37   ` Francisco Iglesias [this message]
2023-12-06  0:16   ` Alistair Francis
2023-11-27 15:38 ` [PATCH v1 0/3] ZynqMP / Versal: various fixes Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3adbe20a-f871-48a8-8d4c-b9f0965b459f@amd.com \
    --to=francisco.iglesias@amd.com \
    --cc=alistair@alistair23.me \
    --cc=edgar.iglesias@gmail.com \
    --cc=fkonrad@amd.com \
    --cc=luc.michel@amd.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).