[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f4a17ceb-06cc-4ef9-93cf-430b60cb7599@linux.alibaba.com>
Date: Thu, 13 Nov 2025 12:58:13 +0800
From: Shuai Xue <xueshuai@...ux.alibaba.com>
To: Nicolin Chen <nicolinc@...dia.com>, jgg@...dia.com, will@...nel.org
Cc: robin.murphy@....com, joro@...tes.org, kevin.tian@...el.com,
praan@...gle.com, linux-arm-kernel@...ts.infradead.org,
iommu@...ts.linux.dev, linux-kernel@...r.kernel.org, skolothumtho@...dia.com
Subject: Re: [PATCH v2] iommu/arm-smmu-v3-iommufd: Allow attaching nested
domain for GBPA cases
在 2025/11/4 01:27, Nicolin Chen 写道:
> 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.
>
> Tested-by: Shameer Kolothum <skolothumtho@...dia.com>
> Signed-off-by: Nicolin Chen <nicolinc@...dia.com>
> ---
I've tested this patch and can confirm it resolves the GBPA hwpt
attachment issue.
Without this patch, IOMMUFD fails to attach bypass hwpt with the
following error:
smmu_reset_exit
qemu-system-aarch64: [iommufd=303] error attach 0008:01:00.0 (304) to id=6: No such file or directory
Failed to attach GBPA hwpt id 6 for dev id 1
With this patch applied, the attachment succeeds:
smmu_reset_exit
iommufd_cdev_attach_ioas_hwpt [iommufd=303] Successfully attached device 0008:01:00.0 (304) to id=6
Testing was performed on top of Shameer's vSMMU v5 series:
https://patchew.org/QEMU/20251031105005.24618-1-skolothumtho@nvidia.com/
Tested-by: Shuai Xue <xueshuai@...ux.alibaba.com>
Thanks.
Shuai
Powered by blists - more mailing lists