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

Nicolin Chen
2025-03-11T17:43:29Z

On Tue, Mar 11, 2025 at 03:57:16PM +0000, Will Deacon wrote:
> On Tue, Feb 25, 2025 at 09:25:40AM -0800, Nicolin Chen wrote:
> > Use it to store all vSMMU-related data. The vsid (Virtual Stream ID) will
> > be the first use case. Since the vsid reader will be the eventq handler
> > that already holds a streams_mutex, reuse that to fenche the vmaster too.
>
> "fenche"?

fence :)

And I fixed other nits too.

> > +int arm_smmu_attach_prepare_vmaster(struct arm_smmu_attach_state *state,
> > + struct arm_smmu_nested_domain *nested_domain)
> > +{
> > + struct arm_smmu_vmaster *vmaster;
> > + unsigned long vsid;
> > + int ret;
> > +
> > + iommu_group_mutex_assert(state->master->dev);
> > +
> > + /* Skip invalid vSTE */
> > + if (!(nested_domain->ste[0] & cpu_to_le64(STRTAB_STE_0_V)))
> > + return 0;
>
> Ok, and we don't need to set 'state->vmaster' in this case because we
> only report stage-1 faults back to the vSMMU?

This is a good question that I didn't ask myself hard enough..

I think we should probably drop it. An invalid STE should trigger
a C_BAD_STE event that is in the supported vEVENT list. I'll run
some test before removing this line from v9.

> With the nits fixed:
>
> Acked-by: Will Deacon <will@kernel.org>

Thanks!
Nicolin