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: <568FCD4B.4000807@iommu.org>
Date:	Fri, 8 Jan 2016 22:52:59 +0800
From:	Wan Zongshun <vw@...mu.org>
To:	Joerg Roedel <joro@...tes.org>, Wan ZongShun <mcuos.com@...il.com>
Cc:	Wan Zongshun <vincent.wan@....com>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	iommu@...ts.linux-foundation.org, Ray Huang <ray.huang@....com>,
	Borislav Petkov <bp@...e.de>, ken.xue@....com
Subject: Re: [PATCH 5/6] iommu/amd: Add support for non-pci devices


>>
>>
>> static bool check_device(struct device *dev)
>> {
>>          u16 devid;
>> ......
>>
>>          /* No PCI device */
>>          if (!dev_is_pci(dev) && (get_acpihid_device_id(dev, NULL) < 0))
>>                  return false;
>>
>>          devid = get_device_id(dev);
>
> That is true for this case, but the other call-sites of get_device_id()
> still have to care about a potential negative return value, right?
>

Actually I am supposing the '.add_device' will be the first called in 
iommu initializing stage, so I think as long as having no error of check 
device here, any call-sites of get_device_id() will be fine, because 
adding device successfully should be the pre-condition of any iommu 
function can be performed, please correct me.

static int amd_iommu_add_device(struct device *dev)
{
	struct iommu_dev_data *dev_data;
	struct iommu_domain *domain;
	struct amd_iommu *iommu;
	u16 devid;
	int ret;

	if (!check_device(dev) || get_dev_data(dev))
		return 0;

	devid = get_device_id(dev);
	iommu = amd_iommu_rlookup_table[devid];


Vincent.
>
> 	Joerg
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ