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: <19e39263-e408-4867-a080-d5f187095159@intel.com>
Date: Fri, 9 May 2025 17:15:47 +0800
From: Yi Liu <yi.l.liu@...el.com>
To: Wei Wang <wei.w.wang@...el.com>, <dwmw2@...radead.org>,
	<baolu.lu@...ux.intel.com>, <kevin.tian@...el.com>, <jroedel@...e.de>,
	<linux-kernel@...r.kernel.org>, <iommu@...ts.linux.dev>
Subject: Re: [PATCH v1 1/3] iommu/vt-d: Eliminate pci_physfn() in
 dmar_find_matched_satc_unit()

On 2025/5/9 22:00, Wei Wang wrote:
> The function dmar_find_matched_satc_unit() contains a duplicate call to
> pci_physfn(). This call is unnecessary as pci_physfn() has already been
> invoked by the caller. Removing the redundant call simplifies the code
> and improves efficiency a bit.
> 
> Signed-off-by: Wei Wang <wei.w.wang@...el.com>
> ---
>   drivers/iommu/intel/iommu.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
> index cb0b993bebb4..d8aa71305509 100644
> --- a/drivers/iommu/intel/iommu.c
> +++ b/drivers/iommu/intel/iommu.c
> @@ -2744,7 +2744,6 @@ static struct dmar_satc_unit *dmar_find_matched_satc_unit(struct pci_dev *dev)
>   	struct device *tmp;
>   	int i;
>   
> -	dev = pci_physfn(dev);

better have a comment to highlight the input dev should be PF. also, can
add a WARN_ON(dev->is_virtfn);

>   	rcu_read_lock();
>   
>   	list_for_each_entry_rcu(satcu, &dmar_satc_units, list) {

-- 
Regards,
Yi Liu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ