iommufd.c (d59ca1ca17480fc776aa02bf536ca3c87dc79323) iommufd.c (8fe0ebe15d7775be72b1aaceb7405b68d3ec6368)
1/*
2 * iommufd container backend
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>

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

647hiod_iommufd_vfio_get_iova_ranges(HostIOMMUDevice *hiod)
648{
649 VFIODevice *vdev = hiod->agent;
650
651 g_assert(vdev);
652 return vfio_container_get_iova_ranges(vdev->bcontainer);
653}
654
1/*
2 * iommufd container backend
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>

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

647hiod_iommufd_vfio_get_iova_ranges(HostIOMMUDevice *hiod)
648{
649 VFIODevice *vdev = hiod->agent;
650
651 g_assert(vdev);
652 return vfio_container_get_iova_ranges(vdev->bcontainer);
653}
654
655static uint64_t
656hiod_iommufd_vfio_get_page_size_mask(HostIOMMUDevice *hiod)
657{
658 VFIODevice *vdev = hiod->agent;
659
660 g_assert(vdev);
661 return vfio_container_get_page_size_mask(vdev->bcontainer);
662}
663
664
655static void hiod_iommufd_vfio_class_init(ObjectClass *oc, void *data)
656{
657 HostIOMMUDeviceClass *hiodc = HOST_IOMMU_DEVICE_CLASS(oc);
658
659 hiodc->realize = hiod_iommufd_vfio_realize;
660 hiodc->get_iova_ranges = hiod_iommufd_vfio_get_iova_ranges;
665static void hiod_iommufd_vfio_class_init(ObjectClass *oc, void *data)
666{
667 HostIOMMUDeviceClass *hiodc = HOST_IOMMU_DEVICE_CLASS(oc);
668
669 hiodc->realize = hiod_iommufd_vfio_realize;
670 hiodc->get_iova_ranges = hiod_iommufd_vfio_get_iova_ranges;
671 hiodc->get_page_size_mask = hiod_iommufd_vfio_get_page_size_mask;
661};
662
663static const TypeInfo types[] = {
664 {
665 .name = TYPE_VFIO_IOMMU_IOMMUFD,
666 .parent = TYPE_VFIO_IOMMU,
667 .instance_size = sizeof(VFIOIOMMUFDContainer),
668 .class_init = vfio_iommu_iommufd_class_init,
669 }, {
670 .name = TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO,
671 .parent = TYPE_HOST_IOMMU_DEVICE_IOMMUFD,
672 .class_init = hiod_iommufd_vfio_class_init,
673 }
674};
675
676DEFINE_TYPES(types)
672};
673
674static const TypeInfo types[] = {
675 {
676 .name = TYPE_VFIO_IOMMU_IOMMUFD,
677 .parent = TYPE_VFIO_IOMMU,
678 .instance_size = sizeof(VFIOIOMMUFDContainer),
679 .class_init = vfio_iommu_iommufd_class_init,
680 }, {
681 .name = TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO,
682 .parent = TYPE_HOST_IOMMU_DEVICE_IOMMUFD,
683 .class_init = hiod_iommufd_vfio_class_init,
684 }
685};
686
687DEFINE_TYPES(types)