OSDN Git Service

hw/arm/smmuv3: Enforce invalidation on a power of two range
authorEric Auger <eric.auger@redhat.com>
Tue, 9 Mar 2021 10:27:40 +0000 (11:27 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 12 Mar 2021 12:40:10 +0000 (12:40 +0000)
commit6d9cd115b9dfee08faef0f64c3b90ac5c79ededc
tree4584fc3f659b31a57a6e499d90baeb4e74b1fb6a
parenta4b6e1be2c8fd60381feb00f06cf3b6373bbbf07
hw/arm/smmuv3: Enforce invalidation on a power of two range

As of today, the driver can invalidate a number of pages that is
not a power of 2. However IOTLB unmap notifications and internal
IOTLB invalidations work with masks leading to erroneous
invalidations.

In case the range is not a power of 2, split invalidations into
power of 2 invalidations.

When looking for a single page entry in the vSMMU internal IOTLB,
let's make sure that if the entry is not found using a
g_hash_table_remove() we iterate over all the entries to find a
potential range that overlaps it.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Message-id: 20210309102742.30442-6-eric.auger@redhat.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/smmu-common.c
hw/arm/smmuv3.c