Re: [PATCH v2 21/26] iommu/amd: Map kvmfd to shared translate device ID for vIOMMU
From: Jason Gunthorpe
Date: Mon Jun 01 2026 - 09:40:36 EST
On Thu, May 28, 2026 at 05:17:33AM +0000, Suravee Suthikulpanit wrote:
> Add per-PCI-segment kvmfd xarray amd_iommu_kvmfd_trans_entry with
> refcounted so all vIOMMUs for one VM share one translate-device-id and
> GPA->SPA DTE.
What? There should no KVM in the viommu implementation.
I can't understand why you did this.
AFAICT the HW needs some unused devid "TransDevID" for some
purpose. This is pretty sketchy, but OK..
The ID should be affiliated with every nest parent domain, or maybe
every vIOMMU.
It has nothing to do with KVM. You can't assume anything about iommufd
is constructing the viommu based on the KVM.
The only acceptable use of KVM in iommufd land is to get some CPU
specific shared information which this is not doing.
So no to any KVM stuff in this series.
In an AMD system there should be exactly one viommu per kvm per
physical instance anyhow.
Jsaon