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

From: Shameer Kolothum

Date: Fri Oct 31 2025 - 08:49:10 EST




> -----Original Message-----
> From: Nicolin Chen <nicolinc@xxxxxxxxxx>
> Sent: 24 October 2025 05:06
> To: Jason Gunthorpe <jgg@xxxxxxxxxx>; will@xxxxxxxxxx
> Cc: robin.murphy@xxxxxxx; joro@xxxxxxxxxx; kevin.tian@xxxxxxxxx;
> praan@xxxxxxxxxx; linux-arm-kernel@xxxxxxxxxxxxxxxxxxx;
> iommu@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Shameer Kolothum
> <skolothumtho@xxxxxxxxxx>
> Subject: [PATCH] iommu/arm-smmu-v3-iommufd: Allow attaching nested
> domain for GBPA cases
>
> A vDEVICE has been a hard requirement for attaching a nested domain to the
> device. This makes sense when installing a guest STE, since a vSID must be
> present and given to the kernel during the vDEVICE allocation.
>
> But, when CR0.SMMUEN is disabled, VM doesn't really need a vSID to
> program
> the vSMMU behavior as GBPA will take effect, in which case the vSTE in the
> nested domain could have carried the bypass or abort configuration in GBPA
> register. Thus, having such a hard requirement doesn't work well for GBPA.
>
> Add an additional condition in arm_smmu_attach_prepare_vmaster(), to
> allow
> a bypass or abort vSTE working for a GBPA setup. And do not forget to skip
> vsid=0 when reporting vevents, since the guest SMMU in this setup will not
> report event anyway.
>
> Update the uAPI doc accordingly.
>
> Signed-off-by: Nicolin Chen <nicolinc@xxxxxxxxxx>

Looks good to me. Also tested with Qemu SMMuv3 accel v5 series
here,
https://lore.kernel.org/qemu-devel/20251031105005.24618-1-skolothumtho@xxxxxxxxxx/

Tested-by: Shameer Kolothum <skolothumtho@xxxxxxxxxx>

Thanks,
Shameer