From: Borislav Petkov <bp@alien8.de>
To: Sohil Mehta <sohil.mehta@intel.com>
Cc: Borislav Petkov <bp@kernel.org>, X86 ML <x86@kernel.org>,
"Chang S. Bae" <chang.seok.bae@intel.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -v1 2/2] x86/microcode: Add microcode loader debugging functionality
Date: Fri, 29 Aug 2025 11:45:02 +0200 [thread overview]
Message-ID: <20250829094502.GAaLF2nkL2EtFlDGOB@fat_crate.local> (raw)
In-Reply-To: <2cd370e9-6fd8-4aed-8fe8-c8526a1ab97f@intel.com>
On Wed, Aug 20, 2025 at 10:19:11PM -0700, Sohil Mehta wrote:
> Does this need to be (IS_ENABLED(CONFIG_MICROCODE_DBG) && dbg)?
Both you and Nikolay have a point - we don't need both. So actually, dbg can
go and can be added when really needed.
Right now, the debugging stuff is for in a guest only and will be build-time
enabled.
If we decide we want to have runtime controllable and *baremetal* debugging,
then we can extend that and add the cmdline switch.
I think...
---
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index e7badf2aba63..2c142e5f9f06 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -3774,8 +3774,6 @@
Set the base microcode revision of each thread when in
debug mode.
- dbg: enable debugging mode when run in a guest
-
dis_ucode_ldr: disable the microcode loader
force_minrev:
diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index f045670a1fae..f75c140906d0 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -53,8 +53,6 @@ bool force_minrev = IS_ENABLED(CONFIG_MICROCODE_LATE_FORCE_MINREV);
* instead, leave them in. When microcode debugging is not enabled,
* those are meaningless anyway.
*/
-/* enable loader debugging */
-bool dbg;
/* base microcode revision for debugging */
u32 base_rev;
u32 microcode_rev[NR_CPUS] = {};
@@ -130,7 +128,8 @@ bool __init microcode_loader_disabled(void)
* overwritten.
*/
if (!cpuid_feature() ||
- ((native_cpuid_ecx(1) & BIT(31)) && !dbg) ||
+ ((native_cpuid_ecx(1) & BIT(31)) &&
+ !IS_ENABLED(CONFIG_MICROCODE_DBG)) ||
amd_check_current_patch_level())
dis_ucode_ldr = true;
@@ -145,9 +144,6 @@ static void early_parse_cmdline(void)
if (cmdline_find_option(boot_command_line, "microcode", cmd_buf, sizeof(cmd_buf)) > 0) {
while ((s = strsep(&p, ","))) {
if (IS_ENABLED(CONFIG_MICROCODE_DBG)) {
- if (!strcmp(s, "dbg"))
- dbg = true;
-
if (strstr(s, "base_rev=")) {
/* advance to the option arg */
strsep(&s, "=");
diff --git a/arch/x86/kernel/cpu/microcode/internal.h b/arch/x86/kernel/cpu/microcode/internal.h
index bca806dd1aac..ae8dbc2b908d 100644
--- a/arch/x86/kernel/cpu/microcode/internal.h
+++ b/arch/x86/kernel/cpu/microcode/internal.h
@@ -46,7 +46,6 @@ extern struct early_load_data early_data;
extern struct ucode_cpu_info ucode_cpu_info[];
extern u32 microcode_rev[NR_CPUS];
extern u32 base_rev;
-extern bool dbg;
struct cpio_data find_microcode_in_initrd(const char *path);
@@ -128,7 +127,7 @@ static inline struct microcode_ops *init_intel_microcode(void) { return NULL; }
#define ucode_dbg(fmt, ...) \
({ \
- if (dbg) \
+ if (IS_ENABLED(CONFIG_MICROCODE_DBG)) \
pr_info(fmt, ##__VA_ARGS__); \
})
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2025-08-29 9:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-20 13:50 [PATCH -v1 0/2] x86/microcode: Add debugging glue Borislav Petkov
2025-08-20 13:50 ` [PATCH -v1 1/2] x86/microcode: Add microcode= cmdline parsing Borislav Petkov
2025-08-21 5:03 ` Sohil Mehta
2025-08-21 5:15 ` Chang S. Bae
2025-09-02 8:45 ` kernel test robot
2025-09-04 11:37 ` Borislav Petkov
2025-09-04 23:29 ` Nathan Chancellor
2025-09-05 10:40 ` Borislav Petkov
2025-09-05 13:17 ` Ryusuke Konishi
2025-09-05 19:27 ` Nathan Chancellor
2025-09-05 10:30 ` [tip: x86/microcode] " tip-bot2 for Borislav Petkov (AMD)
2025-08-20 13:50 ` [PATCH -v1 2/2] x86/microcode: Add microcode loader debugging functionality Borislav Petkov
2025-08-20 15:35 ` Nikolay Borisov
2025-08-20 15:56 ` Borislav Petkov
2025-08-21 5:19 ` Sohil Mehta
2025-08-29 9:45 ` Borislav Petkov [this message]
2025-08-29 23:25 ` Sohil Mehta
2025-08-30 9:25 ` Borislav Petkov
2025-09-05 10:30 ` [tip: x86/microcode] " tip-bot2 for Borislav Petkov (AMD)
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=20250829094502.GAaLF2nkL2EtFlDGOB@fat_crate.local \
--to=bp@alien8.de \
--cc=bp@kernel.org \
--cc=chang.seok.bae@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sohil.mehta@intel.com \
--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
all inboxes | Powered by JetHome®