Re: [PATCH v3 05/11] iommu: Pass in a viommu pointer to domain_alloc_user op

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

 



On Thu, Oct 17, 2024 at 02:38:55PM -0300, Jason Gunthorpe wrote:
> On Thu, Oct 17, 2024 at 10:21:31AM -0700, Nicolin Chen wrote:
> > On Thu, Oct 17, 2024 at 01:51:51PM -0300, Jason Gunthorpe wrote:
> > > On Wed, Oct 09, 2024 at 09:38:05AM -0700, Nicolin Chen wrote:
> > > > With a viommu object wrapping a potentially shareable S2 domain, a nested
> > > > domain should be allocated by associating to a viommu instead.
> > > > 
> > > > For drivers without a viommu support, keep the parent domain input, which
> > > > should be just viommu->hwpt->common.domain otherwise.
> > > > 
> > > > Signed-off-by: Nicolin Chen <nicolinc@xxxxxxxxxx>
> > > > ---
> > > >  include/linux/iommu.h                       | 1 +
> > > >  drivers/iommu/amd/iommu.c                   | 1 +
> > > >  drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 1 +
> > > >  drivers/iommu/intel/iommu.c                 | 1 +
> > > >  drivers/iommu/iommufd/hw_pagetable.c        | 5 +++--
> > > >  drivers/iommu/iommufd/selftest.c            | 1 +
> > > >  6 files changed, 8 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/include/linux/iommu.h b/include/linux/iommu.h
> > > > index 3a50f57b0861..9105478bdbcd 100644
> > > > --- a/include/linux/iommu.h
> > > > +++ b/include/linux/iommu.h
> > > > @@ -573,6 +573,7 @@ struct iommu_ops {
> > > >  	struct iommu_domain *(*domain_alloc)(unsigned iommu_domain_type);
> > > >  	struct iommu_domain *(*domain_alloc_user)(
> > > >  		struct device *dev, u32 flags, struct iommu_domain *parent,
> > > > +		struct iommufd_viommu *viommu,
> > > >  		const struct iommu_user_data *user_data);
> > > 
> > > This re-enforces my feeling we should have made a
> > > domain_alloc_nested()..
> > 
> > That could make these changes slightly cleaner. Maybe adding a
> > small series prior to your initial nesting, and get it merged
> > quickly?
> 
> Maybe we should put an op on the viommu_ops to allocate a nested
> domain?
> 
> It make some sense and resolves my worries about checking for
> driver ownership.

Yea, that sounds a smart move to me! Will give it a try.

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