[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3] hw/dma: Let dma_buf_read() / dma_buf_write() propagate Me
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v3] hw/dma: Let dma_buf_read() / dma_buf_write() propagate MemTxResult |
Date: |
Tue, 18 Jan 2022 08:27:31 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 |
On 1/17/22 13:51, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <philmd@redhat.com>
>
> Since commit 292e13142d2, dma_buf_rw() returns a MemTxResult type.
> Do not discard it, return it to the caller. Pass the previously
> returned value (the QEMUSGList residual size, which was rarely used)
> as an optional argument.
>
> With this new API, SCSIRequest::residual might now be accessed via
> a pointer. Since the size_t type does not have the same size on
> 32 and 64-bit host architectures, convert it to a uint64_t, which
> is big enough to hold the residual size, and the type is constant
> on both 32/64-bit hosts.
>
> Update the few dma_buf_read() / dma_buf_write() callers to the new
> API.
>
> Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> v3:
> - Reworded to precise the SCSIRequest::residual type change
> - Posted out of the "Use dma_addr_t type definition when relevant"
> series (dhildenb)
> ---
> include/hw/scsi/scsi.h | 2 +-
> include/sysemu/dma.h | 4 +--
> hw/ide/ahci.c | 8 +++---
> hw/nvme/ctrl.c | 4 +--
> hw/scsi/megasas.c | 59 ++++++++++++++++++++++++++++++------------
> hw/scsi/scsi-bus.c | 6 +++--
> softmmu/dma-helpers.c | 16 +++---------
> 7 files changed, 59 insertions(+), 40 deletions(-)
Queued via memory-api.