lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250515192329.GA613512@nvidia.com>
Date: Thu, 15 May 2025 16:23:29 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Nicolin Chen <nicolinc@...dia.com>
Cc: kevin.tian@...el.com, corbet@....net, will@...nel.org,
	bagasdotme@...il.com, robin.murphy@....com, joro@...tes.org,
	thierry.reding@...il.com, vdumpa@...dia.com, jonathanh@...dia.com,
	shuah@...nel.org, jsnitsel@...hat.com, nathan@...nel.org,
	peterz@...radead.org, yi.l.liu@...el.com, mshavit@...gle.com,
	praan@...gle.com, zhangzekun11@...wei.com, iommu@...ts.linux.dev,
	linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org, linux-tegra@...r.kernel.org,
	linux-kselftest@...r.kernel.org, patches@...ts.linux.dev,
	mochs@...dia.com, alok.a.tiwari@...cle.com, vasant.hegde@....com
Subject: Re: [PATCH v4 18/23] iommu/arm-smmu-v3-iommufd: Support
 implementation-defined hw_info

On Thu, May 15, 2025 at 12:21:17PM -0700, Nicolin Chen wrote:
> On Thu, May 15, 2025 at 03:56:29PM -0300, Jason Gunthorpe wrote:
> > On Thu, May 15, 2025 at 11:52:05AM -0700, Nicolin Chen wrote:
> > > On Thu, May 15, 2025 at 02:17:06PM -0300, Jason Gunthorpe wrote:
> > > > On Thu, May 08, 2025 at 08:02:39PM -0700, Nicolin Chen wrote:
> > > Should the first call return out_data_type=CMDQV while returning
> > > the arm_smmu_v3 hw_info data? Otherwise, VMM wouldn't know what
> > > to set in the input sub_data_type of the 2nd ioctl?
> > 
> > No, either set a flag in the smmu_v3 hw_info, as you were doing here,
> > or just have the vmm probe it. Given the VMM is likely to be told to
> > run in vCMDQ mode on the command line try-and-fail doesn't sound so
> > bad.
> > 
> > And I guess we don't need a "sub type" just a "requested type" where 0
> > means return the best one and non-zero means return a specific one or
> > fail with EOPNOTSUPP.
> 
> OK. I think this would work:
> hw_info (req_type=0)     => out_data_type=SMMU_V3, flags=HAS_CMDQV
> hw_info (req_type=CMDQV) => out_data_type=CMDQV,   flags=0

Yeah

> Or, would it be simpler by having a sub_data_uptr:
> hw_info => out_data_type=SMMU_V3, sub_data_type=CMDQV,
>            data_uptr=iommu_hw_info_arm_smmuv3,
> 	   sub_data_uptr=iommu_hw_info_tegra241_cmdqv
> ?

I think the former is simpler to code, you can just add the req_type
to the signatures and if the driver comes back with a type != req_type
the core code will return EOPNOTSUPP

Then just match the impl_ops for req_type in the arm driver.

Finally we end up with only one ioctl enum number space for the
types, which seems appealing.

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ