[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZK9cyDaFkAKc1SvJ@Asurada-Nvidia>
Date: Wed, 12 Jul 2023 19:09:12 -0700
From: Nicolin Chen <nicolinc@...dia.com>
To: Michael Shavit <mshavit@...gle.com>
CC: Will Deacon <will@...nel.org>, Robin Murphy <robin.murphy@....com>,
"Joerg Roedel" <joro@...tes.org>, <jean-philippe@...aro.org>,
<jgg@...dia.com>, <baolu.lu@...ux.intel.com>,
<linux-arm-kernel@...ts.infradead.org>, <iommu@...ts.linux.dev>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 07/13] iommu/arm-smmu-v3: Keep track of attached ssids
On Wed, Jun 21, 2023 at 02:37:19PM +0800, Michael Shavit wrote:
> +/* List of {masters, ssid} that a domain is attached to */
> +struct arm_smmu_attached_domain {
> + struct list_head domain_head;
> + struct arm_smmu_domain *domain;
> + struct arm_smmu_master *master;
> + int ssid;
> +};
> +
> /* SMMU private data for each master */
> struct arm_smmu_master {
> struct arm_smmu_device *smmu;
> struct device *dev;
> - struct arm_smmu_domain *domain;
> + struct arm_smmu_attached_domain non_pasid_domain;
> struct list_head domain_head;
> struct arm_smmu_stream *streams;
> struct arm_smmu_s1_cfg owned_s1_cfg;
> @@ -724,8 +732,8 @@ struct arm_smmu_domain {
>
> struct iommu_domain domain;
>
> - struct list_head devices;
> - spinlock_t devices_lock;
> + struct list_head attached_domains;
> + spinlock_t attached_domains_lock;
Yea, I think that this arm_smmu_attached_domain is similar to
the "subdomain" that I was talking about in the previous reply,
though having a list of attached domains under a domain doesn't
feel very clear.
Perhaps it would be good to have some renaming and kdoc too.
And since we have a group of subdomains that are simply indexed
by ssids, perhaps we can add an xarray to store a subdomain ptr
along with an ssid, replacing the list?
Thanks
Nicolin
Powered by blists - more mailing lists