diff options
author | Eric Auger <eric.auger@redhat.com> | 2021-03-09 11:27:39 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2021-03-12 12:40:10 +0000 |
commit | a4b6e1be2c8fd60381feb00f06cf3b6373bbbf07 (patch) | |
tree | daf51f4a62a539130f88852a58f408ce6f15939b /hw | |
parent | dde3f08b5cab24e570fc0ccbbbab86b6b50aad23 (diff) | |
download | qemu-a4b6e1be2c8fd60381feb00f06cf3b6373bbbf07.zip qemu-a4b6e1be2c8fd60381feb00f06cf3b6373bbbf07.tar.gz qemu-a4b6e1be2c8fd60381feb00f06cf3b6373bbbf07.tar.bz2 |
hw/arm/smmu-common: Fix smmu_iotlb_inv_iova when asid is not set
If the asid is not set, do not attempt to locate the key directly
as all inserted keys have a valid asid.
Use g_hash_table_foreach_remove instead.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Message-id: 20210309102742.30442-5-eric.auger@redhat.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/arm/smmu-common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c index 405d5c5..e9ca3ae 100644 --- a/hw/arm/smmu-common.c +++ b/hw/arm/smmu-common.c @@ -151,7 +151,7 @@ inline void smmu_iotlb_inv_iova(SMMUState *s, int asid, dma_addr_t iova, uint8_t tg, uint64_t num_pages, uint8_t ttl) { - if (ttl && (num_pages == 1)) { + if (ttl && (num_pages == 1) && (asid >= 0)) { SMMUIOTLBKey key = smmu_get_iotlb_key(asid, iova, tg, ttl); g_hash_table_remove(s->iotlb, &key); |