From: David Hildenbrand <david@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: "Fam Zheng" <fam@euphon.net>, "Hannes Reinecke" <hare@suse.com>,
qemu-block@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Yuval Shaia" <yuval.shaia.ml@gmail.com>,
"Peter Xu" <peterx@redhat.com>,
"Klaus Jensen" <its@irrelevant.dk>,
"Keith Busch" <kbusch@kernel.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"John Snow" <jsnow@redhat.com>
Subject: Re: [PATCH v2 8/9] hw/dma: Use dma_addr_t type definition when relevant
Date: Mon, 10 Jan 2022 09:49:25 +0100 [thread overview]
Message-ID: <41b42506-672b-9480-c18d-a07ba67e01d3@redhat.com> (raw)
In-Reply-To: <20220104085431.2122999-9-f4bug@amsat.org>
On 04.01.22 09:54, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <philmd@redhat.com>
>
> Update the obvious places where dma_addr_t should be used
> (instead of uint64_t, hwaddr, size_t, int32_t types).
>
> This allows to have &dma_addr_t type portable on 32/64-bit
> hosts.
>
> Move QEMUSGList declaration after dma_addr_t declaration
> so this structure can use the new type.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> include/sysemu/dma.h | 22 +++++++++++-----------
> hw/nvme/ctrl.c | 2 +-
> hw/rdma/rdma_utils.c | 2 +-
> hw/scsi/megasas.c | 10 +++++-----
> softmmu/dma-helpers.c | 6 +++---
> 5 files changed, 21 insertions(+), 21 deletions(-)
>
> diff --git a/include/sysemu/dma.h b/include/sysemu/dma.h
> index 0db2478a506..7a8ae4fcd0b 100644
> --- a/include/sysemu/dma.h
> +++ b/include/sysemu/dma.h
> @@ -15,22 +15,11 @@
> #include "block/block.h"
> #include "block/accounting.h"
>
> -typedef struct ScatterGatherEntry ScatterGatherEntry;
> -
> typedef enum {
> DMA_DIRECTION_TO_DEVICE = 0,
> DMA_DIRECTION_FROM_DEVICE = 1,
> } DMADirection;
>
> -struct QEMUSGList {
> - ScatterGatherEntry *sg;
> - int nsg;
> - int nalloc;
> - size_t size;
> - DeviceState *dev;
> - AddressSpace *as;
> -};
> -
> /*
> * When an IOMMU is present, bus addresses become distinct from
> * CPU/memory physical addresses and may be a different size. Because
> @@ -43,6 +32,17 @@ typedef uint64_t dma_addr_t;
> #define DMA_ADDR_BITS 64
> #define DMA_ADDR_FMT "%" PRIx64
>
> +typedef struct ScatterGatherEntry ScatterGatherEntry;
> +
> +struct QEMUSGList {
> + ScatterGatherEntry *sg;
> + int nsg;
> + int nalloc;
> + dma_addr_t size;
> + DeviceState *dev;
> + AddressSpace *as;
> +};
Changing one member while moving is sneaky. Why the move in this patch?
Apart from that and Peters comment
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2022-01-10 8:56 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-04 8:54 [PATCH v2 0/9] hw/dma: Use dma_addr_t type definition when relevant Philippe Mathieu-Daudé
2022-01-04 8:54 ` [PATCH v2 1/9] hw/nvram: Restrict stub to sysemu and tools Philippe Mathieu-Daudé
2022-01-07 0:17 ` Richard Henderson
2022-01-11 10:43 ` Philippe Mathieu-Daudé
2022-01-04 8:54 ` [PATCH v2 2/9] hw/pci: Restrict pci-bus stub to sysemu Philippe Mathieu-Daudé
2022-01-07 0:18 ` Richard Henderson
2022-01-10 8:43 ` David Hildenbrand
2022-01-04 8:54 ` [PATCH v2 3/9] hw/pci: Document pci_dma_map() Philippe Mathieu-Daudé
2022-01-07 0:20 ` Richard Henderson
2022-01-04 8:54 ` [PATCH v2 4/9] hw/dma: Remove CONFIG_USER_ONLY check Philippe Mathieu-Daudé
2022-01-07 0:20 ` Richard Henderson
2022-01-10 8:45 ` David Hildenbrand
2022-01-04 8:54 ` [PATCH v2 5/9] hw/rdma/rdma_utils: Rename rdma_pci_dma_map 'len' argument Philippe Mathieu-Daudé
2022-01-07 0:21 ` Richard Henderson
2022-01-10 8:46 ` David Hildenbrand
2022-01-04 8:54 ` [PATCH v2 6/9] hw/scsi: Rename SCSIRequest::resid as 'residual' Philippe Mathieu-Daudé
2022-01-07 0:22 ` Richard Henderson
2022-01-10 8:46 ` David Hildenbrand
2022-01-04 8:54 ` [PATCH v2 7/9] hw/dma: Fix format string issues using dma_addr_t Philippe Mathieu-Daudé
2022-01-07 0:24 ` Richard Henderson
2022-01-10 8:47 ` David Hildenbrand
2022-01-04 8:54 ` [PATCH v2 8/9] hw/dma: Use dma_addr_t type definition when relevant Philippe Mathieu-Daudé
2022-01-04 9:55 ` Peter Xu
2022-01-10 8:49 ` David Hildenbrand [this message]
2022-01-10 9:05 ` Philippe Mathieu-Daudé
2022-01-04 8:54 ` [PATCH v2 9/9] hw/dma: Let dma_buf_read() / dma_buf_write() propagate MemTxResult Philippe Mathieu-Daudé
2022-01-10 8:51 ` David Hildenbrand
2022-01-10 9:07 ` Philippe Mathieu-Daudé
2022-01-06 11:08 ` [PATCH v2 0/9] hw/dma: Use dma_addr_t type definition when relevant Michael S. Tsirkin
2022-01-11 18:47 ` Philippe Mathieu-Daudé
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=41b42506-672b-9480-c18d-a07ba67e01d3@redhat.com \
--to=david@redhat.com \
--cc=f4bug@amsat.org \
--cc=fam@euphon.net \
--cc=hare@suse.com \
--cc=its@irrelevant.dk \
--cc=jsnow@redhat.com \
--cc=kbusch@kernel.org \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=yuval.shaia.ml@gmail.com \
/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).