Re: [PATCH v3 21/22] iommu/amd: Add translation DTE and VFctrl TransDevID helpers
"Suthikulpanit, Suravee" <[email protected]>
| Newsgroups | dev.linux.lists.iommu,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On 7/7/2026 9:43 PM, Jason Gunthorpe wrote:
> On Mon, Jun 29, 2026 at 03:35:34PM +0000, Suravee Suthikulpanit wrote:
>> The hardware vIOMMU uses a per-VM translate device ID (TransDevID)
>> to
>
> per-viommu, the iommu drivers don't work with the concept of VM.
Updating this in v4
>> index the host device table when guest IOMMU traffic needs GPA->SPA
>> translation. The VF Control guest miscellaneous register tells the
>> IOMMU which TransDevID to use; the corresponding device table entry
>> (DTE) points at the nested IOMMU v1 page table that performs the walk
>> from guest physical to system physical addresses.
>
> A v1 page table is a "parent" not a nested
Updating this in v4
>> @@ -213,7 +213,12 @@ void amd_iommu_update_dte(struct amd_iommu *iommu,
>> struct dev_table_entry *new)
>> {
>> update_dte256(iommu, dev_data, new);
>> - clone_aliases(iommu, dev_data->dev);
>> + /*
>> + * The dev_data for trans_devid does not have struct dev.
>> + * So clone_aliases is not supported for translate-device-id.
>> + */
>> + if (dev_data->dev)
>> + clone_aliases(iommu, dev_data->dev);
>
> More junk from the ugly alias scheme :\ Maybe you should fix it
I will have a separate series to clean up all alias stuff after this series.
>> +int amd_iommu_set_translate_dte(struct amd_iommu *iommu,
>> + struct protection_domain *pdom,
>> + u16 gid, u32 trans_devid)
>> +{
>
> This should probably accept a viommu struct instead of all these arguments.
Note. I'll update this in v4.
Thanks,
Suravee