[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZETh8ZBMtjUp7C9/@Asurada-Nvidia>
Date: Sun, 23 Apr 2023 00:44:49 -0700
From: Nicolin Chen <nicolinc@...dia.com>
To: Jason Gunthorpe <jgg@...dia.com>
CC: "Tian, Kevin" <kevin.tian@...el.com>,
"alex.williamson@...hat.com" <alex.williamson@...hat.com>,
"robin.murphy@....com" <robin.murphy@....com>,
"eric.auger@...hat.com" <eric.auger@...hat.com>,
"Liu, Yi L" <yi.l.liu@...el.com>,
"baolu.lu@...ux.intel.com" <baolu.lu@...ux.intel.com>,
"will@...nel.org" <will@...nel.org>,
"joro@...tes.org" <joro@...tes.org>,
"shameerali.kolothum.thodi@...wei.com"
<shameerali.kolothum.thodi@...wei.com>,
"jean-philippe@...aro.org" <jean-philippe@...aro.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RFC v2 0/3] Add set_dev_data and unset_dev_data support
On Fri, Apr 21, 2023 at 11:19:23AM -0700, Nicolin Chen wrote:
> On Fri, Apr 21, 2023 at 02:59:37PM -0300, Jason Gunthorpe wrote:
> > On Fri, Apr 21, 2023 at 10:37:22AM -0700, Nicolin Chen wrote:
> >
> > > How about the following piece? Needs a test with QEMU though..
> > >
> > > static const size_t iommufd_device_data_size[] = {
> > > [IOMMU_HW_INFO_TYPE_NONE] = 0,
> > > [IOMMU_HW_INFO_TYPE_INTEL_VTD] = 0,
> > > [IOMMU_HW_INFO_TYPE_ARM_SMMUV3] =
> > > sizeof(struct iommu_device_data_arm_smmuv3),
> > > };
> >
> > If we need more than one of these things we'll need a better
> > solution..
>
> How about adding ops->device_data_size to store the value?
https://lore.kernel.org/linux-iommu/cover.1682234302.git.nicolinc@nvidia.com/
I sent a v3 that includes this replacing the data_size array.
If it looks good, we can drop the other two data_size arrays
for hwpt in the nesting series too.
Thanks
Nic
Powered by blists - more mailing lists