From: Brendan Jackman <jackmanb@google.com>
To: Jonathan Corbet <corbet@lwn.net>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Peter Zijlstra <peterz@infradead.org>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Brendan Jackman <jackmanb@google.com>
Subject: [PATCH v3 1/4] x86/cpu: Remove some macros about feature names
Date: Tue, 18 Feb 2025 18:59:39 +0000 [thread overview]
Message-ID: <20250218-force-cpu-bug-v3-1-da3df43d1936@google.com> (raw)
In-Reply-To: <20250218-force-cpu-bug-v3-0-da3df43d1936@google.com>
These macros used to abstract over CONFIG_X86_FEATURE_NAMES, but that
was removed in commit 7583e8fbdc49 ("x86/cpu: Remove
X86_FEATURE_NAMES"). Now they are just unnecessary indirection, remove
them.
Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
arch/x86/include/asm/cpufeature.h | 5 -----
arch/x86/kernel/cpu/common.c | 12 ++++++------
2 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index de1ad09fe8d7..f23942108b85 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -37,13 +37,8 @@ enum cpuid_leafs
NR_CPUID_WORDS,
};
-#define X86_CAP_FMT_NUM "%d:%d"
-#define x86_cap_flag_num(flag) ((flag) >> 5), ((flag) & 31)
-
extern const char * const x86_cap_flags[NCAPINTS*32];
extern const char * const x86_power_flags[32];
-#define X86_CAP_FMT "%s"
-#define x86_cap_flag(flag) x86_cap_flags[flag]
/*
* In order to save room, we index into this array by doing
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 76598a93a8fa..f96a3a4829bd 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -667,8 +667,8 @@ static void filter_cpuid_features(struct cpuinfo_x86 *c, bool warn)
if (!warn)
continue;
- pr_warn("CPU: CPU feature " X86_CAP_FMT " disabled, no CPUID level 0x%x\n",
- x86_cap_flag(df->feature), df->level);
+ pr_warn("CPU: CPU feature %s disabled, no CPUID level 0x%x\n",
+ x86_cap_flags[df->feature], df->level);
}
}
@@ -1539,9 +1539,9 @@ static void __init cpu_parse_early_param(void)
/* empty-string, i.e., ""-defined feature flags */
if (!x86_cap_flags[bit])
- pr_cont(" " X86_CAP_FMT_NUM, x86_cap_flag_num(bit));
+ pr_cont(" %d:%d", bit >> 5, bit & 31);
else
- pr_cont(" " X86_CAP_FMT, x86_cap_flag(bit));
+ pr_cont(" %s", x86_cap_flags[bit]);
setup_clear_cpu_cap(bit);
taint++;
@@ -1554,10 +1554,10 @@ static void __init cpu_parse_early_param(void)
}
for (bit = 0; bit < 32 * NCAPINTS; bit++) {
- if (!x86_cap_flag(bit))
+ if (!x86_cap_flags[bit])
continue;
- if (strcmp(x86_cap_flag(bit), opt))
+ if (strcmp(x86_cap_flags[bit], opt))
continue;
pr_cont(" %s", opt);
--
2.48.1.601.g30ceb7b040-goog
next prev parent reply other threads:[~2025-02-18 18:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-18 18:59 [PATCH v3 0/4] x86/cpu: Add facility to force-enable CPU caps and bugs Brendan Jackman
2025-02-18 18:59 ` Brendan Jackman [this message]
2025-02-18 18:59 ` [PATCH v3 2/4] x86/cpu: Create helper to parse clearcpuid param Brendan Jackman
2025-02-18 18:59 ` [PATCH v3 3/4] x86/cpu: Add setcpuid cmdline param Brendan Jackman
2025-02-18 18:59 ` [PATCH v3 4/4] x86/cpu: Enable modifying bug flags with {clear,set}cpuid Brendan Jackman
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=20250218-force-cpu-bug-v3-1-da3df43d1936@google.com \
--to=jackmanb@google.com \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox