From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [PATCH for-4.22 v2 5/8] x86/mwait-idle: Remove the 'preferred_cstates' parameter
Date: Tue, 12 May 2026 17:37:11 +0200 [thread overview]
Message-ID: <70787b38-b656-4259-a496-0d0545fa98ba@suse.com> (raw)
In-Reply-To: <178739fe-fa41-4ff7-b16e-67c4b2a99b38@suse.com>
From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Remove the 'preferred_cstates' module parameter as it is not really useful.
The parameter currently only affects Alder Lake, where it controls C1/C1E
preference, with C1E being the default. The parameter does not support any
other platform. For example, Meteor Lake has a similar C1/C1E limitation,
but the parameter does not support Meteor Lake. This indicates that the
parameter is not very useful.
Generally, independent C1 and C1E are important for server platforms where
low latency is key. However, they are not as important for client platforms,
like Alder Lake, where C1E providing better energy savings is generally
preferred.
The parameter was originally introduced for Sapphire Rapids Xeon:
da0e58c038e6 intel_idle: add 'preferred_cstates' module argument
Later it was added to Alder Lake:
d1cf8bbfed1ed ("intel_idle: Add AlderLake support")
But it was removed from Sapphire Rapids when firmware fixed the C1/C1E
limitation:
1548fac47a114 ("intel_idle: make SPR C1 and C1E be independent")
So Alder Lake is the only platform left where this parameter has any effect.
Remove this parameter to simplify the driver and reduce maintenance burden.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Link: https://patch.msgid.link/20251215111300.132803-1-dedekind1@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git a36dc37b5672
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2071,12 +2071,6 @@ compression is selected at build time fr
### ple_window (Intel)
> `= <integer>`
-### preferred-cstates (x86)
-> `= ( <integer> | List of ( C1 | C1E | C2 | ... )`
-
-This is a mask of C-states which are to be used preferably. This option is
-applicable only on hardware were certain C-states are exclusive of one another.
-
### probe-port-aliases (x86)
> `= <boolean>`
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -72,19 +72,6 @@ boolean_param("mwait-idle", opt_mwait_id
static unsigned int mwait_substates;
-/*
- * Some platforms come with mutually exclusive C-states, so that if one is
- * enabled, the other C-states must not be used. Example: C1 and C1E on
- * Sapphire Rapids platform. This parameter allows for selecting the
- * preferred C-states among the groups of mutually exclusive C-states - the
- * selected C-states will be registered, the other C-states from the mutually
- * exclusive group won't be registered. If the platform has no mutually
- * exclusive C-states, this parameter has no effect.
- */
-static unsigned int __ro_after_init preferred_states_mask;
-static char __initdata preferred_states[64];
-string_param("preferred-cstates", preferred_states);
-
#define LAPIC_TIMER_ALWAYS_RELIABLE 0xFFFFFFFF
/* Reliable LAPIC Timer States, bit 1 for C1 etc. Default to only C1. */
static unsigned int lapic_timer_reliable_states = (1 << 1);
@@ -1512,28 +1499,6 @@ static void __init skx_idle_state_table_
}
/*
- * adl_idle_state_table_update - Adjust AlderLake idle states table.
- */
-static void __init adl_idle_state_table_update(void)
-{
- /* Check if user prefers C1 over C1E. */
- if ((preferred_states_mask & BIT(1, U)) &&
- !(preferred_states_mask & BIT(2, U))) {
- adl_cstates[0].flags &= ~CPUIDLE_FLAG_DISABLED;
- adl_cstates[1].flags |= CPUIDLE_FLAG_DISABLED;
- adl_l_cstates[0].flags &= ~CPUIDLE_FLAG_DISABLED;
- adl_l_cstates[1].flags |= CPUIDLE_FLAG_DISABLED;
-
- /* Disable C1E by clearing the "C1E promotion" bit. */
- icpu.c1e_promotion = C1E_PROMOTION_DISABLE;
- return;
- }
-
- /* Make sure C1E is enabled by default */
- icpu.c1e_promotion = C1E_PROMOTION_ENABLE;
-}
-
-/*
* spr_idle_state_table_update - Adjust Sapphire Rapids idle states table.
*/
static void __init spr_idle_state_table_update(void)
@@ -1579,11 +1544,6 @@ static void __init mwait_idle_state_tabl
case INTEL_EMERALDRAPIDS_X:
spr_idle_state_table_update();
break;
- case INTEL_ALDERLAKE:
- case INTEL_ALDERLAKE_L:
- case INTEL_ATOM_GRACEMONT:
- adl_idle_state_table_update();
- break;
}
}
@@ -1592,7 +1552,6 @@ static int __init mwait_idle_probe(void)
unsigned int eax, ebx, ecx;
const struct x86_cpu_id *id;
const struct idle_cpu *idle_cpu;
- const char *str;
if (boot_cpu_data.vendor != X86_VENDOR_INTEL)
return -ENODEV;
@@ -1635,39 +1594,6 @@ static int __init mwait_idle_probe(void)
pr_debug(PREFIX "lapic_timer_reliable_states %#x\n",
lapic_timer_reliable_states);
- str = preferred_states;
- if (isdigit(str[0]))
- preferred_states_mask = simple_strtoul(str, &str, 0);
- else if (str[0])
- {
- const char *ss;
-
- do {
- const struct cpuidle_state *state = idle_cpu->state_table;
- unsigned int bit = 1;
-
- ss = strchr(str, ',');
- if (!ss)
- ss = strchr(str, '\0');
-
- for (; state->name[0]; ++state) {
- bit <<= 1;
- if (!cmdline_strcmp(str, state->name)) {
- preferred_states_mask |= bit;
- break;
- }
- }
- if (!state->name[0])
- break;
-
- str = ss + 1;
- } while (*ss);
-
- str -= str == ss + 1;
- }
- if (str[0])
- printk("unrecognized \"preferred-cstates=%s\"\n", str);
-
mwait_idle_state_table_update();
return 0;
next prev parent reply other threads:[~2026-05-12 15:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 15:34 [PATCH for-4.22 v2 0/8] x86/mwait-idle: sync up with Linux 7.0-rc Jan Beulich
2026-05-12 15:35 ` [PATCH for-4.22 v2 1/8] x86/mwait-idle: arrange for BSP MSR adjustments during S3 resume Jan Beulich
2026-05-14 13:06 ` Roger Pau Monné
2026-05-12 15:36 ` [PATCH for-4.22 v2 2/8] x86/mwait-idle: clean up BYT/CHT auto demotion disable Jan Beulich
2026-05-14 14:10 ` Roger Pau Monné
2026-05-12 15:36 ` [PATCH for-4.22 v2 3/8] x86/mwait-idle: latch struct idle_cpu contents Jan Beulich
2026-05-12 15:36 ` [PATCH for-4.22 v2 4/8] x86/mwait-idle: move pre-initialized struct idle_cpu instances Jan Beulich
2026-05-12 15:37 ` Jan Beulich [this message]
2026-05-12 15:37 ` [PATCH for-4.22 v2 6/8] x86/mwait-idle: drop const from struct cpuidle_state arrays Jan Beulich
2026-05-12 15:38 ` [PATCH for-4.22 v2 7/8] x86/mwait-idle: Add cmdline option to adjust C-states table Jan Beulich
2026-05-14 15:18 ` Roger Pau Monné
2026-05-15 6:57 ` Jan Beulich
2026-05-15 7:59 ` Roger Pau Monné
2026-05-12 15:38 ` [PATCH for-4.22 v2 8/8] x86/mwait-idle: Add C-states validation Jan Beulich
2026-05-14 15:30 ` Roger Pau Monné
2026-05-15 7:01 ` Jan Beulich
2026-05-12 15:39 ` [PATCH for-4.22 v2 0/8] x86/mwait-idle: sync up with Linux 7.0-rc Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=70787b38-b656-4259-a496-0d0545fa98ba@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=roger.pau@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.