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 7/9] x86/mwait-idle: drop const from struct cpuidle_state arrays
Date: Thu, 12 Mar 2026 17:57:18 +0100 [thread overview]
Message-ID: <5516d0a1-8fac-48ff-bbe1-85726b730e94@suse.com> (raw)
In-Reply-To: <7b7a677e-a5b9-42c8-beec-3c506b4eac52@suse.com>
A subsequent change will want to be able to alter them based on a new
command line option. (Note that some were __ro_after_init already.)
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -83,7 +83,7 @@ enum c1e_promotion {
};
struct idle_cpu {
- const struct cpuidle_state *state_table;
+ struct cpuidle_state *state_table;
/*
* Hardware C-state auto-demotion may not always be optimal.
@@ -139,7 +139,7 @@ struct cpuidle_state {
* which is also the index into the MWAIT hint array.
* Thus C0 is a dummy.
*/
-static const struct cpuidle_state nehalem_cstates[] = {
+static struct cpuidle_state __ro_after_init nehalem_cstates[] = {
{
.name = "C1",
.flags = MWAIT2flg(0x00),
@@ -167,7 +167,7 @@ static const struct cpuidle_state nehale
{}
};
-static const struct cpuidle_state snb_cstates[] = {
+static struct cpuidle_state __ro_after_init snb_cstates[] = {
{
.name = "C1",
.flags = MWAIT2flg(0x00),
@@ -201,7 +201,7 @@ static const struct cpuidle_state snb_cs
{}
};
-static const struct cpuidle_state byt_cstates[] = {
+static struct cpuidle_state __ro_after_init byt_cstates[] = {
{
.name = "C1",
.flags = MWAIT2flg(0x00),
@@ -235,7 +235,7 @@ static const struct cpuidle_state byt_cs
{}
};
-static const struct cpuidle_state cht_cstates[] = {
+static struct cpuidle_state __ro_after_init cht_cstates[] = {
{
.name = "C1",
.flags = MWAIT2flg(0x00),
@@ -269,7 +269,7 @@ static const struct cpuidle_state cht_cs
{}
};
-static const struct cpuidle_state ivb_cstates[] = {
+static struct cpuidle_state __ro_after_init ivb_cstates[] = {
{
.name = "C1",
.flags = MWAIT2flg(0x00),
@@ -303,7 +303,7 @@ static const struct cpuidle_state ivb_cs
{}
};
-static const struct cpuidle_state ivt_cstates[] = {
+static struct cpuidle_state __ro_after_init ivt_cstates[] = {
{
.name = "C1",
.flags = MWAIT2flg(0x00),
@@ -331,7 +331,7 @@ static const struct cpuidle_state ivt_cs
{}
};
-static const struct cpuidle_state ivt_cstates_4s[] = {
+static struct cpuidle_state __ro_after_init ivt_cstates_4s[] = {
{
.name = "C1",
.flags = MWAIT2flg(0x00),
@@ -359,7 +359,7 @@ static const struct cpuidle_state ivt_cs
{}
};
-static const struct cpuidle_state ivt_cstates_8s[] = {
+static struct cpuidle_state __ro_after_init ivt_cstates_8s[] = {
{
.name = "C1",
.flags = MWAIT2flg(0x00),
@@ -387,7 +387,7 @@ static const struct cpuidle_state ivt_cs
{}
};
-static const struct cpuidle_state hsw_cstates[] = {
+static struct cpuidle_state __ro_after_init hsw_cstates[] = {
{
.name = "C1",
.flags = MWAIT2flg(0x00),
@@ -439,7 +439,7 @@ static const struct cpuidle_state hsw_cs
{}
};
-static const struct cpuidle_state bdw_cstates[] = {
+static struct cpuidle_state __ro_after_init bdw_cstates[] = {
{
.name = "C1",
.flags = MWAIT2flg(0x00),
@@ -565,7 +565,7 @@ static struct cpuidle_state __ro_after_i
{}
};
-static const struct cpuidle_state icx_cstates[] = {
+static struct cpuidle_state __ro_after_init icx_cstates[] = {
{
.name = "C1",
.flags = MWAIT2flg(0x00) | CPUIDLE_FLAG_IRQ_ENABLE,
@@ -665,7 +665,7 @@ static struct cpuidle_state __ro_after_i
{}
};
-static const struct cpuidle_state mtl_l_cstates[] = {
+static struct cpuidle_state __ro_after_init mtl_l_cstates[] = {
{
.name = "C1E",
.flags = MWAIT2flg(0x01),
@@ -687,7 +687,7 @@ static const struct cpuidle_state mtl_l_
{}
};
-static const struct cpuidle_state gmt_cstates[] = {
+static struct cpuidle_state __ro_after_init gmt_cstates[] = {
{
.name = "C1",
.flags = MWAIT2flg(0x00) | CPUIDLE_FLAG_DISABLED,
@@ -743,7 +743,7 @@ static struct cpuidle_state __ro_after_i
{}
};
-static const struct cpuidle_state gnr_cstates[] = {
+static struct cpuidle_state __ro_after_init gnr_cstates[] = {
{
.name = "C1",
.flags = MWAIT2flg(0x00),
@@ -771,7 +771,7 @@ static const struct cpuidle_state gnr_cs
{}
};
-static const struct cpuidle_state gnrd_cstates[] = {
+static struct cpuidle_state __ro_after_init gnrd_cstates[] = {
{
.name = "C1",
.flags = MWAIT2flg(0x00),
@@ -799,7 +799,7 @@ static const struct cpuidle_state gnrd_c
{}
};
-static const struct cpuidle_state atom_cstates[] = {
+static struct cpuidle_state __ro_after_init atom_cstates[] = {
{
.name = "C1E",
.flags = MWAIT2flg(0x00),
@@ -827,7 +827,7 @@ static const struct cpuidle_state atom_c
{}
};
-static const struct cpuidle_state tangier_cstates[] = {
+static struct cpuidle_state __ro_after_init tangier_cstates[] = {
{
.name = "C1",
.flags = MWAIT2flg(0x00),
@@ -861,7 +861,7 @@ static const struct cpuidle_state tangie
{}
};
-static const struct cpuidle_state avn_cstates[] = {
+static struct cpuidle_state __ro_after_init avn_cstates[] = {
{
.name = "C1",
.flags = MWAIT2flg(0x00),
@@ -923,7 +923,7 @@ static struct cpuidle_state __ro_after_i
{}
};
-static const struct cpuidle_state dnv_cstates[] = {
+static struct cpuidle_state __ro_after_init dnv_cstates[] = {
{
.name = "C1",
.flags = MWAIT2flg(0x00),
@@ -949,7 +949,7 @@ static const struct cpuidle_state dnv_cs
* Note, depending on HW and FW revision, SnowRidge SoC may or may not support
* C6, and this is indicated in the CPUID mwait leaf.
*/
-static const struct cpuidle_state snr_cstates[] = {
+static struct cpuidle_state __ro_after_init snr_cstates[] = {
{
.name = "C1",
.flags = MWAIT2flg(0x00),
@@ -971,7 +971,7 @@ static const struct cpuidle_state snr_cs
{}
};
-static const struct cpuidle_state grr_cstates[] = {
+static struct cpuidle_state __ro_after_init grr_cstates[] = {
{
.name = "C1",
.flags = MWAIT2flg(0x00),
@@ -993,7 +993,7 @@ static const struct cpuidle_state grr_cs
{}
};
-static const struct cpuidle_state srf_cstates[] = {
+static struct cpuidle_state __ro_after_init srf_cstates[] = {
{
.name = "C1",
.flags = MWAIT2flg(0x00),
next prev parent reply other threads:[~2026-03-12 16:57 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 16:53 [PATCH 0/9] x86/mwait-idle: sync up with Linux 7.0-rc Jan Beulich
2026-03-12 16:54 ` [PATCH 1/9] x86/mwait-idle: arrange for BSP MSR adjustments during S3 resume Jan Beulich
2026-04-24 14:34 ` Roger Pau Monné
2026-05-04 9:02 ` Jan Beulich
2026-03-12 16:54 ` [PATCH 2/9] x86/mwait-idle: clean up BYT/CHT auto demotion disable Jan Beulich
2026-04-24 14:47 ` Roger Pau Monné
2026-05-04 9:07 ` Jan Beulich
2026-03-12 16:55 ` [PATCH 3/9] x86/mwait-idle: latch struct idle_cpu contents Jan Beulich
2026-04-24 15:24 ` Roger Pau Monné
2026-03-12 16:55 ` [PATCH 4/9] x86/mwait-idle: move pre-initialized struct idle_cpu instances Jan Beulich
2026-04-24 15:33 ` Roger Pau Monné
2026-03-12 16:56 ` [PATCH 5/9] x86/mwait-idle: Remove unused driver version constant Jan Beulich
2026-04-24 15:35 ` Roger Pau Monné
2026-03-12 16:56 ` [PATCH 6/9] x86/mwait-idle: Remove the 'preferred_cstates' parameter Jan Beulich
2026-04-24 15:37 ` Roger Pau Monné
2026-03-12 16:57 ` Jan Beulich [this message]
2026-04-24 17:57 ` [PATCH 7/9] x86/mwait-idle: drop const from struct cpuidle_state arrays Roger Pau Monné
2026-05-04 9:14 ` Jan Beulich
2026-03-12 16:57 ` [PATCH 8/9] x86/mwait-idle: Add cmdline option to adjust C-states table Jan Beulich
2026-04-24 19:10 ` Roger Pau Monné
2026-05-04 9:29 ` Jan Beulich
2026-03-12 16:58 ` [PATCH 9/9] x86/mwait-idle: Add C-states validation Jan Beulich
2026-04-24 19:15 ` Roger Pau Monné
2026-05-04 9:34 ` Jan Beulich
2026-05-08 7:38 ` Roger Pau Monné
2026-05-11 10:41 ` Jan Beulich
2026-05-12 15:22 ` [PATCH 0/9] x86/mwait-idle: sync up with Linux 7.0-rc Oleksii Kurochko
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=5516d0a1-8fac-48ff-bbe1-85726b730e94@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.