container-base.c (dd7d3e35401f80ffef4e209fa9e27db9087501b0) container-base.c (fdaa774e67435a328c0e28006c4d749f2198294a)
1/*
2 * VFIO BASE CONTAINER
3 *
4 * Copyright (C) 2023 Intel Corporation.
5 * Copyright Red Hat, Inc. 2023
6 *
7 * Authors: Yi Liu <yi.l.liu@intel.com>
8 * Eric Auger <eric.auger@redhat.com>

--- 58 unchanged lines hidden (view full) ---

67 VFIOBitmap *vbmap,
68 hwaddr iova, hwaddr size)
69{
70 g_assert(bcontainer->ops->query_dirty_bitmap);
71 return bcontainer->ops->query_dirty_bitmap(bcontainer, vbmap, iova, size);
72}
73
74void vfio_container_init(VFIOContainerBase *bcontainer, VFIOAddressSpace *space,
1/*
2 * VFIO BASE CONTAINER
3 *
4 * Copyright (C) 2023 Intel Corporation.
5 * Copyright Red Hat, Inc. 2023
6 *
7 * Authors: Yi Liu <yi.l.liu@intel.com>
8 * Eric Auger <eric.auger@redhat.com>

--- 58 unchanged lines hidden (view full) ---

67 VFIOBitmap *vbmap,
68 hwaddr iova, hwaddr size)
69{
70 g_assert(bcontainer->ops->query_dirty_bitmap);
71 return bcontainer->ops->query_dirty_bitmap(bcontainer, vbmap, iova, size);
72}
73
74void vfio_container_init(VFIOContainerBase *bcontainer, VFIOAddressSpace *space,
75 const VFIOIOMMUOps *ops)
75 const VFIOIOMMUClass *ops)
76{
77 bcontainer->ops = ops;
78 bcontainer->space = space;
79 bcontainer->error = NULL;
80 bcontainer->dirty_pages_supported = false;
81 bcontainer->dma_max_mappings = 0;
82 bcontainer->iova_ranges = NULL;
83 QLIST_INIT(&bcontainer->giommu_list);

--- 10 unchanged lines hidden (view full) ---

94 memory_region_unregister_iommu_notifier(
95 MEMORY_REGION(giommu->iommu_mr), &giommu->n);
96 QLIST_REMOVE(giommu, giommu_next);
97 g_free(giommu);
98 }
99
100 g_list_free_full(bcontainer->iova_ranges, g_free);
101}
76{
77 bcontainer->ops = ops;
78 bcontainer->space = space;
79 bcontainer->error = NULL;
80 bcontainer->dirty_pages_supported = false;
81 bcontainer->dma_max_mappings = 0;
82 bcontainer->iova_ranges = NULL;
83 QLIST_INIT(&bcontainer->giommu_list);

--- 10 unchanged lines hidden (view full) ---

94 memory_region_unregister_iommu_notifier(
95 MEMORY_REGION(giommu->iommu_mr), &giommu->n);
96 QLIST_REMOVE(giommu, giommu_next);
97 g_free(giommu);
98 }
99
100 g_list_free_full(bcontainer->iova_ranges, g_free);
101}
102
103static const TypeInfo types[] = {
104 {
105 .name = TYPE_VFIO_IOMMU,
106 .parent = TYPE_INTERFACE,
107 .class_size = sizeof(VFIOIOMMUClass),
108 },
109};
110
111DEFINE_TYPES(types)