[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZxsSYbK3gqyC84U7@Asurada-Nvidia>
Date: Thu, 24 Oct 2024 20:37:05 -0700
From: Nicolin Chen <nicolinc@...dia.com>
To: <jgg@...dia.com>, <kevin.tian@...el.com>, <will@...nel.org>
CC: <joro@...tes.org>, <suravee.suthikulpanit@....com>,
<robin.murphy@....com>, <dwmw2@...radead.org>, <baolu.lu@...ux.intel.com>,
<shuah@...nel.org>, <linux-kernel@...r.kernel.org>, <iommu@...ts.linux.dev>,
<linux-arm-kernel@...ts.infradead.org>, <linux-kselftest@...r.kernel.org>,
<eric.auger@...hat.com>, <jean-philippe@...aro.org>, <mdf@...nel.org>,
<mshavit@...gle.com>, <shameerali.kolothum.thodi@...wei.com>,
<smostafa@...gle.com>, <yi.l.liu@...el.com>, <aik@....com>,
<zhangfei.gao@...aro.org>, <patches@...ts.linux.dev>
Subject: Re: [PATCH v4 01/14] iommufd/viommu: Introduce IOMMUFD_OBJ_VDEVICE
and its related struct
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
Powered by blists - more mailing lists