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

Commit eee86f2a authored by Satya Durga Srinivasu Prabhala's avatar Satya Durga Srinivasu Prabhala
Browse files

soc: qcom: Add snapshot of hyp_core_ctl driver



This snapshot is taken from msm-4.14 as of commit 8b96a3b7b02d46e
("qcom: hyp_core_ctl: Add a debugfs interface to set reserve CPUs").

Change-Id: I0e05043fec6dae76818720b5e542f85f701dae05
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent e9e85b27
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -635,3 +635,12 @@ config QMP_DEBUGFS_CLIENT
	help
	  This options enables a driver which allows clients to send messages
	  to Alway On processor using QMP transport.

config QCOM_HYP_CORE_CTL
	bool "CPU reservation scheme for Hypervisor"
	depends on OKL4_GUEST
	help
	  This driver reserve the specified CPUS by isolating them. The reserved
	  CPUs can be assigned to the other guest OS by the hypervisor.
	  An offline CPU is considered as a reserved CPU since this OS can't use
	  it.
+1 −0
Original line number Diff line number Diff line
@@ -69,3 +69,4 @@ obj-$(CONFIG_QTI_RPM_STATS_LOG) += rpmh_master_stat.o
obj-$(CONFIG_QTI_RPM_STATS_LOG) += rpm_stats.o
obj-$(CONFIG_QCOM_MEM_OFFLINE) += mem-offline.o
obj-$(CONFIG_QMP_DEBUGFS_CLIENT) += qmp-debugfs-client.o
obj-$(CONFIG_QCOM_HYP_CORE_CTL) += hyp_core_ctl.o
+895 −0

File added.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ enum cpuhp_state {
	CPUHP_SLAB_PREPARE,
	CPUHP_MD_RAID5_PREPARE,
	CPUHP_RCUTREE_PREP,
	CPUHP_HYP_CORE_CTL_ISOLATION_DEAD,
	CPUHP_CORE_CTL_ISOLATION_DEAD,
	CPUHP_CPUIDLE_COUPLED_PREPARE,
	CPUHP_POWERPC_PMAC_PREPARE,
+72 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 *Copyright (c) 2018 The Linux Foundation. All rights reserved.
 */

#undef TRACE_SYSTEM
#define TRACE_SYSTEM hyp_core_ctl

#if !defined(_TRACE_HYP_CORE_CTL_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HYP_CORE_CTL_H

#include <linux/tracepoint.h>

TRACE_EVENT(hyp_core_ctl_enable,

	TP_PROTO(bool enable),

	TP_ARGS(enable),

	TP_STRUCT__entry(
		__field(bool, enable)
	),

	TP_fast_assign(
		__entry->enable = enable;
	),

	TP_printk("enable=%d", __entry->enable)
);

TRACE_EVENT(hyp_core_ctl_status,

	TP_PROTO(struct hyp_core_ctl_data *hcd, const char *event),

	TP_ARGS(hcd, event),

	TP_STRUCT__entry(
		__string(event, event)
		__array(char, reserve, 32)
		__array(char, reserved, 32)
		__array(char, our_isolated, 32)
		__array(char, online, 32)
		__array(char, isolated, 32)
		__array(char, thermal, 32)
	),

	TP_fast_assign(
		__assign_str(event, event);
		scnprintf(__entry->reserve, sizeof(__entry->reserve), "%*pbl",
			  cpumask_pr_args(&hcd->reserve_cpus));
		scnprintf(__entry->reserved, sizeof(__entry->reserve), "%*pbl",
			  cpumask_pr_args(&hcd->final_reserved_cpus));
		scnprintf(__entry->our_isolated, sizeof(__entry->reserve),
			  "%*pbl", cpumask_pr_args(&hcd->our_isolated_cpus));
		scnprintf(__entry->online, sizeof(__entry->reserve), "%*pbl",
			  cpumask_pr_args(cpu_online_mask));
		scnprintf(__entry->isolated, sizeof(__entry->reserve), "%*pbl",
			  cpumask_pr_args(cpu_isolated_mask));
		scnprintf(__entry->thermal, sizeof(__entry->reserve), "%*pbl",
			  cpumask_pr_args(cpu_cooling_get_max_level_cpumask()));
	),

	TP_printk("event=%s reserve=%s reserved=%s our_isolated=%s online=%s isolated=%s thermal=%s",
		  __get_str(event), __entry->reserve, __entry->reserved,
		  __entry->our_isolated, __entry->online, __entry->isolated,
		  __entry->thermal)
);

#endif /* _TRACE_HYP_CORE_CTL_H */

/* This part must be outside protection */
#include <trace/define_trace.h>