Re: [PATCH v2 21/26] iommu/amd: Map kvmfd to shared translate device ID for vIOMMU

From: Suthikulpanit, Suravee

Date: Thu Jun 18 2026 - 01:51:14 EST


Jason,

On 6/1/2026 8:35 PM, Jason Gunthorpe wrote:
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.

I will remove kvmfd stuff from this series, and decouple it from TransDevID management.

However, in upcoming series, when introduces vIOMMU EventLog and PPRLog virtualization support, we need kvm to get SVM AVIC information in order to setup extended interrupt remapping for EventLog and PPRLog interrupts. Any suggestions on how to achieve this if you do not want to pass kvmfd from userspace?

Thanks,
Suravee