ANDROID: vendor_hooks: Add vendor hook for GenieZone para-virtualization

Add interface for MTK GenieZone hypervisor not-yet upstreamed
para-virtualization.

Bug: 430175928
Signed-off-by: Yi-De Wu <yi-de.wu@mediatek.com>
Signed-off-by: Liju Chen <liju-clr.chen@mediatek.com>
Change-Id: I5341f7aa2d77fa27966689f5b3e1919461f056c1
This commit is contained in:
Yi-De Wu
2023-10-04 15:59:14 +08:00
committed by Treehugger Robot
parent d893caf112
commit 5c1cddc983
3 changed files with 22 additions and 2 deletions
+2
View File
@@ -75,6 +75,7 @@
#include <trace/hooks/ogki_honor.h> #include <trace/hooks/ogki_honor.h>
#include <trace/hooks/suspend.h> #include <trace/hooks/suspend.h>
#include <trace/hooks/user.h> #include <trace/hooks/user.h>
#include <trace/hooks/gzvm.h>
/* /*
* Export tracepoints that act as a bare tracehook (ie: have no trace event * Export tracepoints that act as a bare tracehook (ie: have no trace event
@@ -575,3 +576,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_shrink_node);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpuset_fork); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpuset_fork);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_uid); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_uid);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_user); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_user);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_gzvm_vcpu_exit_reason);
+3 -2
View File
@@ -9,9 +9,9 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <trace/events/geniezone.h>
#include <linux/soc/mediatek/gzvm_drv.h> #include <linux/soc/mediatek/gzvm_drv.h>
#include <trace/events/geniezone.h>
#include <trace/hooks/gzvm.h>
/* maximum size needed for holding an integer */ /* maximum size needed for holding an integer */
#define ITOA_MAX_LEN 12 #define ITOA_MAX_LEN 12
@@ -193,6 +193,7 @@ static long gzvm_vcpu_run(struct gzvm_vcpu *vcpu, void __user *argp)
pr_err("vcpu unknown exit\n"); pr_err("vcpu unknown exit\n");
need_userspace = true; need_userspace = true;
} }
trace_android_vh_gzvm_vcpu_exit_reason(vcpu, &need_userspace);
} }
if (copy_to_user(argp, vcpu->run, sizeof(struct gzvm_vcpu_run))) if (copy_to_user(argp, vcpu->run, sizeof(struct gzvm_vcpu_run)))
+17
View File
@@ -0,0 +1,17 @@
/* SPDX-License-Identifier: GPL-2.0 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM gzvm
#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_GZVM_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_GZVM_H
#include <trace/hooks/vendor_hooks.h>
struct gzvm_vcpu;
DECLARE_HOOK(android_vh_gzvm_vcpu_exit_reason,
TP_PROTO(struct gzvm_vcpu *vcpu, bool *userspace),
TP_ARGS(vcpu, userspace));
#endif /* _TRACE_HOOK_GZVM_H */
/* This part must be outside protection */
#include <trace/define_trace.h>