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: <20240926025955.1728766-2-superm1@kernel.org>
Date: Wed, 25 Sep 2024 21:59:54 -0500
From: Mario Limonciello <superm1@...nel.org>
To: Shyam Sundar S K <Shyam-sundar.S-k@....com>,
	"Rafael J . Wysocki" <rafael@...nel.org>,
	Hans de Goede <hdegoede@...hat.com>,
	Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
	"Luke D . Jones" <luke@...nes.dev>,
	Mark Pearson <mpearson-lenovo@...ebb.ca>
Cc: platform-driver-x86@...r.kernel.org (open list:AMD PMF DRIVER),
	linux-kernel@...r.kernel.org (open list),
	linux-acpi@...r.kernel.org (open list:ACPI),
	"Derek J . Clark" <derekjohn.clark@...il.com>,
	Antheas Kapenekakis <lkml@...heas.dev>,
	me@...egospodneti.ch,
	Denis Benato <benato.denis96@...il.com>,
	Mario Limonciello <mario.limonciello@....com>
Subject: [RFC 1/2] ACPI: Add support for a 'custom' profile

From: Mario Limonciello <mario.limonciello@....com>

Introduce a new profile type called 'custom' that can be set to allow
changing settings outside of the standard profile settings.

The idea behind this is to enforce a state machine so that a user
can't set 'balanced' then manually change one APU setting and confuse
userspace because the system is no longer really behaving in balanced.

In practice the intention is that userspace would first set "custom"
followed by modifying any settings. If userspace wants to go back to
one of the predefined profiles then those profiles can be written to
/sys/firmware/acpi/platform_profile.

Signed-off-by: Mario Limonciello <mario.limonciello@....com>
---
 Documentation/ABI/testing/sysfs-platform_profile | 1 +
 drivers/acpi/platform_profile.c                  | 1 +
 include/linux/platform_profile.h                 | 1 +
 3 files changed, 3 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-platform_profile b/Documentation/ABI/testing/sysfs-platform_profile
index baf1d125f9f8..13dfe8aadbe2 100644
--- a/Documentation/ABI/testing/sysfs-platform_profile
+++ b/Documentation/ABI/testing/sysfs-platform_profile
@@ -15,6 +15,7 @@ Description:	This file contains a space-separated list of profiles supported for
 					power consumption with a slight bias
 					towards performance
 		performance		High performance operation
+		custom			Custom profile tuned by the user
 		====================	========================================
 
 		Userspace may expect drivers to offer more than one of these
diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
index d2f7fd7743a1..383f87c8c036 100644
--- a/drivers/acpi/platform_profile.c
+++ b/drivers/acpi/platform_profile.c
@@ -19,6 +19,7 @@ static const char * const profile_names[] = {
 	[PLATFORM_PROFILE_BALANCED] = "balanced",
 	[PLATFORM_PROFILE_BALANCED_PERFORMANCE] = "balanced-performance",
 	[PLATFORM_PROFILE_PERFORMANCE] = "performance",
+	[PLATFORM_PROFILE_CUSTOM] = "custom",
 };
 static_assert(ARRAY_SIZE(profile_names) == PLATFORM_PROFILE_LAST);
 
diff --git a/include/linux/platform_profile.h b/include/linux/platform_profile.h
index f5492ed413f3..61273b615419 100644
--- a/include/linux/platform_profile.h
+++ b/include/linux/platform_profile.h
@@ -23,6 +23,7 @@ enum platform_profile_option {
 	PLATFORM_PROFILE_BALANCED,
 	PLATFORM_PROFILE_BALANCED_PERFORMANCE,
 	PLATFORM_PROFILE_PERFORMANCE,
+	PLATFORM_PROFILE_CUSTOM,
 	PLATFORM_PROFILE_LAST, /*must always be last */
 };
 
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ