[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v2 01/28] hw/arm/smmu-common: Fix the name of the iomm
From: |
Eric Auger |
Subject: |
[Qemu-devel] [RFC v2 01/28] hw/arm/smmu-common: Fix the name of the iommu memory regions |
Date: |
Fri, 21 Sep 2018 10:17:52 +0200 |
At the point smmu_find_add_as() gets called, the bus number might
not be computed. Let's change the name of IOMMU memory region and
just use the devfn and an incrementing index.
The name only is used for debug.
Signed-off-by: Eric Auger <address@hidden>
---
hw/arm/smmu-common.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c
index 55c75d65d2..3f55cfd193 100644
--- a/hw/arm/smmu-common.c
+++ b/hw/arm/smmu-common.c
@@ -311,6 +311,7 @@ static AddressSpace *smmu_find_add_as(PCIBus *bus, void
*opaque, int devfn)
SMMUState *s = opaque;
SMMUPciBus *sbus = g_hash_table_lookup(s->smmu_pcibus_by_busptr, bus);
SMMUDevice *sdev;
+ static uint index;
if (!sbus) {
sbus = g_malloc0(sizeof(SMMUPciBus) +
@@ -321,9 +322,8 @@ static AddressSpace *smmu_find_add_as(PCIBus *bus, void
*opaque, int devfn)
sdev = sbus->pbdev[devfn];
if (!sdev) {
- char *name = g_strdup_printf("%s-%d-%d",
- s->mrtypename,
- pci_bus_num(bus), devfn);
+ char *name = g_strdup_printf("%s-%d-%d", s->mrtypename, devfn,
index++);
+
sdev = sbus->pbdev[devfn] = g_new0(SMMUDevice, 1);
sdev->smmu = s;
--
2.17.1
- [Qemu-devel] [RFC v2 00/28] vSMMUv3/pSMMUv3 2 stage VFIO integration, Eric Auger, 2018/09/21
- [Qemu-devel] [RFC v2 01/28] hw/arm/smmu-common: Fix the name of the iommu memory regions,
Eric Auger <=
- [Qemu-devel] [RFC v2 02/28] hw/arm/smmuv3: fix eventq recording and IRQ triggerring, Eric Auger, 2018/09/21
- [Qemu-devel] [RFC v2 05/28] memory: add IOMMU_ATTR_VFIO_NESTED IOMMU memory region attribute, Eric Auger, 2018/09/21
- [Qemu-devel] [RFC v2 04/28] linux-headers: Partial header update, Eric Auger, 2018/09/21
- [Qemu-devel] [RFC v2 03/28] update-linux-headers: Import iommu.h, Eric Auger, 2018/09/21
- [Qemu-devel] [RFC v2 06/28] hw/arm/smmuv3: Implement get_attr API to report IOMMU_ATTR_VFIO_NESTED, Eric Auger, 2018/09/21
- [Qemu-devel] [RFC v2 07/28] hw/vfio/common: Refactor container initialization, Eric Auger, 2018/09/21
- [Qemu-devel] [RFC v2 08/28] hw/vfio/common: Force nested if iommu requires it, Eric Auger, 2018/09/21
- [Qemu-devel] [RFC v2 09/28] memory: Introduce IOMMUIOLTBNotifier, Eric Auger, 2018/09/21
- [Qemu-devel] [RFC v2 10/28] memory: rename memory_region notify_iommu, notify_one, Eric Auger, 2018/09/21
- [Qemu-devel] [RFC v2 11/28] memory: Add IOMMUConfigNotifier, Eric Auger, 2018/09/21