ANDROID: iommu: Add restricted vendor hook

Add restricted vendor hook for arch_setup_dma_ops to allow vendor
enhancements. This needs to be restricted vendor hook as it is
doing GFP_KERNEL allocation which are non-atomic in nature.

Bug: 214353193
Change-Id: I45f8f0404a247b67fd07a6831ff813bbc50fbca2
Signed-off-by: Charan Teja Reddy <quic_charante@quicinc.com>
This commit is contained in:
Charan Teja Reddy
2022-01-17 12:58:20 +05:30
committed by Todd Kjos
parent 2aba795b31
commit 6a9ff8fa26
3 changed files with 6 additions and 0 deletions

View File

@@ -53,6 +53,7 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
if (iommu) { if (iommu) {
iommu_setup_dma_ops(dev, dma_base, size); iommu_setup_dma_ops(dev, dma_base, size);
trace_android_vh_iommu_setup_dma_ops(dev, dma_base, size); trace_android_vh_iommu_setup_dma_ops(dev, dma_base, size);
trace_android_rvh_iommu_setup_dma_ops(dev, dma_base, size);
} }
#ifdef CONFIG_XEN #ifdef CONFIG_XEN

View File

@@ -192,6 +192,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_die_kernel_fault);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_sea); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_sea);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_mem_abort); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_mem_abort);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_sp_pc_abort); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_sp_pc_abort);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_iommu_setup_dma_ops);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_iommu_setup_dma_ops); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_iommu_setup_dma_ops);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_iommu_alloc_iova); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_iommu_alloc_iova);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_iommu_iovad_alloc_iova); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_iommu_iovad_alloc_iova);

View File

@@ -12,6 +12,10 @@
#include <linux/tracepoint.h> #include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
DECLARE_RESTRICTED_HOOK(android_rvh_iommu_setup_dma_ops,
TP_PROTO(struct device *dev, u64 dma_base, u64 size),
TP_ARGS(dev, dma_base, size), 1);
DECLARE_HOOK(android_vh_iommu_setup_dma_ops, DECLARE_HOOK(android_vh_iommu_setup_dma_ops,
TP_PROTO(struct device *dev, u64 dma_base, u64 size), TP_PROTO(struct device *dev, u64 dma_base, u64 size),
TP_ARGS(dev, dma_base, size)); TP_ARGS(dev, dma_base, size));