]> git.ipfire.org Git - thirdparty/linux.git/commit
iommu/arm-smmu-v3-iommufd: Allow attaching nested domain for GBPA cases
authorNicolin Chen <nicolinc@nvidia.com>
Mon, 3 Nov 2025 17:27:55 +0000 (09:27 -0800)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 26 Nov 2025 18:04:04 +0000 (14:04 -0400)
commit81c45c62dc3eefd83af8eb8df10e45705e8e3a47
treed948cfd6840701a96dc9c2f89733fca4f188e192
parentac3fd01e4c1efce8f2c054cdeb2ddd2fc0fb150d
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.

Skip vmaster allocation in arm_smmu_attach_prepare_vmaster() for an abort
or bypass vSTE. Note that device on this attachment won't report vevents.

Update the uAPI doc accordingly.

Link: https://patch.msgid.link/r/20251103172755.2026145-1-nicolinc@nvidia.com
Tested-by: Shameer Kolothum <skolothumtho@nvidia.com>
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Pranjal Shrivastava <praan@google.com>
Tested-by: Shuai Xue <xueshuai@linux.alibaba.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c
include/uapi/linux/iommufd.h