static void vfio_listener_region_del(MemoryListener *listener,

                                     MemoryRegionSection *section)

{

    VFIOContainer *container = container_of(listener, VFIOContainer,

                                            iommu_data.listener);

    hwaddr iova, end;

    int ret;



    if (vfio_listener_skipped_section(section)) {

        DPRINTF("SKIPPING region_del %"HWADDR_PRIx" - %"PRIx64"\n",

                section->offset_within_address_space,

                section->offset_within_address_space + section->size - 1);

        return;

    }



    if (unlikely((section->offset_within_address_space & ~TARGET_PAGE_MASK) !=

                 (section->offset_within_region & ~TARGET_PAGE_MASK))) {

        error_report("%s received unaligned region", __func__);

        return;

    }



    iova = TARGET_PAGE_ALIGN(section->offset_within_address_space);

    end = (section->offset_within_address_space + int128_get64(section->size)) &

          TARGET_PAGE_MASK;



    if (iova >= end) {

        return;

    }



    DPRINTF("region_del %"HWADDR_PRIx" - %"HWADDR_PRIx"\n",

            iova, end - 1);



    ret = vfio_dma_unmap(container, iova, end - iova);

    memory_region_unref(section->mr);

    if (ret) {

        error_report("vfio_dma_unmap(%p, 0x%"HWADDR_PRIx", "

                     "0x%"HWADDR_PRIx") = %d (%m)",

                     container, iova, end - iova, ret);

    }

}

static void vfio_listener_region_del(MemoryListener *listener,

                                     MemoryRegionSection *section)

{

    VFIOContainer *container = container_of(listener, VFIOContainer,

                                            iommu_data.listener);

    hwaddr iova, end;

    int ret;



    if (vfio_listener_skipped_section(section)) {

        DPRINTF("SKIPPING region_del %"HWADDR_PRIx" - %"PRIx64"\n",

                section->offset_within_address_space,

                section->offset_within_address_space + section->size - 1);

        return;

    }



    if (unlikely((section->offset_within_address_space & ~TARGET_PAGE_MASK) !=

                 (section->offset_within_region & ~TARGET_PAGE_MASK))) {

        error_report("%s received unaligned region", __func__);

        return;

    }



    iova = TARGET_PAGE_ALIGN(section->offset_within_address_space);

    end = (section->offset_within_address_space + int128_get64(section->size)) &

          TARGET_PAGE_MASK;



    if (iova >= end) {

        return;

    }



    DPRINTF("region_del %"HWADDR_PRIx" - %"HWADDR_PRIx"\n",

            iova, end - 1);



    ret = vfio_dma_unmap(container, iova, end - iova);

    memory_region_unref(section->mr);

    if (ret) {

        error_report("vfio_dma_unmap(%p, 0x%"HWADDR_PRIx", "

                     "0x%"HWADDR_PRIx") = %d (%m)",

                     container, iova, end - iova, ret);

    }

}

                section->offset_within_address_space + section->size - 1);                 section->offset_within_address_space + section->size - 1);
static void FUNC_0(MemoryListener *VAR_0,

                                     MemoryRegionSection *VAR_1)

{

    VFIOContainer *container = container_of(VAR_0, VFIOContainer,

                                            iommu_data.VAR_0);

    hwaddr iova, end;

    int VAR_2;



    if (vfio_listener_skipped_section(VAR_1)) {

        DPRINTF("SKIPPING region_del %"HWADDR_PRIx" - %"PRIx64"\n",

                VAR_1->offset_within_address_space,

                VAR_1->offset_within_address_space + VAR_1->size - 1);

        return;

    }



    if (unlikely((VAR_1->offset_within_address_space & ~TARGET_PAGE_MASK) !=

                 (VAR_1->offset_within_region & ~TARGET_PAGE_MASK))) {

        error_report("%s received unaligned region", __func__);

        return;

    }



    iova = TARGET_PAGE_ALIGN(VAR_1->offset_within_address_space);

    end = (VAR_1->offset_within_address_space + int128_get64(VAR_1->size)) &

          TARGET_PAGE_MASK;



    if (iova >= end) {

        return;

    }



    DPRINTF("region_del %"HWADDR_PRIx" - %"HWADDR_PRIx"\n",

            iova, end - 1);



    VAR_2 = vfio_dma_unmap(container, iova, end - iova);

    memory_region_unref(VAR_1->mr);

    if (VAR_2) {

        error_report("vfio_dma_unmap(%p, 0x%"HWADDR_PRIx", "

                     "0x%"HWADDR_PRIx") = %d (%m)",

                     container, iova, end - iova, VAR_2);

    }

}

static void FUNC_0(MemoryListener *VAR_0,
MemoryRegionSection *VAR_1)
{ VFIOContainer *container = container_of(VAR_0, VFIOContainer,
iommu_data.VAR_0); hwaddr iova, end; int VAR_2; if (vfio_listener_skipped_section(VAR_1)) { DPRINTF("SKIPPING region_del %"HWADDR_PRIx" - %"PRIx64"\n",
VAR_1->offset_within_address_space,
VAR_1->offset_within_address_space + VAR_1->size - 1); return; } if (unlikely((VAR_1->offset_within_address_space & ~TARGET_PAGE_MASK) !=
(VAR_1->offset_within_region & ~TARGET_PAGE_MASK))) { error_report("%s received unaligned region", __func__); return; } iova = TARGET_PAGE_ALIGN(VAR_1->offset_within_address_space); end = (VAR_1->offset_within_address_space + int128_get64(VAR_1->size)) &
TARGET_PAGE_MASK; if (iova >= end) { return; } DPRINTF("region_del %"HWADDR_PRIx" - %"HWADDR_PRIx"\n",
iova, end - 1); VAR_2 = vfio_dma_unmap(container, iova, end - iova); memory_region_unref(VAR_1->mr); if (VAR_2) { error_report("vfio_dma_unmap(%p, 0x%"HWADDR_PRIx", "
"0x%"HWADDR_PRIx") = %d (%m)",
container, iova, end - iova, VAR_2); } }