[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 07/11] hw/arm/smmuv3: Get prepared for range invalidation
From: |
Peter Maydell |
Subject: |
Re: [PATCH v3 07/11] hw/arm/smmuv3: Get prepared for range invalidation |
Date: |
Fri, 10 Jul 2020 10:06:42 +0100 |
On Wed, 8 Jul 2020 at 15:19, Eric Auger <eric.auger@redhat.com> wrote:
>
> Enhance the smmu_iotlb_inv_iova() helper with range invalidation.
> This uses the new fields passed in the NH_VA and NH_VAA commands:
> the size of the range, the level and the granule.
>
> As NH_VA and NH_VAA both use those fields, their decoding and
> handling is factorized in a new smmuv3_s1_range_inval() helper.
>
> Signed-off-by: Eric Auger <eric.auger@redhat.com>
> ---
> -inline void smmu_iotlb_inv_iova(SMMUState *s, int asid, dma_addr_t iova)
> +inline void
> +smmu_iotlb_inv_iova(SMMUState *s, int asid, dma_addr_t iova,
> + uint8_t tg, uint64_t num_pages, uint8_t ttl)
> {
> - SMMUIOTLBPageInvInfo info = {.asid = asid, .iova = iova};
> + if (ttl && (num_pages == 1)) {
> + SMMUIOTLBKey key = smmu_get_iotlb_key(asid, iova, tg, ttl);
>
> - trace_smmu_iotlb_inv_iova(asid, iova);
> - g_hash_table_foreach_remove(s->iotlb, smmu_hash_remove_by_asid_iova,
> &info);
> + g_hash_table_remove(s->iotlb, &key);
> + } else {
> + /* if tg is not set we use 4KB range invalidation */
Over-indented here.
> + uint8_t granule = tg ? tg * 2 + 10 : 12;
> +
> + SMMUIOTLBPageInvInfo info = {
> + .asid = asid, .iova = iova,
> + .mask = (num_pages * 1 << granule) - 1};
> +
> + g_hash_table_foreach_remove(s->iotlb,
> + smmu_hash_remove_by_asid_iova,
> + &info);
> + }
>
Otherwise
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
- [PATCH v3 00/11] SMMUv3.2 Range-based TLB Invalidation Support, Eric Auger, 2020/07/08
- [PATCH v3 05/11] hw/arm/smmu-common: Manage IOTLB block entries, Eric Auger, 2020/07/08
- [PATCH v3 03/11] hw/arm/smmu: Introduce smmu_get_iotlb_key(), Eric Auger, 2020/07/08
- [PATCH v3 01/11] hw/arm/smmu-common: Factorize some code in smmu_ptw_64(), Eric Auger, 2020/07/08
- [PATCH v3 02/11] hw/arm/smmu-common: Add IOTLB helpers, Eric Auger, 2020/07/08
- [PATCH v3 07/11] hw/arm/smmuv3: Get prepared for range invalidation, Eric Auger, 2020/07/08
- Re: [PATCH v3 07/11] hw/arm/smmuv3: Get prepared for range invalidation,
Peter Maydell <=
- [PATCH v3 10/11] hw/arm/smmuv3: Support HAD and advertise SMMUv3.1 support, Eric Auger, 2020/07/08
- [PATCH v3 04/11] hw/arm/smmu: Introduce SMMUTLBEntry for PTW and IOTLB value, Eric Auger, 2020/07/08
- [PATCH v3 09/11] hw/arm/smmuv3: Let AIDR advertise SMMUv3.0 support, Eric Auger, 2020/07/08
- [PATCH v3 08/11] hw/arm/smmuv3: Fix IIDR offset, Eric Auger, 2020/07/08
- [PATCH v3 11/11] hw/arm/smmuv3: Advertise SMMUv3.2 range invalidation, Eric Auger, 2020/07/08