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]
Date: Wed, 24 Apr 2024 10:44:37 +0800
From: Baolu Lu <baolu.lu@...ux.intel.com>
To: "Tian, Kevin" <kevin.tian@...el.com>, Joerg Roedel <joro@...tes.org>,
 Will Deacon <will@...nel.org>, Robin Murphy <robin.murphy@....com>,
 Jason Gunthorpe <jgg@...pe.ca>
Cc: baolu.lu@...ux.intel.com, "Zhang, Tina" <tina.zhang@...el.com>,
 "Liu, Yi L" <yi.l.liu@...el.com>,
 "iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
 "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 01/12] iommu/vt-d: Add cache tag assignment interface

On 4/23/24 5:01 PM, Tian, Kevin wrote:
>> From: Lu Baolu <baolu.lu@...ux.intel.com>
>> Sent: Tuesday, April 16, 2024 4:07 PM
>>
>> @@ -1757,6 +1759,9 @@ int domain_attach_iommu(struct dmar_domain
>> *domain, struct intel_iommu *iommu)
>>   	unsigned long ndomains;
>>   	int num, ret = -ENOSPC;
>>
>> +	if (domain->domain.type == IOMMU_DOMAIN_SVA)
>> +		return 0;
>> +
>>   	info = kzalloc(sizeof(*info), GFP_KERNEL);
>>   	if (!info)
>>   		return -ENOMEM;
>> @@ -1804,6 +1809,9 @@ void domain_detach_iommu(struct dmar_domain
>> *domain, struct intel_iommu *iommu)
>>   {
>>   	struct iommu_domain_info *info;
>>
>> +	if (domain->domain.type == IOMMU_DOMAIN_SVA)
>> +		return;
>> +
>>   	spin_lock(&iommu->lock);
>>   	info = xa_load(&domain->iommu_array, iommu->seq_id);
>>   	if (--info->refcnt == 0) {
> 
> above two are not called for SVA. Why do they start checking
> SVA type now?

domain_detach_iommu() is called in remove_dev_pasid path which covers
SVA domain as well.

I am moving the check to the domain_attach/detach_iommu() helpers so
that the call sites could be generic. I will later move the domain ID
management to the cache tag code, this kind of check will be dropped
then.

Best regards,
baolu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ