linux/drivers/vfio/iommufd.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2021-2022, NVIDIA CORPORATION & AFFILIATES
 */
#include <linux/vfio.h>
#include <linux/iommufd.h>

#include "vfio.h"

MODULE_IMPORT_NS();
MODULE_IMPORT_NS();

bool vfio_iommufd_device_has_compat_ioas(struct vfio_device *vdev,
					 struct iommufd_ctx *ictx)
{}

int vfio_df_iommufd_bind(struct vfio_device_file *df)
{}

int vfio_iommufd_compat_attach_ioas(struct vfio_device *vdev,
				    struct iommufd_ctx *ictx)
{}

void vfio_df_iommufd_unbind(struct vfio_device_file *df)
{}

struct iommufd_ctx *vfio_iommufd_device_ictx(struct vfio_device *vdev)
{}
EXPORT_SYMBOL_GPL();

static int vfio_iommufd_device_id(struct vfio_device *vdev)
{}

/*
 * Return devid for a device.
 *  valid ID for the device that is owned by the ictx
 *  -ENOENT = device is owned but there is no ID
 *  -ENODEV or other error = device is not owned
 */
int vfio_iommufd_get_dev_id(struct vfio_device *vdev, struct iommufd_ctx *ictx)
{}
EXPORT_SYMBOL_GPL();

/*
 * The physical standard ops mean that the iommufd_device is bound to the
 * physical device vdev->dev that was provided to vfio_init_group_dev(). Drivers
 * using this ops set should call vfio_register_group_dev()
 */
int vfio_iommufd_physical_bind(struct vfio_device *vdev,
			       struct iommufd_ctx *ictx, u32 *out_device_id)
{}
EXPORT_SYMBOL_GPL();

void vfio_iommufd_physical_unbind(struct vfio_device *vdev)
{}
EXPORT_SYMBOL_GPL();

int vfio_iommufd_physical_attach_ioas(struct vfio_device *vdev, u32 *pt_id)
{}
EXPORT_SYMBOL_GPL();

void vfio_iommufd_physical_detach_ioas(struct vfio_device *vdev)
{}
EXPORT_SYMBOL_GPL();

/*
 * The emulated standard ops mean that vfio_device is going to use the
 * "mdev path" and will call vfio_pin_pages()/vfio_dma_rw(). Drivers using this
 * ops set should call vfio_register_emulated_iommu_dev(). Drivers that do
 * not call vfio_pin_pages()/vfio_dma_rw() have no need to provide dma_unmap.
 */

static void vfio_emulated_unmap(void *data, unsigned long iova,
				unsigned long length)
{}

static const struct iommufd_access_ops vfio_user_ops =;

int vfio_iommufd_emulated_bind(struct vfio_device *vdev,
			       struct iommufd_ctx *ictx, u32 *out_device_id)
{}
EXPORT_SYMBOL_GPL();

void vfio_iommufd_emulated_unbind(struct vfio_device *vdev)
{}
EXPORT_SYMBOL_GPL();

int vfio_iommufd_emulated_attach_ioas(struct vfio_device *vdev, u32 *pt_id)
{}
EXPORT_SYMBOL_GPL();

void vfio_iommufd_emulated_detach_ioas(struct vfio_device *vdev)
{}
EXPORT_SYMBOL_GPL();