diff options
author | Zenghui Yu | 2021-01-30 05:32:20 +0100 |
---|---|---|
committer | Peter Maydell | 2021-02-02 18:00:54 +0100 |
commit | dcda883cd21125c699419a3fc0fe182ea989d9c4 (patch) | |
tree | 4cf8ff2bf8419ed62c23e620528a0f89e98f922a | |
parent | hw/char/exynos4210_uart: Fix missing call to report ready for input (diff) | |
download | qemu-dcda883cd21125c699419a3fc0fe182ea989d9c4.tar.gz qemu-dcda883cd21125c699419a3fc0fe182ea989d9c4.tar.xz qemu-dcda883cd21125c699419a3fc0fe182ea989d9c4.zip |
hw/arm/smmuv3: Fix addr_mask for range-based invalidation
When handling guest range-based IOTLB invalidation, we should decode the TG
field into the corresponding translation granule size so that we can pass
the correct invalidation range to backend. Set @granule to (tg * 2 + 10) to
properly emulate the architecture.
Fixes: d52915616c05 ("hw/arm/smmuv3: Get prepared for range invalidation")
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
Acked-by: Eric Auger <eric.auger@redhat.com>
Message-id: 20210130043220.1345-1-yuzenghui@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | hw/arm/smmuv3.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c index bbca0e9f20..98b99d4fe8 100644 --- a/hw/arm/smmuv3.c +++ b/hw/arm/smmuv3.c @@ -801,7 +801,7 @@ static void smmuv3_notify_iova(IOMMUMemoryRegion *mr, { SMMUDevice *sdev = container_of(mr, SMMUDevice, iommu); IOMMUTLBEvent event; - uint8_t granule = tg; + uint8_t granule; if (!tg) { SMMUEventInfo event = {.inval_ste_allowed = true}; @@ -821,6 +821,8 @@ static void smmuv3_notify_iova(IOMMUMemoryRegion *mr, return; } granule = tt->granule_sz; + } else { + granule = tg * 2 + 10; } event.type = IOMMU_NOTIFIER_UNMAP; |