diff options
Diffstat (limited to 'hw/misc')
-rw-r--r-- | hw/misc/vfio.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c index 30b1a78f9c..d304213bf1 100644 --- a/hw/misc/vfio.c +++ b/hw/misc/vfio.c @@ -2156,7 +2156,14 @@ static int vfio_dma_map(VFIOContainer *container, hwaddr iova, static bool vfio_listener_skipped_section(MemoryRegionSection *section) { - return !memory_region_is_ram(section->mr); + return !memory_region_is_ram(section->mr) || + /* + * Sizing an enabled 64-bit BAR can cause spurious mappings to + * addresses in the upper part of the 64-bit address space. These + * are never accessed by the CPU and beyond the address width of + * some IOMMU hardware. TODO: VFIO should tell us the IOMMU width. + */ + section->offset_within_address_space & (1ULL << 63); } static void vfio_listener_region_add(MemoryListener *listener, |