qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 17/23] vfio-user: dma map/unmap operations


From: Alex Williamson
Subject: Re: [PATCH v2 17/23] vfio-user: dma map/unmap operations
Date: Fri, 3 Feb 2023 14:28:36 -0700

On Wed,  1 Feb 2023 21:55:53 -0800
John Johnson <john.g.johnson@oracle.com> wrote:

> Add ability to do async operations during memory transactions
> 
> Signed-off-by: Jagannathan Raman <jag.raman@oracle.com>
> Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
> Signed-off-by: John G Johnson <john.g.johnson@oracle.com>
> ---
>  hw/vfio/user-protocol.h       |  32 ++++++
>  include/hw/vfio/vfio-common.h |   4 +-
>  hw/vfio/common.c              |  64 +++++++++---
>  hw/vfio/user.c                | 224 
> ++++++++++++++++++++++++++++++++++++++++++
>  hw/vfio/trace-events          |   2 +
>  5 files changed, 311 insertions(+), 15 deletions(-)
...
> diff --git a/hw/vfio/common.c b/hw/vfio/common.c
> index 6f99907..f04fd20 100644
> --- a/hw/vfio/common.c
> +++ b/hw/vfio/common.c
...
> @@ -587,7 +586,8 @@ static bool 
> vfio_listener_skipped_section(MemoryRegionSection *section)
>  
>  /* Called with rcu_read_lock held.  */
>  static bool vfio_get_xlat_addr(IOMMUTLBEntry *iotlb, void **vaddr,
> -                               ram_addr_t *ram_addr, bool *read_only)
> +                               ram_addr_t *ram_addr, bool *read_only,
> +                               MemoryRegion **mrp)
>  {
>      MemoryRegion *mr;
>      hwaddr xlat;
> @@ -668,6 +668,10 @@ static bool vfio_get_xlat_addr(IOMMUTLBEntry *iotlb, 
> void **vaddr,
>          *read_only = !writable || mr->readonly;
>      }
>  
> +    if (mrp != NULL) {
> +        *mrp = mr;
> +    }
> +
>      return true;
>  }
>  

This needs a rebase, the contents of vfio_get_xlat_addr() were largely
moved to memory_get_xlat_addr() and the context is all wrong now.
Thanks,

Alex

commit baa44bce87fe53ef5c95d39e634b3bace014d235
Author: Cindy Lu <lulu@redhat.com>
Date:   Mon Oct 31 11:10:19 2022 +0800

    vfio: move implement of vfio_get_xlat_addr() to memory.c
    
    - Move the implement vfio_get_xlat_addr to softmmu/memory.c, and
      change the name to memory_get_xlat_addr(). So we can use this
      function on other devices, such as vDPA device.
    - Add a new function vfio_get_xlat_addr in vfio/common.c, and it will check
      whether the memory is backed by a discard manager. then device can
      have its own warning.
    
    Signed-off-by: Cindy Lu <lulu@redhat.com>
    Message-Id: <20221031031020.1405111-2-lulu@redhat.com>
    Acked-by: Alex Williamson <alex.williamson@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]