[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6ff1216d-ef10-4948-a2e7-6c66627a024e@linux.intel.com>
Date: Wed, 23 Apr 2025 09:02:13 +0800
From: Baolu Lu <baolu.lu@...ux.intel.com>
To: Jason Gunthorpe <jgg@...pe.ca>
Cc: Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
Robin Murphy <robin.murphy@....com>, Kevin Tian <kevin.tian@...el.com>,
shangsong2@...ovo.com, Dave Jiang <dave.jiang@...el.com>,
iommu@...ts.linux.dev, linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH 1/1] iommu/vt-d: Assign owner to the static identity
domain
On 4/23/25 03:15, Jason Gunthorpe wrote:
> On Tue, Apr 22, 2025 at 03:54:22PM +0800, Lu Baolu wrote:
>
>> diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
>> index cb0b993bebb4..63c9c97ccf69 100644
>> --- a/drivers/iommu/intel/iommu.c
>> +++ b/drivers/iommu/intel/iommu.c
>> @@ -4385,6 +4385,7 @@ static struct iommu_domain identity_domain = {
>> .attach_dev = identity_domain_attach_dev,
>> .set_dev_pasid = identity_domain_set_dev_pasid,
>> },
>> + .owner = &intel_iommu_ops,
>> };
>
> Is this a systemic mistake in all the static domains in all the
> drivers?
Yes. The owner field is not set for all static domains.
> Maybe a bigger check is a more complete fix:
>
> static bool iommu_domain_compatible(struct device *dev,
> struct iommu_domain *domain)
> {
> const struct iommu_ops *ops = dev_iommu_ops(dev);
>
> if (domain->owner == ops)
> return true;
>
> /* For static domains owner isn't set */
> if (ops->blocked_domain == domain || ops->identity_domain == domain)
> return true;
> return false;
> }
That's better. I will post a v2 accordingly.
> Jason
Thanks,
baolu
Powered by blists - more mailing lists