[PATCH] iommu/arm-smmu-v3-iommufd: Allow attaching nested domain for GBPA cases

Nicolin Chen nicolinc at nvidia.com
Mon Nov 3 07:45:21 PST 2025


On Mon, Nov 03, 2025 at 02:29:34PM +0000, Pranjal Shrivastava wrote:
> On Thu, Oct 23, 2025 at 09:05:51PM -0700, Nicolin Chen wrote:
> >  int arm_smmu_attach_prepare_vmaster(struct arm_smmu_attach_state *state,
> >  				    struct arm_smmu_nested_domain *nested_domain)
> >  {
> > +	unsigned int cfg =
> > +		FIELD_GET(STRTAB_STE_0_CFG, le64_to_cpu(nested_domain->ste[0]));
> >  	struct arm_smmu_vmaster *vmaster;
> > -	unsigned long vsid;
> > +	unsigned long vsid = 0;
> 
> I'm a little confused here, can we not have a vDEVICE allocated with
> vSID = 0 ?

Ah, good catch..

> Perhaps a separate bool has_vdevice flag in struct arm_smmu_vmaster
> would be clearer and avoid this ambiguity, allowing vsid = 0 to be a
> valid ID for an allocated vdevice when user-space explicitly requests it?

Yes. I will send a v2.

Thanks
Nicolin



More information about the linux-arm-kernel mailing list