On Tue, 5 Nov 2019 00:40:39 +0800
Li Qiang <[email protected]> wrote:

> Hello Alex, Auger and all,
> 
> I have a question about the VFIO virtual device BAR.
> 
> In vfio_region_setup, it initialize a ‘region->mem’ MR and set its ops to 
> ‘vfio_regions_ops’. 
> In ‘vfio_region_mmap’, it maps the physical device’s MMIO to QEMU’s virtual 
> address space 
> as a raw MR ‘region->mmaps[i].mem’. 
> And also it set the latter MR as a subregion of the first one.
> 
> So when the guest accesses the BAR, it will direct go to the physical 
> device’s BAR.
> My question is here:
> When the qemu will use the ‘vfio_regions_ops’ to read/write the BAR?
> Also whey in the last of ‘vfio_region_write/read’ we need to call 
> ‘vbasedev->ops->vfio_eoi(vbasedev);’?

We support:

 a) sparse mmaps where the entire BAR is not covered by an mmap
 b) quirks, which layer on top of the mmaps to provide virtualized
    access
 c) INTx emulation which disables mmaps MRs in order to detect device
    access as a generic mechanism for inferring interrupt
    acknowledgment.

The latter being the reason we call vfio_eoi.  Thanks,

Alex


Reply via email to