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: <ZyEISs6uLbH+nCsi@Asurada-Nvidia>
Date: Tue, 29 Oct 2024 09:07:38 -0700
From: Nicolin Chen <nicolinc@...dia.com>
To: Jason Gunthorpe <jgg@...dia.com>
CC: Zhangfei Gao <zhangfei.gao@...aro.org>, <kevin.tian@...el.com>,
	<will@...nel.org>, <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>,
	<patches@...ts.linux.dev>
Subject: Re: [PATCH v5 06/13] iommufd: Allow pt_id to carry viommu_id for
 IOMMU_HWPT_ALLOC

On Tue, Oct 29, 2024 at 12:27:46PM -0300, Jason Gunthorpe wrote:
> On Mon, Oct 28, 2024 at 07:52:10AM -0700, Nicolin Chen wrote:
> > On Mon, Oct 28, 2024 at 10:03:09AM -0300, Jason Gunthorpe wrote:
> > In iommufd_hwpt_paging_alloc(), we reject IOMMU_HWPT_FAULT_ID_VALID:
> > 	const u32 valid_flags = IOMMU_HWPT_ALLOC_NEST_PARENT |
> > 				IOMMU_HWPT_ALLOC_DIRTY_TRACKING;
> > 	...
> > 	if (flags & ~valid_flags)
> > 		return ERR_PTR(-EOPNOTSUPP);
> > 
> > In iommufd_hwpt_nested_alloc(), we mask the flag away:
> > 	if ((flags & ~IOMMU_HWPT_FAULT_ID_VALID) ||
> > 	    !user_data->len || !ops->domain_alloc_user)
> > 		return ERR_PTR(-EOPNOTSUPP);
> > 	...
> > 	hwpt->domain = ops->domain_alloc_user(idev->dev,
> > 					      flags & ~IOMMU_HWPT_FAULT_ID_VALID,
> > 					      parent->common.domain, user_data);
> > 
> > Then, in the common function it has a section of
> > 	if (cmd->flags & IOMMU_HWPT_FAULT_ID_VALID) {
> > 	...
> > 
> > It seems that this IOMMU_HWPT_FAULT_ID_VALID is for nested domains?
> 
> OK, but ARM should be blocking it since it doesn't work there.
> 
> I think we made some error here, it should have been passed in flags
> to the drivers and only intel should have accepted it.

Trying to limit changes here since two parts are already quite
large, I think a separate series fixing that would be nicer? 

> This suggests we should send flags down the viommu alloc domain path too.

Ack. Will pass it in.

Thanks
Nicolin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ