From: Sairaj Kodilkar <[email protected]> Return X86IOMMUState during get_x86_iommu callback.
Signed-off-by: Sairaj Kodilkar <[email protected]> Reviewed-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Message-ID: <[email protected]> --- hw/i386/amd_iommu.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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 = { -- MST
