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: <20251119002119.GK120075@nvidia.com>
Date: Tue, 18 Nov 2025 20:21:19 -0400
From: Jason Gunthorpe <jgg@...dia.com>
To: Nicolin Chen <nicolinc@...dia.com>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@....com>,
	linux-kernel@...r.kernel.org, robin.murphy@....com, will@...nel.org,
	joro@...tes.org, kevin.tian@...el.com, jsnitsel@...hat.com,
	vasant.hegde@....com, iommu@...ts.linux.dev, santosh.shukla@....com,
	sairaj.arunkodilkar@....com, jon.grimm@....com,
	prashanthpra@...gle.com, wvw@...gle.com, wnliu@...gle.com,
	gptran@...gle.com, kpsingh@...gle.com, joao.m.martins@...cle.com,
	alejandro.j.jimenez@...cle.com
Subject: Re: [PATCH v5 13/14] iommu/amd: Refactor logic to program the host
 page table in DTE

On Thu, Nov 13, 2025 at 01:29:39PM -0800, Nicolin Chen wrote:
> On Thu, Nov 13, 2025 at 01:19:16PM -0800, Nicolin Chen wrote:
> > On Wed, Nov 12, 2025 at 06:25:05PM +0000, Suravee Suthikulpanit wrote:
> > >  	else {
> > > @@ -2097,35 +2115,29 @@ static void set_dte_entry(struct amd_iommu *iommu,
> > >  						       &pt_info);
> > >  			}
> > >  
> > > -			new.data[0] |= __sme_set(pt_info.host_pt_root) |
> > > -				       (pt_info.mode & DEV_ENTRY_MODE_MASK)
> > > -					       << DEV_ENTRY_MODE_SHIFT;
> > > +			pt_info.host_pt_root = __sme_set(pt_info.host_pt_root);
> > >  		}
> > >  	}
> > 
> > And this __IOMMU_DOMAIN_PAGING path seems to be used by v1 only.
> > So, it could be squashed into amd_iommu_set_dte_v1(). This could
> > tidy set_dte_entry() further.
> 
> Having looked at PATCH-14, I realized that amd_iommu_set_dte_v1()
> is shared with the nesting pathway.
> 
> So perhaps:
> 	else if (domain->domain.type & __IOMMU_DOMAIN_PAGING &&
> 		 domain->pd_mode == PD_MODE_V1) {
> 		struct pt_iommu_amdv1_hw_info pt_info;
> 
> 		....; // <--move here
> 		amd_iommu_set_dte_v1(dev_data, domain, domid, &pt_info, &new)
> 	} else

Even so it should be called from the set functions and the set
functions should sort it out, if another helper is needed to share
with nesting then fine, but you might also just have nesting call the
set_dte_v1 to start and then modify in the gcr3 table..

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ