mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
hw/arm/smmu: Introduce smmu_iotlb_inv_asid_vmid
Soon, Instead of doing TLB invalidation by ASID only, VMID will be also required. Add smmu_iotlb_inv_asid_vmid() which invalidates by both ASID and VMID. However, at the moment this function is only used in SMMU_CMD_TLBI_NH_ASID which is a stage-1 command, so passing VMID = -1 keeps the original behaviour. Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org> Reviewed-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Mostafa Saleh <smostafa@google.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 20240715084519.1189624-14-smostafa@google.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
1ea8a6f59b
commit
eb41313c4b
4 changed files with 16 additions and 10 deletions
|
@ -159,13 +159,14 @@ void smmu_iotlb_inv_all(SMMUState *s)
|
|||
g_hash_table_remove_all(s->iotlb);
|
||||
}
|
||||
|
||||
static gboolean smmu_hash_remove_by_asid(gpointer key, gpointer value,
|
||||
gpointer user_data)
|
||||
static gboolean smmu_hash_remove_by_asid_vmid(gpointer key, gpointer value,
|
||||
gpointer user_data)
|
||||
{
|
||||
int asid = *(int *)user_data;
|
||||
SMMUIOTLBPageInvInfo *info = (SMMUIOTLBPageInvInfo *)user_data;
|
||||
SMMUIOTLBKey *iotlb_key = (SMMUIOTLBKey *)key;
|
||||
|
||||
return SMMU_IOTLB_ASID(*iotlb_key) == asid;
|
||||
return (SMMU_IOTLB_ASID(*iotlb_key) == info->asid) &&
|
||||
(SMMU_IOTLB_VMID(*iotlb_key) == info->vmid);
|
||||
}
|
||||
|
||||
static gboolean smmu_hash_remove_by_vmid(gpointer key, gpointer value,
|
||||
|
@ -270,10 +271,15 @@ void smmu_iotlb_inv_ipa(SMMUState *s, int vmid, dma_addr_t ipa, uint8_t tg,
|
|||
&info);
|
||||
}
|
||||
|
||||
void smmu_iotlb_inv_asid(SMMUState *s, int asid)
|
||||
void smmu_iotlb_inv_asid_vmid(SMMUState *s, int asid, int vmid)
|
||||
{
|
||||
trace_smmu_iotlb_inv_asid(asid);
|
||||
g_hash_table_foreach_remove(s->iotlb, smmu_hash_remove_by_asid, &asid);
|
||||
SMMUIOTLBPageInvInfo info = {
|
||||
.asid = asid,
|
||||
.vmid = vmid,
|
||||
};
|
||||
|
||||
trace_smmu_iotlb_inv_asid_vmid(asid, vmid);
|
||||
g_hash_table_foreach_remove(s->iotlb, smmu_hash_remove_by_asid_vmid, &info);
|
||||
}
|
||||
|
||||
void smmu_iotlb_inv_vmid(SMMUState *s, int vmid)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue