Re: [PATCH v4 02/14] iommufd/viommu: Add IOMMU_VDEVICE_ALLOC ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2024/10/22 8:20, Nicolin Chen wrote:
Introduce a new ioctl to allocate a vDEVICE object. Since a vDEVICE object
is a connection of an iommufd_iommufd object and an iommufd_viommu object,

nit:

:s/iommufd_iommufd/iommufd_device/g

or not?

require both as the ioctl inputs and take refcounts in the ioctl handler.

Add to the vIOMMU object a "vdevs" xarray, indexed by a per-vIOMMU virtual
device ID, which can be:
  - Virtual StreamID on a nested ARM SMMUv3, an index to a Stream Table
  - Virtual DeviceID on a nested AMD IOMMU, an index to a Device Table
  - Virtual ID on a nested Intel VT-D IOMMU, an index to a Context Table

Then, let the idev structure hold the allocated vdev pointer with a proper
locking protection.

Signed-off-by: Nicolin Chen<nicolinc@xxxxxxxxxx>
---
  drivers/iommu/iommufd/iommufd_private.h |  12 +++
  include/linux/iommufd.h                 |   2 +
  include/uapi/linux/iommufd.h            |  26 ++++++
  drivers/iommu/iommufd/device.c          |  11 +++
  drivers/iommu/iommufd/main.c            |   7 ++
  drivers/iommu/iommufd/viommu.c          | 108 ++++++++++++++++++++++++
  6 files changed, 166 insertions(+)

Thanks,
baolu




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux