diff options
author | Eric Auger <eric.auger@redhat.com> | 2018-09-25 14:02:32 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2018-09-25 14:14:07 +0100 |
commit | 6ce9297be69be10465b556a4b3380f70634c16a7 (patch) | |
tree | 54335a99f32024c414a69bd3daeb8ddfbb23ccc0 /hw | |
parent | bb626e5b43df996a19b53cb6033b25d83f7b2e73 (diff) | |
download | qemu-6ce9297be69be10465b556a4b3380f70634c16a7.zip qemu-6ce9297be69be10465b556a4b3380f70634c16a7.tar.gz qemu-6ce9297be69be10465b556a4b3380f70634c16a7.tar.bz2 |
hw/arm/smmu-common: Fix the name of the iommu memory regions
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 <eric.auger@redhat.com>
Message-id: 20180921070138.10114-2-eric.auger@redhat.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
[PMM: changed 'uint' to 'unsigned int']
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/arm/smmu-common.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c index 55c75d6..bbf4b87 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 unsigned int 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; |