Re: [PATCH v3 3/7] iommu/arm-smmu-v3: Introduce a per-domain arm_smmu_invs array

Nicolin Chen
2025-10-17T20:12:50Z

On Fri, Oct 17, 2025 at 09:47:07PM +0800, kernel test robot wrote:
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c: note: in included file:
> >> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h:1048:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct callback_head *head @@ got struct callback_head [noderef] __rcu * @@
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h:1048:9: sparse: expected struct callback_head *head
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h:1048:9: sparse: got struct callback_head [noderef] __rcu *
> >> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h:1048:9: sparse: sparse: cast removes address space '__rcu' of expression
...
> 1045
> 1046 static inline void arm_smmu_domain_free(struct arm_smmu_domain *smmu_domain)
> 1047 {
> > 1048 kfree_rcu(smmu_domain->invs, rcu);

Looks like it should be:
static inline void arm_smmu_domain_free(struct arm_smmu_domain *smmu_domain)
{
- kfree_rcu(smmu_domain->invs, rcu);
+ struct arm_smmu_invs *invs = rcu_dereference(smmu_domain->invs);
+
+ kfree_rcu(invs, rcu);
kfree(smmu_domain);
}

Will fix.

Thanks
Nicolin