[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250422191554.GC1213339@ziepe.ca>
Date: Tue, 22 Apr 2025 16:15:54 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: Lu Baolu <baolu.lu@...ux.intel.com>
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 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?
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;
}
Jason
Powered by blists - more mailing lists