Following patch will create IVRS entries starting from the root bus Signed-off-by: Sairaj Kodilkar --- hw/i386/amd_iommu.c | 2 ++ hw/i386/amd_iommu.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 5c1fb0879c0f..5e4d5d1f1fcd 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -2713,6 +2713,8 @@ static void amdvi_sysbus_realize(DeviceState *dev, Error **errp) } } + s->root_bus = bus; + s->iotlb = g_hash_table_new_full(amdvi_iotlb_hash, amdvi_iotlb_equal, g_free, g_free); diff --git a/hw/i386/amd_iommu.h b/hw/i386/amd_iommu.h index 687691ec1cce..04a5bbd33740 100644 --- a/hw/i386/amd_iommu.h +++ b/hw/i386/amd_iommu.h @@ -373,6 +373,9 @@ struct AMDVIState { /* DMA address translation */ bool dma_remap; + + /* root bus to register IOMMU ops */ + PCIBus *root_bus; }; uint64_t amdvi_extended_feature_register(AMDVIState *s); -- 2.34.1