From: "Borislav Petkov (AMD)" bp@alien8.de
[ Upstream commit 847ebc4476714f81d7dea73e5ea69448d7fe9d3a ]
Add some more Zen6 models.
Signed-off-by: Borislav Petkov (AMD) bp@alien8.de Signed-off-by: Ingo Molnar mingo@kernel.org Link: https://patch.msgid.link/20251029123056.19987-1-bp@kernel.org Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
Now let me compile my comprehensive analysis:
## ANALYSIS RESULTS
**ANSWER: YES**
This commit should be backported to stable kernel trees.
### Detailed Analysis
#### 1. Semantic Code Analysis Performed
**Tools Used:** - `mcp__semcode__find_function`: Located the `bsp_init_amd` function (arch/x86/kernel/cpu/amd.c:421-542) - `mcp__semcode__find_callers`: Determined that `bsp_init_amd` is called indirectly via function pointer in `amd_cpu_dev` structure - `Grep` and git analysis: Examined usage patterns and historical context
**Key Findings:** - The function `bsp_init_amd` is called during early CPU initialization as part of the AMD CPU detection chain - No direct callers found by semantic analysis because it's invoked via the `.c_bsp_init` callback in the CPU vendor structure - X86_FEATURE_ZEN6 is currently only set by this detection code and not yet actively consumed by other subsystems
#### 2. Code Change Analysis
The commit modifies a single line in `arch/x86/kernel/cpu/amd.c`:
```c case 0x50 ... 0x5f: -case 0x90 ... 0xaf: +case 0x80 ... 0xaf: // Extends range to include models 0x80-0x8f case 0xc0 ... 0xcf: setup_force_cpu_cap(X86_FEATURE_ZEN6); ```
This extends the Zen6 model range from `0x90...0xaf` to `0x80...0xaf`, adding 16 new CPU models (0x80-0x8f) to the Zen6 detection.
#### 3. Impact Without This Fix
On Zen6 CPUs with models 0x80-0x8f running stable kernels without this patch:
1. **CPU Misidentification**: The CPU won't be recognized as Zen6 architecture 2. **Kernel Warning**: The code falls through to the `warn:` label (line 541), triggering: `WARN_ONCE(1, "Family 0x%x, model: 0x%x??\n", c->x86, c->x86_model);` 3. **Missing Optimization**: X86_FEATURE_ZEN6 won't be set, potentially causing the CPU to miss Zen6-specific optimizations, workarounds, or features 4. **Future Code Impact**: Any future kernel code that checks for X86_FEATURE_ZEN6 won't activate for these CPUs
#### 4. Historical Precedent
Analysis of similar commits shows a clear pattern of backporting:
**Commit 3b491b102cd2c** (Zen5 model addition): - Added models 0x10-0x1f to Zen5 range - Contains `Fixes: 3e4147f33f8b` tag - Was backported to stable (upstream 2718a7fdf292b)
**Commit b348eac11cb3f** (Zen5 model addition): - Added models 0x60-0x6f to Zen5 range - Contains `[ Upstream commit bf5641eccf71b ]` indicating stable backport - Signed-off-by Sasha Levin for stable
**Pattern**: AMD CPU model range extensions have consistently been backported to stable kernels.
#### 5. Backport Suitability Assessment
**Meets Stable Tree Criteria:** - ✅ **Bug Fix**: Fixes CPU misidentification for existing hardware - ✅ **Hardware Enablement**: Enables proper detection of new Zen6 CPU models - ✅ **Small & Contained**: Single-line change, minimal scope - ✅ **Low Risk**: Only affects CPU model detection, no architectural changes - ✅ **No New Features**: Doesn't add functionality, just extends existing detection - ✅ **User Impact**: Users with new Zen6 CPUs will see kernel warnings without this
**Risk Assessment:** - Change is trivial (range extension: `0x90` → `0x80`) - No dependencies on other commits - No behavioral changes to existing code paths - Cannot cause regressions on CPUs outside the 0x80-0x8f range
#### 6. Why No Stable Tags?
The commit lacks explicit `Cc: stable@vger.kernel.org` or `Fixes:` tags, likely because: - It was committed recently (October 29, 2025) as v6.18-rc4 material - AMD maintainers may expect autoselection for stable based on historical patterns - The fix addresses newly released hardware that may not yet be in users' hands
However, the pattern of similar commits being backported and the nature of the fix (hardware enablement for released products) strongly indicates this should go to stable.
### Recommendation
**Backport Status: YES**
This commit should be backported to all stable kernel versions that contain the X86_FEATURE_ZEN6 infrastructure (introduced in commit 24ee8d9432b57, first appearing in v6.15). This ensures users with new Zen6 CPU models receive proper hardware support without kernel warnings.
arch/x86/kernel/cpu/amd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index a11e17f3b4b1b..e7e3a6fc6153a 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -516,7 +516,7 @@ static void bsp_init_amd(struct cpuinfo_x86 *c) setup_force_cpu_cap(X86_FEATURE_ZEN5); break; case 0x50 ... 0x5f: - case 0x90 ... 0xaf: + case 0x80 ... 0xaf: case 0xc0 ... 0xcf: setup_force_cpu_cap(X86_FEATURE_ZEN6); break;