diff options
| author | Nicolin Chen <nicolinc@nvidia.com> | 2026-03-17 00:59:20 -0700 |
|---|---|---|
| committer | Will Deacon <will@kernel.org> | 2026-03-19 15:08:21 +0000 |
| commit | e3a56b37bf7546ecde4332d70a5bd092b9fe061b (patch) | |
| tree | 377435b2ce148d79b0f036091558b264356f4a39 /tools/perf/scripts/python | |
| parent | 15a2a5645ad79df78965a7c49bdd4b6a63b2033a (diff) | |
iommu/arm-smmu-v3: Pre-allocate a per-master invalidation array
When a master is attached from an old domain to a new domain, it needs to
build an invalidation array to delete and add the array entries from/onto
the invalidation arrays of those two domains, passed via the to_merge and
to_unref arguments into arm_smmu_invs_merge/unref() respectively.
Since the master->num_streams might differ across masters, a memory would
have to be allocated when building an to_merge/to_unref array which might
fail with -ENOMEM.
On the other hand, an attachment to arm_smmu_blocked_domain must not fail
so it's the best to avoid any memory allocation in that path.
Pre-allocate a fixed size invalidation array for every master. This array
will be used as a scratch to fill dynamically when building a to_merge or
to_unref invs array. Sort fwspec->ids in an ascending order to fit to the
arm_smmu_invs_merge() function.
Co-developed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Pranjal Shrivastava <praan@google.com>
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
