From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: Yu Peng <pengyu@kylinos.cn>,
"Borislav Petkov (AMD)" <bp@alien8.de>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH AUTOSEL 6.18] x86/microcode: Mark early_parse_cmdline() as __init
Date: Thu, 4 Dec 2025 22:52:32 -0500 [thread overview]
Message-ID: <20251205035239.341989-3-sashal@kernel.org> (raw)
In-Reply-To: <20251205035239.341989-1-sashal@kernel.org>
From: Yu Peng <pengyu@kylinos.cn>
[ Upstream commit ca8313fd83399ea1d18e695c2ae9b259985c9e1f ]
Fix section mismatch warning reported by modpost:
.text:early_parse_cmdline() -> .init.data:boot_command_line
The function early_parse_cmdline() is only called during init and accesses
init data, so mark it __init to match its usage.
[ bp: This happens only when the toolchain fails to inline the function and
I haven't been able to reproduce it with any toolchain I'm using. Patch is
obviously correct regardless. ]
Signed-off-by: Yu Peng <pengyu@kylinos.cn>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://patch.msgid.link/all/20251030123757.1410904-1-pengyu@kylinos.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis
### 1. COMMIT MESSAGE ANALYSIS
**Subject**: `x86/microcode: Mark early_parse_cmdline() as __init`
**Problem**: Fixes a modpost section mismatch warning:
```
.text:early_parse_cmdline() -> .init.data:boot_command_line
```
**Context**: The function is only called during init (from
`load_ucode_bsp()` which is `__init`) and accesses `boot_command_line`
(declared as `__initdata` in `.init.data`). The maintainer notes this
occurs when the toolchain fails to inline the function, but the fix is
correct regardless.
**Signals**:
- No "Cc: stable@vger.kernel.org" tag
- No "Fixes:" tag
- Signed-off by maintainer (Borislav Petkov)
### 2. CODE CHANGE ANALYSIS
**Change**: Adds `__init` attribute to `early_parse_cmdline()`:
```c
-static void early_parse_cmdline(void)
+static void __init early_parse_cmdline(void)
```
**Technical details**:
- `__init` places the function in `.init.text` (discarded after boot)
- `boot_command_line` is `__initdata` (in `.init.data`)
- A function in `.text` accessing `.init.data` triggers a section
mismatch
- Marking the function `__init` aligns it with its usage
**Root cause**: Missing `__init` annotation on a function only used
during initialization.
**Correctness**: Correct. The function is only called from
`load_ucode_bsp()` (line 172), which is `__init`, so marking it `__init`
matches its usage.
### 3. CLASSIFICATION
**Type**: Build fix (section mismatch)
**Not**:
- A new feature
- A runtime bug fix
- A security fix
- A performance optimization
**Is**:
- A build error fix (modpost can fail builds)
- A code organization fix (correct section placement)
### 4. BUILD IMPACT ANALYSIS
From `scripts/mod/modpost.c` (lines 2373-2375):
```c
if (sec_mismatch_count && !sec_mismatch_warn_only)
error("Section mismatches detected.\n"
"Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n");
```
And `scripts/Makefile.modpost` (line 49):
```makefile
$(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E)
```
**Impact**:
- Section mismatches cause build failures unless
`CONFIG_SECTION_MISMATCH_WARN_ONLY=y`
- This is a build error fix, which stable rules allow
- Similar fixes have been backported (e.g., `b452d2c97eecc` for
clocksource driver)
### 5. SCOPE AND RISK ASSESSMENT
**Lines changed**: 1 line (attribute addition)
**Files touched**: 1 file (`arch/x86/kernel/cpu/microcode/core.c`)
**Complexity**: Trivial — attribute addition only
**Risk**: Very low
- No logic change
- No runtime behavior change
- Only affects section placement
- Function already only used during init
**Subsystem**: x86 microcode (mature, critical)
### 6. USER IMPACT
**Who is affected**:
- Users building kernels without `CONFIG_SECTION_MISMATCH_WARN_ONLY=y`
- Distribution kernel builders
- Anyone building with strict modpost checks
**Severity**: Build failure (prevents compilation)
**Frequency**: Depends on toolchain inlining behavior; can be
intermittent
### 7. STABILITY INDICATORS
**Tested-by**: None
**Reviewed-by**: None (maintainer signed off)
**Age**: Very recent (Oct 30, 2025) — not yet in a released kernel
### 8. DEPENDENCY CHECK
**Parent commit**: `632ff61706473` ("x86/microcode: Add microcode=
cmdline parsing") introduced `early_parse_cmdline()` on Aug 20, 2025,
and is in v6.18.
**Dependency analysis**:
- This fix only applies if the parent commit exists in the target stable
tree
- If the function doesn't exist in stable, this fix isn't needed
- If the feature is backported, this fix should be included
**Backport considerations**:
- Applies cleanly if the parent commit is present
- No API changes or complex dependencies
- Self-contained
### 9. STABLE KERNEL RULES EVALUATION
From `Documentation/process/stable-kernel-rules.rst`:
1. "It must be obviously correct and tested" — Yes, correct and
maintainer-approved
2. "It must fix a real bug" — Yes, fixes a build error
3. "It fixes a problem like... a build error" — Yes, explicitly allowed
4. "It must be small and contained" — Yes, 1-line change
5. "It must NOT introduce new features" — Correct, no new functionality
6. "It must apply cleanly" — Yes, if parent commit exists
**Conclusion**: Meets all criteria for stable inclusion.
### 10. COMPARISON WITH SIMILAR COMMITS
Similar section mismatch fixes have been backported:
- `b452d2c97eecc` ("clocksource/drivers/nxp-stm: Fix section
mismatches") includes `Cc: stable@vger.kernel.org # 6.16`
This commit follows the same pattern and should be treated similarly.
### 11. FINAL ASSESSMENT
**Should this be backported?** Yes, with a caveat.
**Rationale**:
1. Fixes a build error (not just a warning)
2. Obviously correct
3. Minimal risk (attribute addition)
4. Small and self-contained
5. Meets stable kernel criteria
**Caveat**:
- Only applicable if commit `632ff61706473` exists in the target stable
tree
- If backporting the feature, include this fix
- If the feature isn't in stable, this fix isn't needed
**Recommendation**: Backport to stable trees that include the
`early_parse_cmdline()` function (v6.18+ or if the feature was
backported to older trees).
**YES**
arch/x86/kernel/cpu/microcode/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
index f75c140906d00..539edd6d6dc8c 100644
--- a/arch/x86/kernel/cpu/microcode/core.c
+++ b/arch/x86/kernel/cpu/microcode/core.c
@@ -136,7 +136,7 @@ bool __init microcode_loader_disabled(void)
return dis_ucode_ldr;
}
-static void early_parse_cmdline(void)
+static void __init early_parse_cmdline(void)
{
char cmd_buf[64] = {};
char *s, *p = cmd_buf;
--
2.51.0
next prev parent reply other threads:[~2025-12-05 3:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-05 3:52 [PATCH AUTOSEL 6.18-5.10] ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint() only Sasha Levin
2025-12-05 3:52 ` [PATCH AUTOSEL 6.18-6.6] cpuidle: menu: Use residency threshold in polling state override decisions Sasha Levin
2025-12-05 3:52 ` Sasha Levin [this message]
2025-12-05 3:52 ` [PATCH AUTOSEL 6.18-6.6] cpufreq: dt-platdev: Add JH7110S SOC to the allowlist Sasha Levin
2025-12-05 3:52 ` [PATCH AUTOSEL 6.18-5.10] cpufreq: s5pv210: fix refcount leak Sasha Levin
2025-12-05 3:52 ` [PATCH AUTOSEL 6.18-5.10] ACPICA: Avoid walking the Namespace if start_node is NULL Sasha Levin
2025-12-05 3:52 ` [PATCH AUTOSEL 6.18-6.12] ACPI: fan: Workaround for 64-bit firmware bug Sasha Levin
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=20251205035239.341989-3-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=bp@alien8.de \
--cc=patches@lists.linux.dev \
--cc=pengyu@kylinos.cn \
--cc=stable@vger.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 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.