Commit c95856320a for qemu.org
commit c95856320a58585359342425d0e97f2e4c63e2d3
Author: Sairaj Kodilkar <sarunkod@amd.com>
Date: Wed Oct 14 11:04:28 2026 +0530
amd_iommu: Add support for get_x86_iommu callback
Return X86IOMMUState during get_x86_iommu callback.
Signed-off-by: Sairaj Kodilkar <sarunkod@amd.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20261014053433.24564-4-sarunkod@amd.com>
diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
index 817320c51c..b2df0e9533 100644
--- a/hw/i386/amd_iommu.c
+++ b/hw/i386/amd_iommu.c
@@ -2472,8 +2472,16 @@ static AddressSpace *amdvi_host_dma_iommu(PCIBus *bus, void *opaque, int devfn)
return &amdvi_dev_as->as;
}
+static int amdvi_get_x86_iommu(void *opaque, void **x86_iommu)
+{
+ AMDVIState *s = opaque;
+ *x86_iommu = X86_IOMMU_DEVICE(s);
+ return 0;
+}
+
static const PCIIOMMUOps amdvi_iommu_ops = {
.get_address_space = amdvi_host_dma_iommu,
+ .get_x86_iommu = amdvi_get_x86_iommu,
};
static const MemoryRegionOps mmio_mem_ops = {