qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: Yi Liu <yi.l.liu@intel.com>,
	Thanos Makatos <thanos.makatos@nutanix.com>,
	 John Levon <john.levon@nutanix.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Eric Auger <eric.auger@redhat.com>,
	Zhenzhong Duan <zhenzhong.duan@intel.com>
Subject: Re: [PATCH 3/3] hw/vfio: Use uint64_t for IOVA mapping size in vfio_container_dma_*map
Date: Tue, 30 Sep 2025 10:53:51 +0200	[thread overview]
Message-ID: <e23cb913-5f53-461e-adc4-f68a8358428b@redhat.com> (raw)
In-Reply-To: <20250929160807.73626-4-philmd@linaro.org>

On 9/29/25 18:08, Philippe Mathieu-Daudé wrote:
> The 'ram_addr_t' type is described as:
> 
>    a QEMU internal address space that maps guest RAM physical
>    addresses into an intermediate address space that can map
>    to host virtual address spaces.
> 
> This doesn't represent well an IOVA mapping size. Simply use
> the uint64_t type.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   include/hw/vfio/vfio-container.h | 10 +++++-----
>   hw/vfio-user/container.c         |  4 ++--
>   hw/vfio/container-legacy.c       |  8 ++++----
>   hw/vfio/container.c              |  5 ++---
>   hw/vfio/iommufd.c                |  6 +++---
>   5 files changed, 16 insertions(+), 17 deletions(-)
> 
> diff --git a/include/hw/vfio/vfio-container.h b/include/hw/vfio/vfio-container.h
> index 093c360f0ee..c4b58d664b7 100644
> --- a/include/hw/vfio/vfio-container.h
> +++ b/include/hw/vfio/vfio-container.h
> @@ -81,10 +81,10 @@ void vfio_address_space_insert(VFIOAddressSpace *space,
>                                  VFIOContainer *bcontainer);
>   
>   int vfio_container_dma_map(VFIOContainer *bcontainer,
> -                           hwaddr iova, ram_addr_t size,
> +                           hwaddr iova, uint64_t size,
>                              void *vaddr, bool readonly, MemoryRegion *mr);
>   int vfio_container_dma_unmap(VFIOContainer *bcontainer,
> -                             hwaddr iova, ram_addr_t size,
> +                             hwaddr iova, uint64_t size,
>                                IOMMUTLBEntry *iotlb, bool unmap_all);
>   bool vfio_container_add_section_window(VFIOContainer *bcontainer,
>                                          MemoryRegionSection *section,
> @@ -167,7 +167,7 @@ struct VFIOIOMMUClass {
>        * Returns 0 to indicate success and -errno otherwise.
>        */
>       int (*dma_map)(const VFIOContainer *bcontainer,
> -                   hwaddr iova, ram_addr_t size,
> +                   hwaddr iova, uint64_t size,
>                      void *vaddr, bool readonly, MemoryRegion *mr);
>       /**
>        * @dma_map_file
> @@ -182,7 +182,7 @@ struct VFIOIOMMUClass {
>        * @readonly: map read only if true
>        */
>       int (*dma_map_file)(const VFIOContainer *bcontainer,
> -                        hwaddr iova, ram_addr_t size,
> +                        hwaddr iova, uint64_t size,
>                           int fd, unsigned long start, bool readonly);


Don't forget to change :

typedef int (*dma_map_fn)(const struct VFIOContainer *bcontainer,
                           hwaddr iova, ram_addr_t size, void *vaddr,
                           bool readonly, MemoryRegion *mr);

in /include/hw/vfio/vfio-cpr.h.


Thanks,

C.



  parent reply	other threads:[~2025-09-30  8:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-29 16:08 [PATCH 0/3] hw/vfio: Remove invalid uses of ram_addr_t type Philippe Mathieu-Daudé
2025-09-29 16:08 ` [PATCH 1/3] system/iommufd: Use uint64_t type for IOVA mapping size Philippe Mathieu-Daudé
2025-09-29 16:08 ` [PATCH 2/3] hw/vfio: Avoid ram_addr_t in vfio_container_query_dirty_bitmap() Philippe Mathieu-Daudé
2025-09-29 16:08 ` [PATCH 3/3] hw/vfio: Use uint64_t for IOVA mapping size in vfio_container_dma_*map Philippe Mathieu-Daudé
2025-09-30  8:46   ` Philippe Mathieu-Daudé
2025-09-30  8:48   ` Cédric Le Goater
2025-09-30  8:53   ` Cédric Le Goater [this message]
2025-09-30  9:08     ` 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=e23cb913-5f53-461e-adc4-f68a8358428b@redhat.com \
    --to=clg@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=john.levon@nutanix.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thanos.makatos@nutanix.com \
    --cc=yi.l.liu@intel.com \
    --cc=zhenzhong.duan@intel.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).