> > Indeed. Could we decide whether or not to register an address space with
> > VFIO in a more intelligent manner? E.g. the following simplistic patch 
> > solves
> > our problem:
> >
> > diff --git a/hw/vfio/common.c b/hw/vfio/common.c
> > index 4374cc6176..d9d3b1277a 100644
> > --- a/hw/vfio/common.c
> > +++ b/hw/vfio/common.c
> > @@ -430,6 +430,9 @@ static void
> vfio_listener_region_add(MemoryListener *listener,
> >      VFIOHostDMAWindow *hostwin;
> >      bool hostwin_found;
> >
> > +    if (!section->mr->ram_device)
> > +        return;
> > +
> 
> Nope, this would prevent IOMMU mapping of assigned device MMIO
> regions
> which would prevent peer-to-peer DMA between assigned devices.  Thanks,

Understood.

Is there a strong reason why QEMU allocates memory for these address spaces 
without MAP_SHARED? In our use case it would solve our problem if we could make 
QEMU use MAP_SHARED. I understand that this isn't strictly correct, so would it 
be acceptable to enable this behavior with a command-line option or an #ifdef?

Reply via email to