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: <20251119001805.GI120075@nvidia.com>
Date: Tue, 18 Nov 2025 20:18:05 -0400
From: Jason Gunthorpe <jgg@...dia.com>
To: Suravee Suthikulpanit <suravee.suthikulpanit@....com>
Cc: nicolinc@...dia.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 Wed, Nov 12, 2025 at 06:25:05PM +0000, Suravee Suthikulpanit wrote:

> @@ -2097,35 +2115,29 @@ static void set_dte_entry(struct amd_iommu *iommu,
>  	old_domid = READ_ONCE(dte->data[1]) & DTE_DOMID_MASK;
> -	new.data[1] |= domid;
> -
> -	set_dte_gcr3_table(iommu, dev_data, &new);
> +	if (gcr3_info && gcr3_info->gcr3_tbl)
> +		set_dte_gcr3_table(dev_data, &new);
> +	else if (domain->domain.type == IOMMU_DOMAIN_IDENTITY)
> +		set_dte_passthrough(dev_data, domain, &new);
> +	else if (domain->domain.type & __IOMMU_DOMAIN_PAGING &&

() around the & is kernel style I think

Otherwise this looks OK

Reviewed-by: Jason Gunthorpe <jgg@...dia.com>

In some future the set_dte_xx should be called from the domain attach
function that knows what kind of domain it is attaching already - ie
identity, v1, v2 all should have different attach functions.

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ