linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 6.17] perf/x86/intel/uncore: Add uncore PMU support for Wildcat Lake
       [not found] <20251103180246.4097432-1-sashal@kernel.org>
@ 2025-11-03 18:02 ` Sasha Levin
  0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2025-11-03 18:02 UTC (permalink / raw)
  To: patches, stable
  Cc: dongsheng, Dapeng Mi, Peter Zijlstra (Intel), Sasha Levin, mingo,
	acme, namhyung, linux-perf-users, linux-kernel

From: dongsheng <dongsheng.x.zhang@intel.com>

[ Upstream commit f4c12e5cefc8ec2eda93bc17ea734407228449ab ]

WildcatLake (WCL) is a variant of PantherLake (PTL) and shares the same
uncore PMU features with PTL. Therefore, directly reuse Pantherlake's
uncore PMU enabling code for WildcatLake.

Signed-off-by: dongsheng <dongsheng.x.zhang@intel.com>
Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20250908061639.938105-2-dapeng1.mi@linux.intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

## **Backport Recommendation: YES**

### Analysis Summary

I have thoroughly analyzed this commit using semantic code analysis
tools and examined the Linux kernel repository. Here is my comprehensive
assessment:

---

## 1. **Code Changes Analysis**

**What the commit does:**
- Adds a single line to the `intel_uncore_match` device table in
  `arch/x86/events/intel/uncore.c:1898`
- Maps `INTEL_WILDCATLAKE_L` CPU model (0xD5) to the existing
  `ptl_uncore_init` initialization function
- Enables uncore Performance Monitoring Unit (PMU) support for Wildcat
  Lake CPUs

**Specific change:**
```c
+       X86_MATCH_VFM(INTEL_WILDCATLAKE_L,      &ptl_uncore_init),
```

**Statistics:** 1 file changed, 1 insertion (+)

---

## 2. **Semantic Analysis Tools Used**

### **mcp__semcode__find_type**: Analyzed x86_cpu_id structure
- Confirmed this is a standard device table structure in
  `include/linux/mod_devicetable.h:687`
- The structure contains vendor, family, model fields and driver_data
  pointer
- This is the standard Linux device ID matching mechanism

### **mcp__semcode__find_function**: Located ptl_uncore_init
- Found at `arch/x86/events/intel/uncore.c:1810`
- It's a well-established initialization structure already used for
  INTEL_PANTHERLAKE_L
- Contains function pointers for cpu_init, mmio_init, and uses discovery
  mode

### **mcp__semcode__find_callers**: Checked impact scope
- `intel_uncore_init` is a module_init function (line 1976)
- Not called by other functions - it's an entry point
- Uses `x86_match_cpu()` to find the appropriate init function for the
  running CPU

### **Repository examination**:
- Verified INTEL_WILDCATLAKE_L is defined in
  `arch/x86/include/asm/intel-family.h:153`
- Confirmed ptl_uncore_init already exists and is tested code
- Found the commit has already been backported (3b163fc2f971b) by Sasha
  Levin

---

## 3. **Stable Kernel Rules Compliance**

According to **Documentation/process/stable-kernel-rules.rst:15**:

> "It must either fix a real bug that bothers people **or just add a
device ID**."

**This commit explicitly falls under the device ID exception:**

✅ **Adds a device ID**: Adds CPU model ID to device match table
✅ **Size requirement** (<100 lines): Only 1 line changed
✅ **Obviously correct**: Reuses existing, tested `ptl_uncore_init` code
✅ **Already in mainline**: Upstream commit
f4c12e5cefc8ec2eda93bc17ea734407228449ab
✅ **Tested**: Commit message states WCL shares identical PMU features
with PTL

---

## 4. **Risk Assessment**

**Regression Risk: NONE**
- The change only affects Wildcat Lake CPUs (model 0xD5)
- If this CPU is not present, the new line has zero effect
- No modification to existing code paths or initialization functions
- Reuses battle-tested ptl_uncore_init that's already in use for
  PANTHERLAKE_L

**Code Complexity: TRIVIAL**
- Single line addition to a static const device table
- No new functions, no behavioral changes
- Pattern matches dozens of similar entries in the same table (lines
  1870-1906)

**Dependencies: NONE**
- All required code already exists:
  - `INTEL_WILDCATLAKE_L` macro defined in intel-family.h
  - `ptl_uncore_init` structure already implemented
  - `X86_MATCH_VFM` macro is standard infrastructure

---

## 5. **Impact Analysis**

**If backported:**
- Wildcat Lake CPU users gain uncore PMU support for performance
  profiling
- Enables `perf` tool to access hardware performance counters on WCL
- Zero impact on systems without Wildcat Lake CPUs

**If NOT backported:**
- Users with Wildcat Lake CPUs on stable kernels cannot use uncore PMU
  features
- Professional users doing performance analysis on WCL would need
  mainline kernels
- Creates unnecessary gap in hardware support for released CPUs

---

## 6. **Precedent and Context**

The stable kernel rules **explicitly allow** device ID additions
because:
1. They enable hardware that already exists in the field
2. They have minimal/zero regression risk
3. They are typically trivial and obviously correct
4. They improve user experience without changing kernel behavior

This commit perfectly matches this pattern - similar to how USB device
IDs, PCI device IDs, and other hardware identifiers are routinely
backported to stable kernels.

---

## **Final Recommendation: YES - Backport this commit**

**Rationale:**
- Explicitly permitted by stable kernel rules (device ID addition)
- Trivial change with zero regression risk
- Enables hardware support for released CPUs
- Follows established stable kernel practices
- Already successfully backported to this tree (3b163fc2f971b)

 arch/x86/events/intel/uncore.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c
index a762f7f5b1616..d6c945cc5d07c 100644
--- a/arch/x86/events/intel/uncore.c
+++ b/arch/x86/events/intel/uncore.c
@@ -1895,6 +1895,7 @@ static const struct x86_cpu_id intel_uncore_match[] __initconst = {
 	X86_MATCH_VFM(INTEL_ARROWLAKE_H,	&mtl_uncore_init),
 	X86_MATCH_VFM(INTEL_LUNARLAKE_M,	&lnl_uncore_init),
 	X86_MATCH_VFM(INTEL_PANTHERLAKE_L,	&ptl_uncore_init),
+	X86_MATCH_VFM(INTEL_WILDCATLAKE_L,	&ptl_uncore_init),
 	X86_MATCH_VFM(INTEL_SAPPHIRERAPIDS_X,	&spr_uncore_init),
 	X86_MATCH_VFM(INTEL_EMERALDRAPIDS_X,	&spr_uncore_init),
 	X86_MATCH_VFM(INTEL_GRANITERAPIDS_X,	&gnr_uncore_init),
-- 
2.51.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-11-03 18:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20251103180246.4097432-1-sashal@kernel.org>
2025-11-03 18:02 ` [PATCH AUTOSEL 6.17] perf/x86/intel/uncore: Add uncore PMU support for Wildcat Lake Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).