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>] [day] [month] [year] [list]
Message-ID: <20250128141139.2033088-1-darcari@redhat.com>
Date: Tue, 28 Jan 2025 09:11:39 -0500
From: David Arcari <darcari@...hat.com>
To: linux-pm@...r.kernel.org
Cc: David Arcari <darcari@...hat.com>,
	Jonathan Corbet <corbet@....net>,
	Jacob Pan <jacob.jun.pan@...ux.intel.com>,
	Len Brown <lenb@...nel.org>,
	Prarit Bhargava <prarit@...hat.com>,
	linux-doc@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] intel_idle: introduce 'use_acpi_cst' module parameter

Since commit 18734958e9bf ("intel_idle: Use ACPI _CST for processor models
without C-state tables")the intel_idle driver has had the ability to use
the ACPI _CST to populate C-states when the processor model is not
recognized. However, even when the processor model is recognized there are
cases where it is useful to make the driver ignore the per cpu idle states
in lieu of ACPI C-states (such as specific application performance). Add
the 'use_acpi_cst' module parameter to provide this functionality (not to
be confused with the 'use_acpi' module parameter which has a different
function).

Cc: Jonathan Corbet <corbet@....net>
Cc: Jacob Pan <jacob.jun.pan@...ux.intel.com>
Cc: Len Brown <lenb@...nel.org>
Cc: David Arcari <darcari@...hat.com>
Cc: Prarit Bhargava <prarit@...hat.com>
Cc: linux-doc@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Signed-off-by: David Arcari <darcari@...hat.com>
---
 Documentation/admin-guide/pm/intel_idle.rst |  5 +++++
 drivers/idle/intel_idle.c                   | 11 +++++++++++
 2 files changed, 16 insertions(+)

diff --git a/Documentation/admin-guide/pm/intel_idle.rst b/Documentation/admin-guide/pm/intel_idle.rst
index 39bd6ecce7de..a87238bcf33d 100644
--- a/Documentation/admin-guide/pm/intel_idle.rst
+++ b/Documentation/admin-guide/pm/intel_idle.rst
@@ -198,6 +198,11 @@ driver ignore the system's ACPI tables entirely or use them for all of the
 recognized processor models, respectively (they both are unset by default and
 ``use_acpi`` has no effect if ``no_acpi`` is set).
 
+The ``use_acpi_cst`` module parameter (recognized by ``intel_idle`` if the
+kernel has been configured with ACPI support) can be set to make the driver
+ignore the per cpu idle states in lieu of ACPI idle states. ``use_acpi_cst``
+has no effect if ``no_acpi`` is set).
+
 The value of the ``states_off`` module parameter (0 by default) represents a
 list of idle states to be disabled by default in the form of a bitmask.
 
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 118fe1d37c22..b8a536b930e7 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -1695,6 +1695,10 @@ static bool force_use_acpi __read_mostly; /* No effect if no_acpi is set. */
 module_param_named(use_acpi, force_use_acpi, bool, 0444);
 MODULE_PARM_DESC(use_acpi, "Use ACPI _CST for building the idle states list");
 
+static bool use_acpi_cst __read_mostly; /* No effect if no_acpi is set. */
+module_param_named(use_acpi_cst, use_acpi_cst, bool, 0444);
+MODULE_PARM_DESC(use_acpi_cst, "Ignore cpu specific idle states in lieu of ACPI idle states");
+
 static struct acpi_processor_power acpi_state_table __initdata;
 
 /**
@@ -1836,6 +1840,7 @@ static bool __init intel_idle_off_by_default(unsigned int flags, u32 mwait_hint)
 }
 #else /* !CONFIG_ACPI_PROCESSOR_CSTATE */
 #define force_use_acpi	(false)
+#define use_acpi_cst	(false)
 
 static inline bool intel_idle_acpi_cst_extract(void) { return false; }
 static inline void intel_idle_init_cstates_acpi(struct cpuidle_driver *drv) { }
@@ -2328,6 +2333,12 @@ static int __init intel_idle_init(void)
 	pr_debug("MWAIT substates: 0x%x\n", mwait_substates);
 
 	icpu = (const struct idle_cpu *)id->driver_data;
+	if (use_acpi_cst && !no_acpi) {
+		if (icpu) {
+			pr_debug("ignoring cpu idle states\n");
+			icpu = NULL;
+		}
+	}
 	if (icpu) {
 		if (icpu->state_table)
 			cpuidle_state_table = icpu->state_table;
-- 
2.47.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ