Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2a5835b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "gpu: ion: add ftrace events for secure calls"

parents cb4e612b 1bd424de
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@
#include "msm_iommu_hw-v1.h"
#include "msm_iommu_priv.h"
#include <linux/qcom_iommu.h>
#include <trace/events/kmem.h>

/* bitmap of the page sizes currently supported */
#define MSM_IOMMU_PGSIZES	(SZ_4K | SZ_64K | SZ_1M | SZ_16M)
@@ -557,6 +558,9 @@ static int msm_iommu_sec_ptbl_map_range(struct msm_iommu_drvdata *iommu_drvdata,
		flush_va = pa_list;
	}

	trace_iommu_sec_ptbl_map_range_start(map.info.id, map.info.ctx_id, va,
								pa, len);

	/*
	 * Ensure that the buffer is in RAM by the time it gets to TZ
	 */
@@ -566,6 +570,10 @@ static int msm_iommu_sec_ptbl_map_range(struct msm_iommu_drvdata *iommu_drvdata,
	ret = scm_call(SCM_SVC_MP, IOMMU_SECURE_MAP2, &map, sizeof(map),
			&scm_ret, sizeof(scm_ret));
	kfree(pa_list);

	trace_iommu_sec_ptbl_map_range_end(map.info.id, map.info.ctx_id, va, pa,
									len);

	return ret;
}

+6 −1
Original line number Diff line number Diff line
@@ -518,8 +518,9 @@ static int ion_secure_cma_allocate(struct ion_heap *heap,
		return -ENOMEM;
	}


	trace_ion_secure_cma_allocate_start(heap->name, len, align, flags);
	buf = __ion_secure_cma_allocate(heap, buffer, len, align, flags);
	trace_ion_secure_cma_allocate_end(heap->name, len, align, flags);

	if (buf) {
		int ret;
@@ -529,7 +530,11 @@ static int ion_secure_cma_allocate(struct ion_heap *heap,
				__func__);
			ret = 1;
		} else {
			trace_ion_cp_secure_buffer_start(heap->name, len, align,
									flags);
			ret = msm_ion_secure_table(buf->table, 0, 0);
			trace_ion_cp_secure_buffer_end(heap->name, len, align,
									flags);
		}
		if (ret) {
			/*
+149 −0
Original line number Diff line number Diff line
@@ -695,8 +695,157 @@ TRACE_EVENT(ion_prefetching,
		__entry->len)
	);

DECLARE_EVENT_CLASS(ion_secure_cma_allocate,

	TP_PROTO(const char *heap_name,
		unsigned long len,
		unsigned long align,
		unsigned long flags),

	TP_ARGS(heap_name, len, align, flags),

	TP_STRUCT__entry(
		__field(const char *, heap_name)
		__field(unsigned long, len)
		__field(unsigned long, align)
		__field(unsigned long, flags)
		),

	TP_fast_assign(
		__entry->heap_name = heap_name;
		__entry->len = len;
		__entry->align = align;
		__entry->flags = flags;
		),

	TP_printk("heap_name=%s len=%lx align=%lx flags=%lx",
		__entry->heap_name,
		__entry->len,
		__entry->align,
		__entry->flags)
	);

DEFINE_EVENT(ion_secure_cma_allocate, ion_secure_cma_allocate_start,
	TP_PROTO(const char *heap_name,
		unsigned long len,
		unsigned long align,
		unsigned long flags),

	TP_ARGS(heap_name, len, align, flags)
	);

DEFINE_EVENT(ion_secure_cma_allocate, ion_secure_cma_allocate_end,
	TP_PROTO(const char *heap_name,
		unsigned long len,
		unsigned long align,
		unsigned long flags),

	TP_ARGS(heap_name, len, align, flags)
	);

DECLARE_EVENT_CLASS(ion_cp_secure_buffer,

	TP_PROTO(const char *heap_name,
		unsigned long len,
		unsigned long align,
		unsigned long flags),

	TP_ARGS(heap_name, len, align, flags),

	TP_STRUCT__entry(
		__field(const char *, heap_name)
		__field(unsigned long, len)
		__field(unsigned long, align)
		__field(unsigned long, flags)
		),

	TP_fast_assign(
		__entry->heap_name = heap_name;
		__entry->len = len;
		__entry->align = align;
		__entry->flags = flags;
		),

	TP_printk("heap_name=%s len=%lx align=%lx flags=%lx",
		__entry->heap_name,
		__entry->len,
		__entry->align,
		__entry->flags)
	);

DEFINE_EVENT(ion_cp_secure_buffer, ion_cp_secure_buffer_start,
	TP_PROTO(const char *heap_name,
		unsigned long len,
		unsigned long align,
		unsigned long flags),

	TP_ARGS(heap_name, len, align, flags)
	);

DEFINE_EVENT(ion_cp_secure_buffer, ion_cp_secure_buffer_end,
	TP_PROTO(const char *heap_name,
		unsigned long len,
		unsigned long align,
		unsigned long flags),

	TP_ARGS(heap_name, len, align, flags)
	);

DECLARE_EVENT_CLASS(iommu_sec_ptbl_map_range,

	TP_PROTO(int sec_id,
		int num,
		unsigned long va,
		unsigned int pa,
		size_t len),

	TP_ARGS(sec_id, num, va, pa, len),

	TP_STRUCT__entry(
		__field(int, sec_id)
		__field(int, num)
		__field(unsigned long, va)
		__field(unsigned int, pa)
		__field(size_t, len)
	),

	TP_fast_assign(
		__entry->sec_id = sec_id;
		__entry->num = num;
		__entry->va = va;
		__entry->pa = pa;
		__entry->len = len;
	),

	TP_printk("sec_id=%d num=%d va=%lx pa=%u len=%zu",
		__entry->sec_id,
		__entry->num,
		__entry->va,
		__entry->pa,
		__entry->len)
	);

DEFINE_EVENT(iommu_sec_ptbl_map_range, iommu_sec_ptbl_map_range_start,

	TP_PROTO(int sec_id,
		int num,
		unsigned long va,
		unsigned int pa,
		size_t len),

	TP_ARGS(sec_id, num, va, pa, len)
	);

DEFINE_EVENT(iommu_sec_ptbl_map_range, iommu_sec_ptbl_map_range_end,

	TP_PROTO(int sec_id,
		int num,
		unsigned long va,
		unsigned int pa,
		size_t len),

	TP_ARGS(sec_id, num, va, pa, len)
	);
#endif /* _TRACE_KMEM_H */

/* This part must be outside protection */