On Wed, 1 Feb 2023 21:55:53 -0800 John Johnson <john.g.john...@oracle.com> wrote:
> Add ability to do async operations during memory transactions > > Signed-off-by: Jagannathan Raman <jag.ra...@oracle.com> > Signed-off-by: Elena Ufimtseva <elena.ufimts...@oracle.com> > Signed-off-by: John G Johnson <john.g.john...@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 <l...@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 <l...@redhat.com> Message-Id: <20221031031020.1405111-2-l...@redhat.com> Acked-by: Alex Williamson <alex.william...@redhat.com> Reviewed-by: Michael S. Tsirkin <m...@redhat.com> Signed-off-by: Michael S. Tsirkin <m...@redhat.com>