ANDROID: dma-ops: Add restricted vendor hook

Add a vendor hook to arch_setup_dma_ops to allow vendors to perform
any necessary post-actions on setting up DMA ops for a given device,
focusing mainly on enabling those to opt-in for the Cortex-A510
erratum 2454944.

Bug: 263236925

Change-Id: I6fd4d3a30829437fc113ec15ca2e5d060a38e60c
Signed-off-by: Beata Michalska <beata.michalska@arm.com>
This commit is contained in:
Beata Michalska
2022-12-20 20:29:23 +00:00
committed by Todd Kjos
parent 3c75a6fb7f
commit 9d2ec2e0b6
3 changed files with 25 additions and 0 deletions

View File

@@ -11,6 +11,7 @@
#include <xen/xen.h>
#include <xen/swiotlb-xen.h>
#include <trace/hooks/iommu.h>
#include <trace/hooks/dma_noalias.h>
#include <asm/cacheflush.h>
@@ -56,6 +57,9 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
trace_android_rvh_iommu_setup_dma_ops(dev, dma_base, size);
}
/* Allow vendor modules to opt-in for the 2454944 erratum workaround */
trace_android_rvh_setup_dma_ops(dev);
#ifdef CONFIG_XEN
if (xen_initial_domain())
dev->dma_ops = &xen_swiotlb_dma_ops;

View File

@@ -42,6 +42,7 @@
#include <trace/hooks/power.h>
#include <trace/hooks/fault.h>
#include <trace/hooks/iommu.h>
#include <trace/hooks/dma_noalias.h>
#include <trace/hooks/thermal.h>
#include <trace/hooks/ufshcd.h>
#include <trace/hooks/block.h>
@@ -210,6 +211,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_mem_abort);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_sp_pc_abort);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_setup_dma_ops);
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_alloc_iova);

View File

@@ -0,0 +1,19 @@
/* SPDX-License-Identifier: GPL-2.0 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM dma_noalias
#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_DMA_NOALIAS_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_DMA_NOALIAS_H
#include <trace/hooks/vendor_hooks.h>
DECLARE_RESTRICTED_HOOK(android_rvh_setup_dma_ops,
TP_PROTO(struct device *dev),
TP_ARGS(dev), 1);
#endif /*_TRACE_HOOK_DMA_NOALIAS_H */
/* This part must be outside protection */
#include <trace/define_trace.h>