public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Baolu Lu <baolu.lu@linux.intel.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Kevin Tian <kevin.tian@intel.com>,
	shangsong2@lenovo.com, Dave Jiang <dave.jiang@intel.com>,
	iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH 1/1] iommu/vt-d: Assign owner to the static identity domain
Date: Wed, 23 Apr 2025 09:02:13 +0800	[thread overview]
Message-ID: <6ff1216d-ef10-4948-a2e7-6c66627a024e@linux.intel.com> (raw)
In-Reply-To: <20250422191554.GC1213339@ziepe.ca>

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


      reply	other threads:[~2025-04-23  1:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-22  7:54 [PATCH 1/1] iommu/vt-d: Assign owner to the static identity domain Lu Baolu
2025-04-22 14:46 ` Dave Jiang
2025-04-22 19:15 ` Jason Gunthorpe
2025-04-23  1:02   ` Baolu Lu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ff1216d-ef10-4948-a2e7-6c66627a024e@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=dave.jiang@intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=shangsong2@lenovo.com \
    --cc=stable@vger.kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox