Re: [PATCH v4 01/14] iommufd/viommu: Introduce IOMMUFD_OBJ_VDEVICE and its related struct

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

 



On Mon, Oct 21, 2024 at 05:20:10PM -0700, Nicolin Chen wrote:
>  struct iommufd_viommu_ops {
> +       struct iommufd_vdevice *(*vdevice_alloc)(struct iommufd_viommu *viommu,
> +                                                struct device *dev, u64 id);
> +       void (*vdevice_free)(struct iommufd_vdevice *vdev);
...
> +#define iommufd_vdevice_alloc(ictx, drv_struct, member)                        \
> +       ({                                                                     \
> +               static_assert(                                                 \
> +                       __same_type(struct iommufd_vdevice,                    \
> +                                   ((struct drv_struct *)NULL)->member));     \
> +               static_assert(offsetof(struct drv_struct, member.obj) == 0);   \
> +               container_of(_iommufd_object_alloc(ictx,                       \
> +                                                  sizeof(struct drv_struct),  \
> +                                                  IOMMUFD_OBJ_VDEVICE),       \
> +                            struct drv_struct, member.obj);                   \
> +       })

Per discussion in vIRQ series [1], we might not need to expose
struct iommufd_vdevice. So, dropping most of the changes here,
and moving iommufd_device to the private header.

[1] https://lore.kernel.org/linux-iommu/ZxlGfgfwrGZGIbeF@Asurada-Nvidia/

Nicolin




[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