From: Sairaj Kodilkar <[email protected]> Following patch will create IVRS entries starting from the root bus
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.h | 3 +++ hw/i386/amd_iommu.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/hw/i386/amd_iommu.h b/hw/i386/amd_iommu.h index c5b346cc35..948d8611b1 100644 --- a/hw/i386/amd_iommu.h +++ b/hw/i386/amd_iommu.h @@ -388,6 +388,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); diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index b2df0e9533..14ea8274b2 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); -- MST
