mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
ANDROID: iommu: Add vendor hook to select alloc_iova algorithm
Add a vendor hook that allows initializing the iovad->android_vendor_data1 field to indicate whether to use the first-fit or best-fit algorithm for this device when allocating IOVAs. Bug: 263499813 Bug: 190519428 Bug: 149544392 Change-Id: I0c894b32416a459d7a58aa076770daedcce67cc3 Signed-off-by: Sukadev Bhattiprolu <quic_sukadev@quicinc.com>
This commit is contained in:
committed by
Isaac Manjarres
parent
3f48f34ca5
commit
72b891ab7f
@@ -6,6 +6,10 @@
|
||||
* Copyright 2020 Google LLC
|
||||
*/
|
||||
|
||||
#ifndef __GENKSYSMS__
|
||||
#include <linux/iova.h>
|
||||
#endif
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
#include <linux/tracepoint.h>
|
||||
@@ -83,6 +87,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cgroup_attach);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_iommu_setup_dma_ops);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_iommu_iovad_alloc_iova);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_iommu_iovad_free_iova);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_iommu_iovad_init_alloc_algo);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ptype_head);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_allow_domain_state);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpuidle_psci_enter);
|
||||
|
||||
@@ -579,6 +579,9 @@ static int iommu_dma_init_domain(struct iommu_domain *domain, dma_addr_t base,
|
||||
}
|
||||
|
||||
init_iova_domain(iovad, 1UL << order, base_pfn);
|
||||
|
||||
trace_android_rvh_iommu_iovad_init_alloc_algo(dev, iovad);
|
||||
|
||||
ret = iova_domain_init_rcaches(iovad);
|
||||
if (ret)
|
||||
goto done_unlock;
|
||||
|
||||
@@ -23,6 +23,10 @@ DECLARE_HOOK(android_vh_iommu_iovad_free_iova,
|
||||
TP_PROTO(struct iova_domain *iovad, dma_addr_t iova, size_t size),
|
||||
TP_ARGS(iovad, iova, size));
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_iommu_iovad_init_alloc_algo,
|
||||
TP_PROTO(struct device *dev, struct iova_domain *iovad),
|
||||
TP_ARGS(dev, iovad), 1);
|
||||
|
||||
#endif /* _TRACE_HOOK_IOMMU_H */
|
||||
|
||||
/* This part must be outside protection */
|
||||
|
||||
Reference in New Issue
Block a user