[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251020121225.GK316284@nvidia.com>
Date: Mon, 20 Oct 2025 09:12:25 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Nicolin Chen <nicolinc@...dia.com>
Cc: kernel test robot <lkp@...el.com>, will@...nel.org,
oe-kbuild-all@...ts.linux.dev, jean-philippe@...aro.org,
robin.murphy@....com, joro@...tes.org, balbirs@...dia.com,
miko.lenczewski@....com, peterz@...radead.org, kevin.tian@...el.com,
praan@...gle.com, linux-arm-kernel@...ts.infradead.org,
iommu@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 5/7] iommu/arm-smmu-v3: Populate smmu_domain->invs
when attaching masters
On Fri, Oct 17, 2025 at 02:11:34PM -0700, Nicolin Chen wrote:
> On Sat, Oct 18, 2025 at 12:03:27AM +0800, kernel test robot wrote:
> > sparse warnings: (new ones prefixed by >>)
> > >> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c:3208:33: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct arm_smmu_invs **invs_ptr @@ got struct arm_smmu_invs [noderef] __rcu ** @@
> > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c:3208:33: sparse: expected struct arm_smmu_invs **invs_ptr
> > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c:3208:33: sparse: got struct arm_smmu_invs [noderef] __rcu **
> ...
> > > 3208 invst->invs_ptr = &new_smmu_domain->invs;
> ...
> > > 3247 rcu_assign_pointer(*invst->invs_ptr, invst->new_invs);
>
> Looks like we need:
>
> diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
> index 8906c1625f428..398d8beb8f862 100644
> --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
> +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
> @@ -1105,7 +1105,7 @@ static inline bool arm_smmu_master_canwbs(struct arm_smmu_master *master)
> * to_unref argument to an arm_smmu_invs_unref() call
> */
> struct arm_smmu_inv_state {
> - struct arm_smmu_invs **invs_ptr;
> + struct arm_smmu_invs __rcu **invs_ptr;
> struct arm_smmu_invs *old_invs;
> struct arm_smmu_invs *new_invs;
> };
Isn't it:
struct arm_smmu_invs * __rcu *invs_ptr;
This is a pointer to a rcu controlled pointer, not a rcu controlled
pointer to a pointer..
Jason
Powered by blists - more mailing lists