Re: [PATCH v7 12/14] iommu/arm-smmu-v3: Introduce struct arm_smmu_vmaster

Nicolin Chen
2025-02-25T17:22:30Z

On Tue, Feb 25, 2025 at 05:08:16PM +0000, Pranjal Shrivastava wrote:
> > @@ -824,6 +829,9 @@ struct arm_smmu_master {
> > struct arm_smmu_device *smmu;
> > struct device *dev;
> > struct arm_smmu_stream *streams;
> > +#ifdef CONFIG_ARM_SMMU_V3_IOMMUFD
> > + struct arm_smmu_vmaster *vmaster; /* use smmu->streams_mutex */
> > +#endif
> > /* Locked by the iommu core using the group mutex */
> > struct arm_smmu_ctx_desc_cfg cd_table;
> > unsigned int num_streams;
> > @@ -972,6 +980,9 @@ struct arm_smmu_attach_state {
> > bool disable_ats;
> > ioasid_t ssid;
> > /* Resulting state */
> > +#ifdef CONFIG_ARM_SMMU_V3_IOMMUFD
> > + struct arm_smmu_vmaster *vmaster;
> > +#endif
> > bool ats_enabled;
> > };
> >
>
> Umm.. I'm not too sure how I feel about these #ifdefs _between_ a struct
> definition. Given that currently, the arm_smmu_v3.h file doesn't have
> such `#ifdef CONFIG`s between structs. I'd say, in case
> CONFIG_ARM_SMMU_V3_IOMMUFD is turned off, we can simply leave the
> vmaster ptr NULL?

OK. Will drop..

Nicolin