Commit ad94458edd for qemu.org

commit ad94458edda26e26fb0c73e682245fd880e2d613
Author: Sairaj Kodilkar <sarunkod@amd.com>
Date:   Wed Oct 14 11:04:29 2026 +0530

    intel_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: Clement Mathieu--Drif <clement.mathieu--drif@bull.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Message-ID: <20261014053433.24564-5-sarunkod@amd.com>

diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 350d2b7753..3686ca8ba7 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -5485,6 +5485,13 @@ out:
     return ret;
 }

+static int vtd_get_x86_iommu(void *opaque, void **x86_iommu)
+{
+    IntelIOMMUState *s = opaque;
+    *x86_iommu = X86_IOMMU_DEVICE(s);
+    return 0;
+}
+
 static void vtd_init_iotlb_notifier(PCIBus *bus, void *opaque, int devfn,
                                     IOMMUNotifier *n, IOMMUNotify fn,
                                     void *user_opaque)
@@ -5559,6 +5566,7 @@ static PCIIOMMUOps vtd_iommu_ops = {
     .pri_unregister_notifier = vtd_pri_unregister_notifier,
     .pri_request_page = vtd_pri_request_page,
     .get_viommu_flags = vtd_get_viommu_flags,
+    .get_x86_iommu = vtd_get_x86_iommu,
 };

 static bool vtd_decide_config(IntelIOMMUState *s, Error **errp)