lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240119090502.3869695-3-li.meng@amd.com>
Date: Fri, 19 Jan 2024 17:04:57 +0800
From: Meng Li <li.meng@....com>
To: "Rafael J . Wysocki" <rafael.j.wysocki@...el.com>, Borislav Petkov
	<bpetkov@....com>, Huang Rui <ray.huang@....com>
CC: <linux-pm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<x86@...nel.org>, <linux-acpi@...r.kernel.org>, Shuah Khan
	<skhan@...uxfoundation.org>, <linux-kselftest@...r.kernel.org>, "Nathan
 Fontenot" <nathan.fontenot@....com>, Deepak Sharma <deepak.sharma@....com>,
	Alex Deucher <alexander.deucher@....com>, Mario Limonciello
	<mario.limonciello@....com>, Shimmer Huang <shimmer.huang@....com>, "Perry
 Yuan" <Perry.Yuan@....com>, Xiaojian Du <Xiaojian.Du@....com>, Viresh Kumar
	<viresh.kumar@...aro.org>, Borislav Petkov <bp@...en8.de>, "Oleksandr
 Natalenko" <oleksandr@...alenko.name>, Meng Li <li.meng@....com>, Wyes Karny
	<wyes.karny@....com>, Perry Yuan <perry.yuan@....com>
Subject: [PATCH V14 2/7] ACPI: CPPC: Add get the highest performance cppc control

Add support for getting the highest performance to the
generic CPPC driver. This enables downstream drivers
such as amd-pstate to discover and use these values.

Please refer to Chapter 8.4.6.1.1.1. Highest Performance
of ACPI Specification 6.5 for details on continuous
performance control of CPPC. Also see the Link below.

Tested-by: Oleksandr Natalenko <oleksandr@...alenko.name>
Reviewed-by: Mario Limonciello <mario.limonciello@....com>
Reviewed-by: Wyes Karny <wyes.karny@....com>
Reviewed-by: Perry Yuan <perry.yuan@....com>
Acked-by: Huang Rui <ray.huang@....com>
Signed-off-by: Meng Li <li.meng@....com>
Link: https://uefi.org/specs/ACPI/6.5/08_Processor_Configuration_and_Control.html?highlight=cppc#highest-performance
---
 drivers/acpi/cppc_acpi.c | 13 +++++++++++++
 include/acpi/cppc_acpi.h |  5 +++++
 2 files changed, 18 insertions(+)

diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index d155a86a8614..a50e70abdf19 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -1157,6 +1157,19 @@ int cppc_get_nominal_perf(int cpunum, u64 *nominal_perf)
 	return cppc_get_perf(cpunum, NOMINAL_PERF, nominal_perf);
 }
 
+/**
+ * cppc_get_highest_perf - Get the highest performance register value.
+ * @cpunum: CPU from which to get highest performance.
+ * @highest_perf: Return address.
+ *
+ * Return: 0 for success, -EIO otherwise.
+ */
+int cppc_get_highest_perf(int cpunum, u64 *highest_perf)
+{
+	return cppc_get_perf(cpunum, HIGHEST_PERF, highest_perf);
+}
+EXPORT_SYMBOL_GPL(cppc_get_highest_perf);
+
 /**
  * cppc_get_epp_perf - Get the epp register value.
  * @cpunum: CPU from which to get epp preference value.
diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h
index 3a0995f8bce8..930b6afba6f4 100644
--- a/include/acpi/cppc_acpi.h
+++ b/include/acpi/cppc_acpi.h
@@ -139,6 +139,7 @@ struct cppc_cpudata {
 #ifdef CONFIG_ACPI_CPPC_LIB
 extern int cppc_get_desired_perf(int cpunum, u64 *desired_perf);
 extern int cppc_get_nominal_perf(int cpunum, u64 *nominal_perf);
+extern int cppc_get_highest_perf(int cpunum, u64 *highest_perf);
 extern int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs);
 extern int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls);
 extern int cppc_set_enable(int cpu, bool enable);
@@ -167,6 +168,10 @@ static inline int cppc_get_nominal_perf(int cpunum, u64 *nominal_perf)
 {
 	return -ENOTSUPP;
 }
+static inline int cppc_get_highest_perf(int cpunum, u64 *highest_perf)
+{
+	return -ENOTSUPP;
+}
 static inline int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs)
 {
 	return -ENOTSUPP;
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ