[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/5] hw/arm/virt: Let the virtio-iommu bypass MSIs
From: |
Eric Auger |
Subject: |
[PATCH 5/5] hw/arm/virt: Let the virtio-iommu bypass MSIs |
Date: |
Thu, 7 May 2020 16:32:01 +0200 |
At the moment the virtio-iommu translates MSI transactions.
This behavior is inherited from ARM SMMU. The virt machine
code knows where the guest MSI doorbells are so we can easily
declare those regions as VIRTIO_IOMMU_RESV_MEM_T_MSI. With that
setting the guest will not map MSIs through the IOMMU and those
transactions will be simply bypassed. The ITS does MSI translation
anyway.
Signed-off-by: Eric Auger <address@hidden>
---
hw/arm/virt.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 171e6908ec..6a041e97a5 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2138,6 +2138,11 @@ static void
virt_machine_device_pre_plug_cb(HotplugHandler *hotplug_dev,
{
if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) {
virt_memory_pre_plug(hotplug_dev, dev, errp);
+ } else if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_IOMMU_PCI)) {
+ /* we declare a VIRTIO_IOMMU_RESV_MEM_T_MSI region */
+ qdev_prop_set_uint32(dev, "len-reserved-regions", 1);
+ qdev_prop_set_string(dev, "reserved-regions[0]",
+ "0x8090000, 0x809FFFF, 1");
}
}
--
2.20.1
- [PATCH 3/5] virtio-iommu: Handle reserved regions in the translation process, (continued)