[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 4/7] hw/arm/smmu-common: Fix smmu_iotlb_inv_iova when asid is
From: |
Eric Auger |
Subject: |
[PATCH v3 4/7] hw/arm/smmu-common: Fix smmu_iotlb_inv_iova when asid is not set |
Date: |
Tue, 9 Mar 2021 11:27:39 +0100 |
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>
---
hw/arm/smmu-common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c
index 405d5c5325..e9ca3aebb2 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);
--
2.26.2
- [PATCH v3 0/7] Some vIOMMU fixes, Eric Auger, 2021/03/09
- [PATCH v3 1/7] intel_iommu: Fix mask may be uninitialized in vtd_context_device_invalidate, Eric Auger, 2021/03/09
- [PATCH v3 3/7] virtio-iommu: Handle non power of 2 range invalidations, Eric Auger, 2021/03/09
- [PATCH v3 2/7] dma: Introduce dma_aligned_pow2_mask(), Eric Auger, 2021/03/09
- [PATCH v3 4/7] hw/arm/smmu-common: Fix smmu_iotlb_inv_iova when asid is not set,
Eric Auger <=
- [PATCH v3 5/7] hw/arm/smmuv3: Enforce invalidation on a power of two range, Eric Auger, 2021/03/09
- [PATCH v3 6/7] hw/arm/smmuv3: Fix SMMU_CMD_CFGI_STE_RANGE handling, Eric Auger, 2021/03/09
- [PATCH v3 7/7] hw/arm/smmuv3: Uniformize sid traces, Eric Auger, 2021/03/09
- Re: [PATCH v3 0/7] Some vIOMMU fixes, Peter Maydell, 2021/03/11