[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 05/11] hw/arm/smmu-common: Manage IOTLB block entries
From: |
Peter Maydell |
Subject: |
Re: [PATCH v3 05/11] hw/arm/smmu-common: Manage IOTLB block entries |
Date: |
Fri, 10 Jul 2020 10:02:14 +0100 |
On Wed, 8 Jul 2020 at 15:19, Eric Auger <eric.auger@redhat.com> wrote:
>
> At the moment each entry in the IOTLB corresponds to a page sized
> mapping (4K, 16K or 64K), even if the page belongs to a mapped
> block. In case of block mapping this unefficiently consumes IOTLB
> entries.
>
> Change the value of the entry so that it reflects the actual
> mapping it belongs to (block or page start address and size).
>
> Also the level/tg of the entry is encoded in the key. In subsequent
> patches we will enable range invalidation. This latter is able
> to provide the level/tg of the entry.
>
> Encoding the level/tg directly in the key will allow to invalidate
> using g_hash_table_remove() when num_pages equals to 1.
Oh yes, and indentation looks a bit off in a couple of places:
> void smmu_iotlb_insert(SMMUState *bs, SMMUTransCfg *cfg, SMMUTLBEntry
> *entry);
> -SMMUIOTLBKey smmu_get_iotlb_key(uint16_t asid, uint64_t iova);
> +SMMUIOTLBKey smmu_get_iotlb_key(uint16_t asid, uint64_t iova,
> + uint8_t tg, uint8_t level);
here ^^
> -inline void smmu_iotlb_inv_iova(SMMUState *s, uint16_t asid, dma_addr_t iova)
> +static gboolean smmu_hash_remove_by_asid_iova(gpointer key, gpointer value,
> + gpointer user_data)
and here ^^
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
- [PATCH v3 04/11] hw/arm/smmu: Introduce SMMUTLBEntry for PTW and IOTLB value, Eric Auger, 2020/07/08
- [PATCH v3 10/11] hw/arm/smmuv3: Support HAD and advertise SMMUv3.1 support, Eric Auger, 2020/07/08
- [PATCH v3 08/11] hw/arm/smmuv3: Fix IIDR offset, Eric Auger, 2020/07/08