* [PATCH 0/9] amd-pstate: Introduce AMD CPPC Performance Priority
@ 2026-03-06 9:57 Gautham R. Shenoy
2026-03-06 9:57 ` [PATCH 1/9] amd-pstate: Fix memory leak in amd_pstate_epp_cpu_init() Gautham R. Shenoy
` (9 more replies)
0 siblings, 10 replies; 18+ messages in thread
From: Gautham R. Shenoy @ 2026-03-06 9:57 UTC (permalink / raw)
To: Mario Limonciello, Rafael J . Wysocki, Viresh Kumar,
K Prateek Nayak
Cc: linux-kernel, linux-pm, Gautham R. Shenoy
Hello,
This patchset adds support to the amd-pstate driver for a for a new
feature named "CPPC Performance Priority" that will be available on
some of the future AMD processors.
Details of the feature can be found in the AMD Publication titled
"AMD64 Collaborative Processor Performance Control (CPPC) Performance
Priority" (https://docs.amd.com/v/u/en-US/69206_1.10_AMD64_CPPC_PUB)
Description:
This feature allows userspace to specify different floor performance
levels for different CPUs. The platform firmware takes these different
floor performance levels into consideration while throttling the CPUs
under power/thermal constraints.
The presence of this feature is advertised through bit 16 of EDX
register for CPUID leaf 0x80000007. The number of distinct floor
performance levels supported on the platform will be advertised
through the bits 32:39 of the MSR_AMD_CPPC_CAP1. Bits 0:7 of a new MSR
MSR_AMD_CPPC_REQ2 (0xc00102b5) will be used to specify the desired
floor performance level for that CPU.
Key changes made by this patchset:
* Fix a memory leak bug and a control-flow bug.
* Plumb in proper visibility controls for the freq_attr attributes
so that only relevant attributes can be made visible depending on
the underlying platform and the current amd-pstate driver mode.
* Add support for the new CPUID bits, the new MSR and parsing bits
32:39 of MSR_AMD_CPPC_CAP1.
* Set the default value for MSR_AMD_CPPC_REQ2[0:7] (Floor perf) to
CPPC.nominal_perf when the value at boot-time is lower than
CPPC.lowest_perf
* Add sysfs support for floor_freq and floor_count
* Introduce a tracepoint trace_amd_pstate_cppc_req2 for tracking
the updates to MSR_AMD_CPPC_REQ2.
* Add documentation for amd_pstate_floor_{freq,count}
Gautham R. Shenoy (9):
amd-pstate: Fix memory leak in amd_pstate_epp_cpu_init()
amd-pstate: Update cppc_req_cached in fast_switch case
amd-pstate: Make certain freq_attrs conditionally visible
x86/cpufeatures: Add AMD CPPC Performance Priority feature.
amd-pstate: Add support for CPPC_REQ2 and FLOOR_PERF
amd-pstate: Add sysfs support for floor_freq and floor_count
amd-pstate: Introduce a tracepoint trace_amd_pstate_cppc_req2()
Documentation/amd-pstate: List prefcore related sysfs files
Documentation/amd-pstate: Add documentation for amd_pstate_floor_{freq,count}
Documentation/admin-guide/pm/amd-pstate.rst | 47 +++-
arch/x86/include/asm/cpufeatures.h | 2 +-
arch/x86/include/asm/msr-index.h | 5 +
arch/x86/kernel/cpu/scattered.c | 1 +
drivers/cpufreq/amd-pstate-trace.h | 35 +++
drivers/cpufreq/amd-pstate.c | 267 +++++++++++++++++---
drivers/cpufreq/amd-pstate.h | 5 +
tools/arch/x86/include/asm/cpufeatures.h | 2 +-
8 files changed, 324 insertions(+), 40 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 1/9] amd-pstate: Fix memory leak in amd_pstate_epp_cpu_init()
2026-03-06 9:57 [PATCH 0/9] amd-pstate: Introduce AMD CPPC Performance Priority Gautham R. Shenoy
@ 2026-03-06 9:57 ` Gautham R. Shenoy
2026-03-07 2:29 ` Mario Limonciello (AMD) (kernel.org)
2026-03-06 9:57 ` [PATCH 2/9] amd-pstate: Update cppc_req_cached in fast_switch case Gautham R. Shenoy
` (8 subsequent siblings)
9 siblings, 1 reply; 18+ messages in thread
From: Gautham R. Shenoy @ 2026-03-06 9:57 UTC (permalink / raw)
To: Mario Limonciello, Rafael J . Wysocki, Viresh Kumar,
K Prateek Nayak
Cc: linux-kernel, linux-pm, Gautham R. Shenoy
On failure to set the epp, the function amd_pstate_epp_cpu_init()
returns with an error code without freeing the cpudata object that was
allocated at the beginning of the function.
Ensure that the cpudata object is freed before returning from the
function.
This memory leak was discovered by Claude Opus 4.6 with the aid of
Chris Mason's AI review-prompts
(https://github.com/masoncl/review-prompts/tree/main/kernel).
Assisted-by: Claude:claude-opus-4.6 review-prompts/linux
Fixes: f9a378ff6443 ("cpufreq/amd-pstate: Set different default EPP policy for Epyc and Ryzen")
Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
---
drivers/cpufreq/amd-pstate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 5aa9fcd80cf51..d57969c72c9dc 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -1533,7 +1533,7 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy)
ret = amd_pstate_set_epp(policy, cpudata->epp_default);
if (ret)
- return ret;
+ goto free_cpudata1;
current_pstate_driver->adjust_perf = NULL;
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 2/9] amd-pstate: Update cppc_req_cached in fast_switch case
2026-03-06 9:57 [PATCH 0/9] amd-pstate: Introduce AMD CPPC Performance Priority Gautham R. Shenoy
2026-03-06 9:57 ` [PATCH 1/9] amd-pstate: Fix memory leak in amd_pstate_epp_cpu_init() Gautham R. Shenoy
@ 2026-03-06 9:57 ` Gautham R. Shenoy
2026-03-06 9:57 ` [PATCH 3/9] amd-pstate: Make certain freq_attrs conditionally visible Gautham R. Shenoy
` (7 subsequent siblings)
9 siblings, 0 replies; 18+ messages in thread
From: Gautham R. Shenoy @ 2026-03-06 9:57 UTC (permalink / raw)
To: Mario Limonciello, Rafael J . Wysocki, Viresh Kumar,
K Prateek Nayak
Cc: linux-kernel, linux-pm, Gautham R. Shenoy
The function msr_update_perf() does not cache the new value that is
written to MSR_AMD_CPPC_REQ into the variable cpudata->cppc_req_cached
when the update is happening from the fast path.
Fix that by caching the value everytime the MSR_AMD_CPPC_REQ gets
updated.
This issue was discovered by Claude Opus 4.6 with the aid of Chris
Mason's AI review-prompts
(https://github.com/masoncl/review-prompts/tree/main/kernel).
Assisted-by: Claude:claude-opus-4.6 review-prompts/linux
Fixes: fff395796917 ("cpufreq/amd-pstate: Always write EPP value when updating perf")
Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
---
drivers/cpufreq/amd-pstate.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index d57969c72c9dc..24cdeffbcd40e 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -261,7 +261,6 @@ static int msr_update_perf(struct cpufreq_policy *policy, u8 min_perf,
if (fast_switch) {
wrmsrq(MSR_AMD_CPPC_REQ, value);
- return 0;
} else {
int ret = wrmsrq_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, value);
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 3/9] amd-pstate: Make certain freq_attrs conditionally visible
2026-03-06 9:57 [PATCH 0/9] amd-pstate: Introduce AMD CPPC Performance Priority Gautham R. Shenoy
2026-03-06 9:57 ` [PATCH 1/9] amd-pstate: Fix memory leak in amd_pstate_epp_cpu_init() Gautham R. Shenoy
2026-03-06 9:57 ` [PATCH 2/9] amd-pstate: Update cppc_req_cached in fast_switch case Gautham R. Shenoy
@ 2026-03-06 9:57 ` Gautham R. Shenoy
2026-03-06 9:57 ` [PATCH 4/9] x86/cpufeatures: Add AMD CPPC Performance Priority feature Gautham R. Shenoy
` (6 subsequent siblings)
9 siblings, 0 replies; 18+ messages in thread
From: Gautham R. Shenoy @ 2026-03-06 9:57 UTC (permalink / raw)
To: Mario Limonciello, Rafael J . Wysocki, Viresh Kumar,
K Prateek Nayak
Cc: linux-kernel, linux-pm, Gautham R. Shenoy
Certain amd_pstate freq_attrs such as amd_pstate_hw_prefcore and
amd_pstate_prefcore_ranking are enabled even when preferred core is
not supported on the platform.
Similarly there are common freq_attrs between the amd-pstate and the
amd-pstate-epp drivers (eg: amd_pstate_max_freq,
amd_pstate_lowest_non_linear_freq, etc.) but are duplicated in two
different freq_attr structs.
Unify all the attributes in a single place and associate each of them
with a visibility function that determines whether the attribute
should be visible based on the underlying platform support and the
current amd_pstate mode.
Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
---
drivers/cpufreq/amd-pstate.c | 123 ++++++++++++++++++++++++++---------
1 file changed, 92 insertions(+), 31 deletions(-)
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 24cdeffbcd40e..fb5d7bb320c15 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -1220,12 +1220,86 @@ static ssize_t show_energy_performance_preference(
return sysfs_emit(buf, "%s\n", energy_perf_strings[preference]);
}
+cpufreq_freq_attr_ro(amd_pstate_max_freq);
+cpufreq_freq_attr_ro(amd_pstate_lowest_nonlinear_freq);
+
+cpufreq_freq_attr_ro(amd_pstate_highest_perf);
+cpufreq_freq_attr_ro(amd_pstate_prefcore_ranking);
+cpufreq_freq_attr_ro(amd_pstate_hw_prefcore);
+cpufreq_freq_attr_rw(energy_performance_preference);
+cpufreq_freq_attr_ro(energy_performance_available_preferences);
+
+struct freq_attr_visibility {
+ struct freq_attr *attr;
+ bool (*visibility_fn)(void);
+};
+
+/* For attributes which are always visible */
+static bool always_visible(void)
+{
+ return true;
+}
+
+/* Determines whether prefcore related attributes should be visible */
+static bool prefcore_visibility(void)
+{
+ return amd_pstate_prefcore;
+}
+
+/* Determines whether energy performance preference should be visible */
+static bool epp_visibility(void)
+{
+ return cppc_state == AMD_PSTATE_ACTIVE;
+}
+
+static struct freq_attr_visibility amd_pstate_attr_visibility[] = {
+ {&amd_pstate_max_freq, always_visible},
+ {&amd_pstate_lowest_nonlinear_freq, always_visible},
+ {&amd_pstate_highest_perf, always_visible},
+ {&amd_pstate_prefcore_ranking, prefcore_visibility},
+ {&amd_pstate_hw_prefcore, prefcore_visibility},
+ {&energy_performance_preference, epp_visibility},
+ {&energy_performance_available_preferences, epp_visibility},
+};
+
+static struct freq_attr **get_freq_attrs(void)
+{
+ bool attr_visible[ARRAY_SIZE(amd_pstate_attr_visibility)];
+ struct freq_attr **attrs;
+ int i, j, count;
+
+ for (i = 0, count = 0; i < ARRAY_SIZE(amd_pstate_attr_visibility); i++) {
+ struct freq_attr_visibility *v = &amd_pstate_attr_visibility[i];
+
+ attr_visible[i] = v->visibility_fn();
+ if (attr_visible[i])
+ count++;
+ }
+
+ /* amd_pstate_{max_freq, lowest_nonlinear_freq, highest_freq} should always be visible */
+ BUG_ON(!count);
+
+ attrs = kcalloc(count + 1, sizeof(struct freq_attr *), GFP_KERNEL);
+ if (!attrs)
+ return ERR_PTR(-ENOMEM);
+
+ for (i = 0, j = 0; i < ARRAY_SIZE(amd_pstate_attr_visibility); i++) {
+ if (!attr_visible[i])
+ continue;
+
+ attrs[j++] = amd_pstate_attr_visibility[i].attr;
+ }
+
+ return attrs;
+}
+
static void amd_pstate_driver_cleanup(void)
{
if (amd_pstate_prefcore)
sched_clear_itmt_support();
cppc_state = AMD_PSTATE_DISABLE;
+ kfree(current_pstate_driver->attr);
current_pstate_driver = NULL;
}
@@ -1250,6 +1324,7 @@ static int amd_pstate_set_driver(int mode_idx)
static int amd_pstate_register_driver(int mode)
{
+ struct freq_attr **attr = NULL;
int ret;
ret = amd_pstate_set_driver(mode);
@@ -1258,6 +1333,22 @@ static int amd_pstate_register_driver(int mode)
cppc_state = mode;
+ /*
+ * Note: It is important to compute the attrs _after_
+ * re-initializing the cppc_state. Some attributes become
+ * visible only when cppc_state is AMD_PSTATE_ACTIVE.
+ */
+ attr = get_freq_attrs();
+ if (IS_ERR(attr)) {
+ ret = (int) PTR_ERR(attr);
+ pr_err("Couldn't compute freq_attrs for current mode %s [%d]\n",
+ amd_pstate_get_mode_string(cppc_state), ret);
+ amd_pstate_driver_cleanup();
+ return ret;
+ }
+
+ current_pstate_driver->attr = attr;
+
/* at least one CPU supports CPB */
current_pstate_driver->boost_enabled = cpu_feature_enabled(X86_FEATURE_CPB);
@@ -1399,37 +1490,9 @@ static ssize_t prefcore_show(struct device *dev,
return sysfs_emit(buf, "%s\n", str_enabled_disabled(amd_pstate_prefcore));
}
-cpufreq_freq_attr_ro(amd_pstate_max_freq);
-cpufreq_freq_attr_ro(amd_pstate_lowest_nonlinear_freq);
-
-cpufreq_freq_attr_ro(amd_pstate_highest_perf);
-cpufreq_freq_attr_ro(amd_pstate_prefcore_ranking);
-cpufreq_freq_attr_ro(amd_pstate_hw_prefcore);
-cpufreq_freq_attr_rw(energy_performance_preference);
-cpufreq_freq_attr_ro(energy_performance_available_preferences);
static DEVICE_ATTR_RW(status);
static DEVICE_ATTR_RO(prefcore);
-static struct freq_attr *amd_pstate_attr[] = {
- &amd_pstate_max_freq,
- &amd_pstate_lowest_nonlinear_freq,
- &amd_pstate_highest_perf,
- &amd_pstate_prefcore_ranking,
- &amd_pstate_hw_prefcore,
- NULL,
-};
-
-static struct freq_attr *amd_pstate_epp_attr[] = {
- &amd_pstate_max_freq,
- &amd_pstate_lowest_nonlinear_freq,
- &amd_pstate_highest_perf,
- &amd_pstate_prefcore_ranking,
- &amd_pstate_hw_prefcore,
- &energy_performance_preference,
- &energy_performance_available_preferences,
- NULL,
-};
-
static struct attribute *pstate_global_attributes[] = {
&dev_attr_status.attr,
&dev_attr_prefcore.attr,
@@ -1696,7 +1759,6 @@ static struct cpufreq_driver amd_pstate_driver = {
.set_boost = amd_pstate_set_boost,
.update_limits = amd_pstate_update_limits,
.name = "amd-pstate",
- .attr = amd_pstate_attr,
};
static struct cpufreq_driver amd_pstate_epp_driver = {
@@ -1712,7 +1774,6 @@ static struct cpufreq_driver amd_pstate_epp_driver = {
.update_limits = amd_pstate_update_limits,
.set_boost = amd_pstate_set_boost,
.name = "amd-pstate-epp",
- .attr = amd_pstate_epp_attr,
};
/*
@@ -1858,7 +1919,7 @@ static int __init amd_pstate_init(void)
return ret;
global_attr_free:
- cpufreq_unregister_driver(current_pstate_driver);
+ amd_pstate_unregister_driver(0);
return ret;
}
device_initcall(amd_pstate_init);
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 4/9] x86/cpufeatures: Add AMD CPPC Performance Priority feature.
2026-03-06 9:57 [PATCH 0/9] amd-pstate: Introduce AMD CPPC Performance Priority Gautham R. Shenoy
` (2 preceding siblings ...)
2026-03-06 9:57 ` [PATCH 3/9] amd-pstate: Make certain freq_attrs conditionally visible Gautham R. Shenoy
@ 2026-03-06 9:57 ` Gautham R. Shenoy
2026-03-06 10:45 ` Borislav Petkov
2026-03-06 9:57 ` [PATCH 5/9] amd-pstate: Add support for CPPC_REQ2 and FLOOR_PERF Gautham R. Shenoy
` (5 subsequent siblings)
9 siblings, 1 reply; 18+ messages in thread
From: Gautham R. Shenoy @ 2026-03-06 9:57 UTC (permalink / raw)
To: Mario Limonciello, Rafael J . Wysocki, Viresh Kumar,
K Prateek Nayak
Cc: linux-kernel, linux-pm, Gautham R. Shenoy, H. Peter Anvin,
Borislav Petkov, Dave Hansen, Thomas Gleixner, Ingo Molnar, x86
Some future AMD processors have feature named "CPPC Performance
Priority" which lets userspace specify different floor performance
levels for different CPUs. The platform firmware takes these different
floor performance levels into consideration while throttling the CPUs
under power/thermal constraints. The presence of this feature is
indicated by bit 16 of the EDX register for CPUID leaf
0x80000007. More details can be found in AMD Publication titled "AMD64
Collaborative Processor Performance Control (CPPC) Performance
Priority" Revision 1.10.
Define a new feature bit named X86_FEATURE_CPPC_PERF_PRIO to map to
CPUID 0x80000007.EDX[16].
Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
---
Link to AMD publication describing this feature: https://docs.amd.com/v/u/en-US/69206_1.10_AMD64_CPPC_PUB
arch/x86/include/asm/cpufeatures.h | 2 +-
arch/x86/kernel/cpu/scattered.c | 1 +
tools/arch/x86/include/asm/cpufeatures.h | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
index dbe104df339b8..86d17b195e794 100644
--- a/arch/x86/include/asm/cpufeatures.h
+++ b/arch/x86/include/asm/cpufeatures.h
@@ -415,7 +415,7 @@
*/
#define X86_FEATURE_OVERFLOW_RECOV (17*32+ 0) /* "overflow_recov" MCA overflow recovery support */
#define X86_FEATURE_SUCCOR (17*32+ 1) /* "succor" Uncorrectable error containment and recovery */
-
+#define X86_FEATURE_CPPC_PERF_PRIO (17*32+ 2) /* CPPC Floor Perf support */
#define X86_FEATURE_SMCA (17*32+ 3) /* "smca" Scalable MCA */
/* Intel-defined CPU features, CPUID level 0x00000007:0 (EDX), word 18 */
diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c
index 42c7eac0c387b..837d6a4b0c282 100644
--- a/arch/x86/kernel/cpu/scattered.c
+++ b/arch/x86/kernel/cpu/scattered.c
@@ -52,6 +52,7 @@ static const struct cpuid_bit cpuid_bits[] = {
{ X86_FEATURE_CPB, CPUID_EDX, 9, 0x80000007, 0 },
{ X86_FEATURE_PROC_FEEDBACK, CPUID_EDX, 11, 0x80000007, 0 },
{ X86_FEATURE_AMD_FAST_CPPC, CPUID_EDX, 15, 0x80000007, 0 },
+ { X86_FEATURE_CPPC_PERF_PRIO, CPUID_EDX, 16, 0x80000007, 0 },
{ X86_FEATURE_MBA, CPUID_EBX, 6, 0x80000008, 0 },
{ X86_FEATURE_X2AVIC_EXT, CPUID_ECX, 6, 0x8000000a, 0 },
{ X86_FEATURE_COHERENCY_SFW_NO, CPUID_EBX, 31, 0x8000001f, 0 },
diff --git a/tools/arch/x86/include/asm/cpufeatures.h b/tools/arch/x86/include/asm/cpufeatures.h
index c3b53beb13007..1f1aeeb151337 100644
--- a/tools/arch/x86/include/asm/cpufeatures.h
+++ b/tools/arch/x86/include/asm/cpufeatures.h
@@ -414,7 +414,7 @@
*/
#define X86_FEATURE_OVERFLOW_RECOV (17*32+ 0) /* "overflow_recov" MCA overflow recovery support */
#define X86_FEATURE_SUCCOR (17*32+ 1) /* "succor" Uncorrectable error containment and recovery */
-
+#define X86_FEATURE_CPPC_PERF_PRIO (17*32+ 2) /* CPPC Floor Perf support */
#define X86_FEATURE_SMCA (17*32+ 3) /* "smca" Scalable MCA */
/* Intel-defined CPU features, CPUID level 0x00000007:0 (EDX), word 18 */
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 5/9] amd-pstate: Add support for CPPC_REQ2 and FLOOR_PERF
2026-03-06 9:57 [PATCH 0/9] amd-pstate: Introduce AMD CPPC Performance Priority Gautham R. Shenoy
` (3 preceding siblings ...)
2026-03-06 9:57 ` [PATCH 4/9] x86/cpufeatures: Add AMD CPPC Performance Priority feature Gautham R. Shenoy
@ 2026-03-06 9:57 ` Gautham R. Shenoy
2026-03-06 17:54 ` kernel test robot
` (2 more replies)
2026-03-06 9:57 ` [PATCH 6/9] amd-pstate: Add sysfs support for floor_freq and floor_count Gautham R. Shenoy
` (4 subsequent siblings)
9 siblings, 3 replies; 18+ messages in thread
From: Gautham R. Shenoy @ 2026-03-06 9:57 UTC (permalink / raw)
To: Mario Limonciello, Rafael J . Wysocki, Viresh Kumar,
K Prateek Nayak
Cc: linux-kernel, linux-pm, Gautham R. Shenoy
Some future AMD processors have feature named "CPPC Performance
Priority" which lets userspace specify different floor performance
levels for different CPUs. The platform firmware takes these different
floor performance levels into consideration while throttling the CPUs
under power/thermal constraints. The presence of this feature is
indicated by bit 16 of the EDX register for CPUID leaf
0x80000007. More details can be found in AMD Publication titled "AMD64
Collaborative Processor Performance Control (CPPC) Performance
Priority" Revision 1.10.
The number of distinct floor performance levels supported on the
platform will be advertised through the bits 32:39 of the
MSR_AMD_CPPC_CAP1. Bits 0:7 of a new MSR MSR_AMD_CPPC_REQ2
(0xc00102b5) will be used to specify the desired floor performance
level for that CPU.
Add support for the aforementioned MSR_AMD_CPPC_REQ2, and macros for
parsing and updating the relevant bits from MSR_AMD_CPPC_CAP1 and
MSR_AMD_CPPC_REQ2.
On boot if the default value of the MSR_AMD_CPPC_REQ2[7:0] (Floor
Perf) is lower than CPPC.lowest_perf, and thus invalid, initialize it
to MSR_AMD_CPPC_CAP1.nominal_perf which is a sane default value.
Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
---
Link to AMD publication describing this feature: https://docs.amd.com/v/u/en-US/69206_1.10_AMD64_CPPC_PUB
arch/x86/include/asm/msr-index.h | 5 ++
drivers/cpufreq/amd-pstate.c | 81 ++++++++++++++++++++++++++++++++
drivers/cpufreq/amd-pstate.h | 5 ++
3 files changed, 91 insertions(+)
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index da5275d8eda63..60547dcf47d0f 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -762,12 +762,14 @@
#define MSR_AMD_CPPC_CAP2 0xc00102b2
#define MSR_AMD_CPPC_REQ 0xc00102b3
#define MSR_AMD_CPPC_STATUS 0xc00102b4
+#define MSR_AMD_CPPC_REQ2 0xc00102b5
/* Masks for use with MSR_AMD_CPPC_CAP1 */
#define AMD_CPPC_LOWEST_PERF_MASK GENMASK(7, 0)
#define AMD_CPPC_LOWNONLIN_PERF_MASK GENMASK(15, 8)
#define AMD_CPPC_NOMINAL_PERF_MASK GENMASK(23, 16)
#define AMD_CPPC_HIGHEST_PERF_MASK GENMASK(31, 24)
+#define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
/* Masks for use with MSR_AMD_CPPC_REQ */
#define AMD_CPPC_MAX_PERF_MASK GENMASK(7, 0)
@@ -775,6 +777,9 @@
#define AMD_CPPC_DES_PERF_MASK GENMASK(23, 16)
#define AMD_CPPC_EPP_PERF_MASK GENMASK(31, 24)
+/* Masks for use with MSR_AMD_CPPC_REQ2 */
+#define AMD_CPPC_FLOOR_PERF_MASK GENMASK(7, 0)
+
/* AMD Performance Counter Global Status and Control MSRs */
#define MSR_AMD64_PERF_CNTR_GLOBAL_STATUS 0xc0000300
#define MSR_AMD64_PERF_CNTR_GLOBAL_CTL 0xc0000301
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index fb5d7bb320c15..fdc1c102a873c 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -329,6 +329,74 @@ static inline int amd_pstate_set_epp(struct cpufreq_policy *policy, u8 epp)
return static_call(amd_pstate_set_epp)(policy, epp);
}
+static int amd_pstate_set_floor_perf(struct cpufreq_policy *policy, u8 perf)
+{
+ struct amd_cpudata *cpudata = policy->driver_data;
+ u64 value, prev;
+ int ret;
+
+ if (!cpu_feature_enabled(X86_FEATURE_CPPC_PERF_PRIO))
+ return 0;
+
+ value = prev = READ_ONCE(cpudata->cppc_req2_cached);
+ FIELD_MODIFY(AMD_CPPC_FLOOR_PERF_MASK, &value, perf);
+
+ if (value == prev)
+ return 0;
+
+ ret = wrmsrq_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ2, value);
+ if (ret) {
+ pr_err("failed to set CPPC REQ2 value. Error (%d)\n", ret);
+ return ret;
+ }
+
+ WRITE_ONCE(cpudata->cppc_req2_cached, value);
+
+ return ret;
+}
+
+static int amd_pstate_cache_cppc_req2(struct cpufreq_policy *policy)
+{
+ struct amd_cpudata *cpudata = policy->driver_data;
+ u64 value;
+ int ret;
+
+ if (!cpu_feature_enabled(X86_FEATURE_CPPC_PERF_PRIO))
+ return 0;
+
+ ret = rdmsrq_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ2, &value);
+ if (ret) {
+ pr_err("failed to read CPPC REQ2 value. Error (%d)\n", ret);
+ return ret;
+ }
+
+ WRITE_ONCE(cpudata->cppc_req2_cached, value);
+ return 0;
+}
+
+static int amd_pstate_init_floor_perf(struct cpufreq_policy *policy)
+{
+ struct amd_cpudata *cpudata = policy->driver_data;
+ u8 floor_perf;
+ int ret;
+
+ if (!cpu_feature_enabled(X86_FEATURE_CPPC_PERF_PRIO))
+ return 0;
+
+ ret = amd_pstate_cache_cppc_req2(policy);
+ if (ret)
+ return ret;
+
+ floor_perf = FIELD_GET(AMD_CPPC_FLOOR_PERF_MASK,
+ cpudata->cppc_req2_cached);
+
+ /* Don't overwrite a sane value initialized by the platform firmware */
+ if (floor_perf > cpudata->perf.lowest_perf)
+ return 0;
+
+ return amd_pstate_set_floor_perf(policy, cpudata->perf.nominal_perf);
+}
+
static int shmem_set_epp(struct cpufreq_policy *policy, u8 epp)
{
struct amd_cpudata *cpudata = policy->driver_data;
@@ -426,6 +494,7 @@ static int msr_init_perf(struct amd_cpudata *cpudata)
perf.lowest_perf = FIELD_GET(AMD_CPPC_LOWEST_PERF_MASK, cap1);
WRITE_ONCE(cpudata->perf, perf);
WRITE_ONCE(cpudata->prefcore_ranking, FIELD_GET(AMD_CPPC_HIGHEST_PERF_MASK, cap1));
+ WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
return 0;
}
@@ -1036,6 +1105,12 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy)
if (cpu_feature_enabled(X86_FEATURE_CPPC))
policy->fast_switch_possible = true;
+ ret = amd_pstate_init_floor_perf(policy);
+ if (ret) {
+ dev_err(dev, "Failed to initialize Floor Perf (%d)\n", ret);
+ goto free_cpudata1;
+ }
+
ret = freq_qos_add_request(&policy->constraints, &cpudata->req[0],
FREQ_QOS_MIN, FREQ_QOS_MIN_DEFAULT_VALUE);
if (ret < 0) {
@@ -1597,6 +1672,12 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy)
if (ret)
goto free_cpudata1;
+ ret = amd_pstate_init_floor_perf(policy);
+ if (ret) {
+ dev_err(dev, "Failed to initialize Floor Perf (%d)\n", ret);
+ goto free_cpudata1;
+ }
+
current_pstate_driver->adjust_perf = NULL;
return 0;
diff --git a/drivers/cpufreq/amd-pstate.h b/drivers/cpufreq/amd-pstate.h
index cb45fdca27a6c..0c587ca200199 100644
--- a/drivers/cpufreq/amd-pstate.h
+++ b/drivers/cpufreq/amd-pstate.h
@@ -62,9 +62,12 @@ struct amd_aperf_mperf {
* @cpu: CPU number
* @req: constraint request to apply
* @cppc_req_cached: cached performance request hints
+ * @cppc_req2_cached: cached value of MSR_AMD_CPPC_REQ2
* @perf: cached performance-related data
* @prefcore_ranking: the preferred core ranking, the higher value indicates a higher
* priority.
+ * @floor_perf_cnt: Cached value of the number of distinct floor
+ * performance levels supported
* @min_limit_freq: Cached value of policy->min (in khz)
* @max_limit_freq: Cached value of policy->max (in khz)
* @nominal_freq: the frequency (in khz) that mapped to nominal_perf
@@ -87,10 +90,12 @@ struct amd_cpudata {
struct freq_qos_request req[2];
u64 cppc_req_cached;
+ u64 cppc_req2_cached;
union perf_cached perf;
u8 prefcore_ranking;
+ u8 floor_perf_cnt;
u32 min_limit_freq;
u32 max_limit_freq;
u32 nominal_freq;
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 6/9] amd-pstate: Add sysfs support for floor_freq and floor_count
2026-03-06 9:57 [PATCH 0/9] amd-pstate: Introduce AMD CPPC Performance Priority Gautham R. Shenoy
` (4 preceding siblings ...)
2026-03-06 9:57 ` [PATCH 5/9] amd-pstate: Add support for CPPC_REQ2 and FLOOR_PERF Gautham R. Shenoy
@ 2026-03-06 9:57 ` Gautham R. Shenoy
2026-03-06 9:57 ` [PATCH 7/9] amd-pstate: Introduce a tracepoint trace_amd_pstate_cppc_req2() Gautham R. Shenoy
` (3 subsequent siblings)
9 siblings, 0 replies; 18+ messages in thread
From: Gautham R. Shenoy @ 2026-03-06 9:57 UTC (permalink / raw)
To: Mario Limonciello, Rafael J . Wysocki, Viresh Kumar,
K Prateek Nayak
Cc: linux-kernel, linux-pm, Gautham R. Shenoy
When Floor Performance feature is supported by the platform, expose
two sysfs files:
* amd_pstate_floor_freq to allow userspace to request the floor
frequency for each CPU.
* amd_pstate_floor_count which advertises the number of distinct
levels of floor frequencies supported on this platform.
Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
---
drivers/cpufreq/amd-pstate.c | 52 ++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index fdc1c102a873c..a0bc80a7d3f15 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -1295,6 +1295,48 @@ static ssize_t show_energy_performance_preference(
return sysfs_emit(buf, "%s\n", energy_perf_strings[preference]);
}
+static ssize_t store_amd_pstate_floor_freq(struct cpufreq_policy *policy,
+ const char *buf, size_t count)
+{
+ struct amd_cpudata *cpudata = policy->driver_data;
+ union perf_cached perf = READ_ONCE(cpudata->perf);
+ unsigned int freq;
+ u8 floor_perf;
+ int ret;
+
+ ret = kstrtouint(buf, 0, &freq);
+ if (ret)
+ return ret;
+
+ floor_perf = freq_to_perf(perf, cpudata->nominal_freq, freq);
+ ret = amd_pstate_set_floor_perf(policy, floor_perf);
+
+ return ret ?: count;
+}
+
+static ssize_t show_amd_pstate_floor_freq(struct cpufreq_policy *policy, char *buf)
+{
+ struct amd_cpudata *cpudata = policy->driver_data;
+ union perf_cached perf = READ_ONCE(cpudata->perf);
+ u64 cppc_req2 = READ_ONCE(cpudata->cppc_req2_cached);
+ unsigned int freq;
+ u8 floor_perf;
+
+ floor_perf = FIELD_GET(AMD_CPPC_FLOOR_PERF_MASK, cppc_req2);
+ freq = perf_to_freq(perf, cpudata->nominal_freq, floor_perf);
+
+ return sysfs_emit(buf, "%u\n", freq);
+}
+
+
+static ssize_t show_amd_pstate_floor_count(struct cpufreq_policy *policy, char *buf)
+{
+ struct amd_cpudata *cpudata = policy->driver_data;
+ u8 count = cpudata->floor_perf_cnt;
+
+ return sysfs_emit(buf, "%u\n", count);
+}
+
cpufreq_freq_attr_ro(amd_pstate_max_freq);
cpufreq_freq_attr_ro(amd_pstate_lowest_nonlinear_freq);
@@ -1303,6 +1345,8 @@ cpufreq_freq_attr_ro(amd_pstate_prefcore_ranking);
cpufreq_freq_attr_ro(amd_pstate_hw_prefcore);
cpufreq_freq_attr_rw(energy_performance_preference);
cpufreq_freq_attr_ro(energy_performance_available_preferences);
+cpufreq_freq_attr_rw(amd_pstate_floor_freq);
+cpufreq_freq_attr_ro(amd_pstate_floor_count);
struct freq_attr_visibility {
struct freq_attr *attr;
@@ -1327,6 +1371,12 @@ static bool epp_visibility(void)
return cppc_state == AMD_PSTATE_ACTIVE;
}
+/* Determines whether amd_pstate_floor_freq related attributes should be visible */
+static bool floor_freq_visibility(void)
+{
+ return cpu_feature_enabled(X86_FEATURE_CPPC_PERF_PRIO);
+}
+
static struct freq_attr_visibility amd_pstate_attr_visibility[] = {
{&amd_pstate_max_freq, always_visible},
{&amd_pstate_lowest_nonlinear_freq, always_visible},
@@ -1335,6 +1385,8 @@ static struct freq_attr_visibility amd_pstate_attr_visibility[] = {
{&amd_pstate_hw_prefcore, prefcore_visibility},
{&energy_performance_preference, epp_visibility},
{&energy_performance_available_preferences, epp_visibility},
+ {&amd_pstate_floor_freq, floor_freq_visibility},
+ {&amd_pstate_floor_count, floor_freq_visibility},
};
static struct freq_attr **get_freq_attrs(void)
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 7/9] amd-pstate: Introduce a tracepoint trace_amd_pstate_cppc_req2()
2026-03-06 9:57 [PATCH 0/9] amd-pstate: Introduce AMD CPPC Performance Priority Gautham R. Shenoy
` (5 preceding siblings ...)
2026-03-06 9:57 ` [PATCH 6/9] amd-pstate: Add sysfs support for floor_freq and floor_count Gautham R. Shenoy
@ 2026-03-06 9:57 ` Gautham R. Shenoy
2026-03-06 9:57 ` [PATCH 8/9] Documentation/amd-pstate: List prefcore related sysfs files Gautham R. Shenoy
` (2 subsequent siblings)
9 siblings, 0 replies; 18+ messages in thread
From: Gautham R. Shenoy @ 2026-03-06 9:57 UTC (permalink / raw)
To: Mario Limonciello, Rafael J . Wysocki, Viresh Kumar,
K Prateek Nayak
Cc: linux-kernel, linux-pm, Gautham R. Shenoy
Introduce a new tracepoint trace_amd_pstate_cppc_req2() to track
updates to MSR_AMD_CPPC_REQ2.
Invoke this while changing the Floor Perf.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
---
drivers/cpufreq/amd-pstate-trace.h | 35 ++++++++++++++++++++++++++++++
drivers/cpufreq/amd-pstate.c | 14 +++++++++---
2 files changed, 46 insertions(+), 3 deletions(-)
diff --git a/drivers/cpufreq/amd-pstate-trace.h b/drivers/cpufreq/amd-pstate-trace.h
index 32e1bdc588c52..91fa073b2be48 100644
--- a/drivers/cpufreq/amd-pstate-trace.h
+++ b/drivers/cpufreq/amd-pstate-trace.h
@@ -133,6 +133,41 @@ TRACE_EVENT(amd_pstate_epp_perf,
)
);
+TRACE_EVENT(amd_pstate_cppc_req2,
+
+ TP_PROTO(unsigned int cpu_id,
+ u8 floor_perf,
+ bool changed,
+ int err_code
+ ),
+
+ TP_ARGS(cpu_id,
+ floor_perf,
+ changed,
+ err_code),
+
+ TP_STRUCT__entry(
+ __field(unsigned int, cpu_id)
+ __field(u8, floor_perf)
+ __field(bool, changed)
+ __field(int, err_code)
+ ),
+
+ TP_fast_assign(
+ __entry->cpu_id = cpu_id;
+ __entry->floor_perf = floor_perf;
+ __entry->changed = changed;
+ __entry->err_code = err_code;
+ ),
+
+ TP_printk("cpu%u: floor_perf=%u, changed=%u (error = %d)",
+ __entry->cpu_id,
+ __entry->floor_perf,
+ __entry->changed,
+ __entry->err_code
+ )
+);
+
#endif /* _AMD_PSTATE_TRACE_H */
/* This part must be outside protection */
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index a0bc80a7d3f15..632e87b700b14 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -333,6 +333,7 @@ static int amd_pstate_set_floor_perf(struct cpufreq_policy *policy, u8 perf)
{
struct amd_cpudata *cpudata = policy->driver_data;
u64 value, prev;
+ bool changed;
int ret;
if (!cpu_feature_enabled(X86_FEATURE_CPPC_PERF_PRIO))
@@ -341,17 +342,24 @@ static int amd_pstate_set_floor_perf(struct cpufreq_policy *policy, u8 perf)
value = prev = READ_ONCE(cpudata->cppc_req2_cached);
FIELD_MODIFY(AMD_CPPC_FLOOR_PERF_MASK, &value, perf);
- if (value == prev)
- return 0;
+ changed = value != prev;
+ if (!changed) {
+ ret = 0;
+ goto out_trace;
+ }
ret = wrmsrq_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ2, value);
if (ret) {
+ changed = false;
pr_err("failed to set CPPC REQ2 value. Error (%d)\n", ret);
- return ret;
+ goto out_trace;
}
WRITE_ONCE(cpudata->cppc_req2_cached, value);
+out_trace:
+ if (trace_amd_pstate_cppc_req2_enabled())
+ trace_amd_pstate_cppc_req2(cpudata->cpu, perf, changed, ret);
return ret;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 8/9] Documentation/amd-pstate: List prefcore related sysfs files
2026-03-06 9:57 [PATCH 0/9] amd-pstate: Introduce AMD CPPC Performance Priority Gautham R. Shenoy
` (6 preceding siblings ...)
2026-03-06 9:57 ` [PATCH 7/9] amd-pstate: Introduce a tracepoint trace_amd_pstate_cppc_req2() Gautham R. Shenoy
@ 2026-03-06 9:57 ` Gautham R. Shenoy
2026-03-06 9:57 ` [PATCH 9/9] Documentation/amd-pstate: Add documentation for amd_pstate_floor_{freq,count} Gautham R. Shenoy
2026-03-10 3:38 ` [PATCH 0/9] amd-pstate: Introduce AMD CPPC Performance Priority K Prateek Nayak
9 siblings, 0 replies; 18+ messages in thread
From: Gautham R. Shenoy @ 2026-03-06 9:57 UTC (permalink / raw)
To: Mario Limonciello, Rafael J . Wysocki, Viresh Kumar,
K Prateek Nayak
Cc: linux-kernel, linux-pm, Gautham R. Shenoy, Jonathan Corbet,
Shuah Khan
Add the missing amd_pstate_hw_prefcore and amd_pstate_prefcore_ranking
filenames in the sysfs listing example leading to the descriptions of
these parameters.
Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
---
Documentation/admin-guide/pm/amd-pstate.rst | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst
index e1771f2225d5f..f566fea6613e6 100644
--- a/Documentation/admin-guide/pm/amd-pstate.rst
+++ b/Documentation/admin-guide/pm/amd-pstate.rst
@@ -239,8 +239,10 @@ control its functionality at the system level. They are located in the
root@hr-test1:/home/ray# ls /sys/devices/system/cpu/cpufreq/policy0/*amd*
/sys/devices/system/cpu/cpufreq/policy0/amd_pstate_highest_perf
+ /sys/devices/system/cpu/cpufreq/policy0/amd_pstate_hw_prefcore
/sys/devices/system/cpu/cpufreq/policy0/amd_pstate_lowest_nonlinear_freq
/sys/devices/system/cpu/cpufreq/policy0/amd_pstate_max_freq
+ /sys/devices/system/cpu/cpufreq/policy0/amd_pstate_prefcore_ranking
``amd_pstate_highest_perf / amd_pstate_max_freq``
@@ -264,14 +266,17 @@ This attribute is read-only.
``amd_pstate_hw_prefcore``
-Whether the platform supports the preferred core feature and it has been
-enabled. This attribute is read-only.
+Whether the platform supports the preferred core feature and it has
+been enabled. This attribute is read-only. This file is only visible
+on platforms which support the preferred core feature.
``amd_pstate_prefcore_ranking``
-The performance ranking of the core. This number doesn't have any unit, but
-larger numbers are preferred at the time of reading. This can change at
-runtime based on platform conditions. This attribute is read-only.
+The performance ranking of the core. This number doesn't have any
+unit, but larger numbers are preferred at the time of reading. This
+can change at runtime based on platform conditions. This attribute is
+read-only. This file is only visible on platforms which support the
+preferred core feature.
``energy_performance_available_preferences``
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 9/9] Documentation/amd-pstate: Add documentation for amd_pstate_floor_{freq,count}
2026-03-06 9:57 [PATCH 0/9] amd-pstate: Introduce AMD CPPC Performance Priority Gautham R. Shenoy
` (7 preceding siblings ...)
2026-03-06 9:57 ` [PATCH 8/9] Documentation/amd-pstate: List prefcore related sysfs files Gautham R. Shenoy
@ 2026-03-06 9:57 ` Gautham R. Shenoy
2026-03-10 3:45 ` K Prateek Nayak
2026-03-10 3:38 ` [PATCH 0/9] amd-pstate: Introduce AMD CPPC Performance Priority K Prateek Nayak
9 siblings, 1 reply; 18+ messages in thread
From: Gautham R. Shenoy @ 2026-03-06 9:57 UTC (permalink / raw)
To: Mario Limonciello, Rafael J . Wysocki, Viresh Kumar,
K Prateek Nayak
Cc: linux-kernel, linux-pm, Gautham R. Shenoy, Jonathan Corbet,
Shuah Khan
Add documentation for the sysfs files
/sys/devices/system/cpu/cpufreq/policy*/amd_pstate_floor_freq
and
/sys/devices/system/cpu/cpufreq/policy*/amd_pstate_floor_count.
Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
---
Documentation/admin-guide/pm/amd-pstate.rst | 32 +++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst
index f566fea6613e6..5fd2a36f8a4b8 100644
--- a/Documentation/admin-guide/pm/amd-pstate.rst
+++ b/Documentation/admin-guide/pm/amd-pstate.rst
@@ -242,6 +242,8 @@ control its functionality at the system level. They are located in the
/sys/devices/system/cpu/cpufreq/policy0/amd_pstate_hw_prefcore
/sys/devices/system/cpu/cpufreq/policy0/amd_pstate_lowest_nonlinear_freq
/sys/devices/system/cpu/cpufreq/policy0/amd_pstate_max_freq
+ /sys/devices/system/cpu/cpufreq/policy0/amd_pstate_floor_freq
+ /sys/devices/system/cpu/cpufreq/policy0/amd_pstate_floor_count
/sys/devices/system/cpu/cpufreq/policy0/amd_pstate_prefcore_ranking
@@ -278,6 +280,36 @@ can change at runtime based on platform conditions. This attribute is
read-only. This file is only visible on platforms which support the
preferred core feature.
+``amd_pstate_floor_freq``
+
+The floor frequency associated with each CPU. Userspace can write any
+value between ``cpuinfo_min_freq`` and ``scaling_max_freq`` into this
+file. When the system is under power or thermal constraints, the
+platform firmware will attempt to throttle the CPU frequency to the
+value specified in ``amd_pstate_floor_freq`` before throttling it
+further. This allows userspace to specify different floor frequencies
+to different CPUs. For optimal results, threads of the same core
+should have the same floor frequency value. This file is only visible
+on platforms that support the CPPC Performance Priority feature.
+
+
+``amd_pstate_floor_count``
+
+The number of distinct Floor Performance levels supported by the
+platform. For example, if this value is 2, then the number of unique
+values obtained from the command ``cat
+/sys/devices/system/cpu/cpufreq/policy*/amd_pstate_floor_freq |
+sort -n | uniq`` should be at most this number for the behavior
+described in ``amd_pstate_floor_freq`` to take effect. A zero value
+implies that the platform supports unlimited floor performance levels.
+This file is only visible on platforms that support the CPPC
+Performance Priority feature.
+
+**Note**: When ``amd_pstate_floor_count`` is non-zero, the frequency to
+which the CPU is throttled under power or thermal constraints is
+undefined when the number of unique values of ``amd_pstate_floor_freq``
+across all CPUs in the system exceeds ``amd_pstate_floor_count``.
+
``energy_performance_available_preferences``
A list of all the supported EPP preferences that could be used for
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 4/9] x86/cpufeatures: Add AMD CPPC Performance Priority feature.
2026-03-06 9:57 ` [PATCH 4/9] x86/cpufeatures: Add AMD CPPC Performance Priority feature Gautham R. Shenoy
@ 2026-03-06 10:45 ` Borislav Petkov
0 siblings, 0 replies; 18+ messages in thread
From: Borislav Petkov @ 2026-03-06 10:45 UTC (permalink / raw)
To: Gautham R. Shenoy
Cc: Mario Limonciello, Rafael J . Wysocki, Viresh Kumar,
K Prateek Nayak, linux-kernel, linux-pm, H. Peter Anvin,
Dave Hansen, Thomas Gleixner, Ingo Molnar, x86
On Fri, Mar 06, 2026 at 03:27:48PM +0530, Gautham R. Shenoy wrote:
> Some future AMD processors have feature named "CPPC Performance
> Priority" which lets userspace specify different floor performance
> levels for different CPUs. The platform firmware takes these different
> floor performance levels into consideration while throttling the CPUs
> under power/thermal constraints. The presence of this feature is
> indicated by bit 16 of the EDX register for CPUID leaf
> 0x80000007. More details can be found in AMD Publication titled "AMD64
> Collaborative Processor Performance Control (CPPC) Performance
> Priority" Revision 1.10.
>
> Define a new feature bit named X86_FEATURE_CPPC_PERF_PRIO to map to
> CPUID 0x80000007.EDX[16].
>
> Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
> ---
> Link to AMD publication describing this feature: https://docs.amd.com/v/u/en-US/69206_1.10_AMD64_CPPC_PUB
>
> arch/x86/include/asm/cpufeatures.h | 2 +-
> arch/x86/kernel/cpu/scattered.c | 1 +
> tools/arch/x86/include/asm/cpufeatures.h | 2 +-
> 3 files changed, 3 insertions(+), 2 deletions(-)
Reviewed-by: Borislav Petkov (AMD) <bp@alien8.de>
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 5/9] amd-pstate: Add support for CPPC_REQ2 and FLOOR_PERF
2026-03-06 9:57 ` [PATCH 5/9] amd-pstate: Add support for CPPC_REQ2 and FLOOR_PERF Gautham R. Shenoy
@ 2026-03-06 17:54 ` kernel test robot
2026-03-06 20:22 ` kernel test robot
2026-03-07 0:08 ` kernel test robot
2 siblings, 0 replies; 18+ messages in thread
From: kernel test robot @ 2026-03-06 17:54 UTC (permalink / raw)
To: Gautham R. Shenoy, Mario Limonciello, Rafael J . Wysocki,
Viresh Kumar, K Prateek Nayak
Cc: oe-kbuild-all, linux-kernel, linux-pm, Gautham R. Shenoy
Hi Gautham,
kernel test robot noticed the following build warnings:
[auto build test WARNING on rafael-pm/linux-next]
[also build test WARNING on rafael-pm/bleeding-edge tip/x86/core amd-pstate/linux-next amd-pstate/bleeding-edge linus/master v7.0-rc2 next-20260306]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Gautham-R-Shenoy/amd-pstate-Fix-memory-leak-in-amd_pstate_epp_cpu_init/20260306-180651
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
patch link: https://lore.kernel.org/r/20260306095753.17155-6-gautham.shenoy%40amd.com
patch subject: [PATCH 5/9] amd-pstate: Add support for CPPC_REQ2 and FLOOR_PERF
config: i386-allnoconfig-bpf (https://download.01.org/0day-ci/archive/20260306/202603061846.lCieImRU-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260306/202603061846.lCieImRU-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603061846.lCieImRU-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from ./arch/x86/include/generated/asm/rwonce.h:1,
from ./include/linux/compiler.h:372,
from ./include/linux/build_bug.h:5,
from ./include/linux/bitfield.h:10,
from drivers/cpufreq/amd-pstate.c:25:
drivers/cpufreq/amd-pstate.c: In function 'msr_init_perf':
>> ./include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
././include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
././include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:79:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
79 | BUILD_BUG_ON_MSG(__bf_cast_unsigned(mask, mask) > \
| ^~~~~~~~~~~~~~~~
./include/linux/bitfield.h:79:26: note: in expansion of macro '__bf_cast_unsigned'
79 | BUILD_BUG_ON_MSG(__bf_cast_unsigned(mask, mask) > \
| ^~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:177:17: note: in expansion of macro '__BF_FIELD_CHECK_REG'
177 | __BF_FIELD_CHECK_REG(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
././include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
././include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:79:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
79 | BUILD_BUG_ON_MSG(__bf_cast_unsigned(mask, mask) > \
| ^~~~~~~~~~~~~~~~
./include/linux/bitfield.h:79:26: note: in expansion of macro '__bf_cast_unsigned'
79 | BUILD_BUG_ON_MSG(__bf_cast_unsigned(mask, mask) > \
| ^~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:177:17: note: in expansion of macro '__BF_FIELD_CHECK_REG'
177 | __BF_FIELD_CHECK_REG(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> ./include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
././include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
././include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:67:17: note: in expansion of macro 'BUILD_BUG_ON_MSG'
67 | BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask), \
| ^~~~~~~~~~~~~~~~
./include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
././include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
././include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:67:17: note: in expansion of macro 'BUILD_BUG_ON_MSG'
67 | BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask), \
| ^~~~~~~~~~~~~~~~
./include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> ./include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
././include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
././include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:69:17: note: in expansion of macro 'BUILD_BUG_ON_MSG'
69 | BUILD_BUG_ON_MSG((_mask) == 0, _pfx "mask is zero"); \
| ^~~~~~~~~~~~~~~~
./include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
././include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
././include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:69:17: note: in expansion of macro 'BUILD_BUG_ON_MSG'
69 | BUILD_BUG_ON_MSG((_mask) == 0, _pfx "mask is zero"); \
| ^~~~~~~~~~~~~~~~
./include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> ./include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
././include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
././include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:70:17: note: in expansion of macro 'BUILD_BUG_ON_MSG'
70 | BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ? \
| ^~~~~~~~~~~~~~~~
./include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
././include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
././include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:70:17: note: in expansion of macro 'BUILD_BUG_ON_MSG'
70 | BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ? \
| ^~~~~~~~~~~~~~~~
./include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> ./include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
././include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
././include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:70:17: note: in expansion of macro 'BUILD_BUG_ON_MSG'
70 | BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ? \
| ^~~~~~~~~~~~~~~~
./include/linux/bitfield.h:71:47: note: in expansion of macro '__bf_shf'
71 | ~((_mask) >> __bf_shf(_mask)) & \
| ^~~~~~~~
./include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
././include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
././include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:70:17: note: in expansion of macro 'BUILD_BUG_ON_MSG'
70 | BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ? \
| ^~~~~~~~~~~~~~~~
./include/linux/bitfield.h:71:47: note: in expansion of macro '__bf_shf'
71 | ~((_mask) >> __bf_shf(_mask)) & \
| ^~~~~~~~
./include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> ./include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
././include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
././include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
./include/linux/build_bug.h:21:9: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
./include/linux/bitfield.h:74:17: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
74 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
././include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
././include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
./include/linux/build_bug.h:21:9: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
./include/linux/bitfield.h:74:17: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
74 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> ./include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
././include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
././include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
./include/linux/build_bug.h:21:9: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
./include/linux/bitfield.h:74:17: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
74 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:75:56: note: in expansion of macro '__bf_shf'
75 | (1ULL << __bf_shf(_mask))); \
| ^~~~~~~~
./include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
././include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
././include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
./include/linux/build_bug.h:21:9: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
./include/linux/bitfield.h:74:17: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
74 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:75:56: note: in expansion of macro '__bf_shf'
75 | (1ULL << __bf_shf(_mask))); \
| ^~~~~~~~
./include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> ./include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
././include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
././include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
./include/linux/build_bug.h:21:9: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
./include/linux/bitfield.h:74:17: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
74 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
././include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
././include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
./include/linux/build_bug.h:21:9: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
./include/linux/bitfield.h:74:17: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
74 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> ./include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
././include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
././include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
./include/linux/build_bug.h:21:9: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
./include/linux/bitfield.h:74:17: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
74 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:75:56: note: in expansion of macro '__bf_shf'
75 | (1ULL << __bf_shf(_mask))); \
| ^~~~~~~~
./include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
././include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
././include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
./include/linux/build_bug.h:21:9: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
./include/linux/bitfield.h:74:17: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
74 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:75:56: note: in expansion of macro '__bf_shf'
75 | (1ULL << __bf_shf(_mask))); \
| ^~~~~~~~
./include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
./include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> ./include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
./include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
./include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> ./include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
./include/linux/bitfield.h:98:52: note: in expansion of macro '__bf_shf'
98 | (typeof(mask))(((reg) & (mask)) >> __bf_shf(mask)); \
| ^~~~~~~~
./include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
./include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
./include/linux/bitfield.h:98:52: note: in expansion of macro '__bf_shf'
98 | (typeof(mask))(((reg) & (mask)) >> __bf_shf(mask)); \
| ^~~~~~~~
./include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
./include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
./arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +48 ./include/linux/bits.h
31299a5e021124 Vincent Mailhol 2025-03-26 35
19408200c09485 Vincent Mailhol 2025-03-26 36 /*
19408200c09485 Vincent Mailhol 2025-03-26 37 * Generate a mask for the specified type @t. Additional checks are made to
19408200c09485 Vincent Mailhol 2025-03-26 38 * guarantee the value returned fits in that type, relying on
19408200c09485 Vincent Mailhol 2025-03-26 39 * -Wshift-count-overflow compiler check to detect incompatible arguments.
19408200c09485 Vincent Mailhol 2025-03-26 40 * For example, all these create build errors or warnings:
19408200c09485 Vincent Mailhol 2025-03-26 41 *
19408200c09485 Vincent Mailhol 2025-03-26 42 * - GENMASK(15, 20): wrong argument order
19408200c09485 Vincent Mailhol 2025-03-26 43 * - GENMASK(72, 15): doesn't fit unsigned long
19408200c09485 Vincent Mailhol 2025-03-26 44 * - GENMASK_U32(33, 15): doesn't fit in a u32
19408200c09485 Vincent Mailhol 2025-03-26 45 */
19408200c09485 Vincent Mailhol 2025-03-26 46 #define GENMASK_TYPE(t, h, l) \
19408200c09485 Vincent Mailhol 2025-03-26 47 ((t)(GENMASK_INPUT_CHECK(h, l) + \
19408200c09485 Vincent Mailhol 2025-03-26 @48 (type_max(t) << (l) & \
19408200c09485 Vincent Mailhol 2025-03-26 49 type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
19408200c09485 Vincent Mailhol 2025-03-26 50
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 5/9] amd-pstate: Add support for CPPC_REQ2 and FLOOR_PERF
2026-03-06 9:57 ` [PATCH 5/9] amd-pstate: Add support for CPPC_REQ2 and FLOOR_PERF Gautham R. Shenoy
2026-03-06 17:54 ` kernel test robot
@ 2026-03-06 20:22 ` kernel test robot
2026-03-07 0:08 ` kernel test robot
2 siblings, 0 replies; 18+ messages in thread
From: kernel test robot @ 2026-03-06 20:22 UTC (permalink / raw)
To: Gautham R. Shenoy, Mario Limonciello, Rafael J . Wysocki,
Viresh Kumar, K Prateek Nayak
Cc: llvm, oe-kbuild-all, linux-kernel, linux-pm, Gautham R. Shenoy
Hi Gautham,
kernel test robot noticed the following build warnings:
[auto build test WARNING on rafael-pm/linux-next]
[also build test WARNING on rafael-pm/bleeding-edge tip/x86/core amd-pstate/linux-next amd-pstate/bleeding-edge linus/master v7.0-rc2 next-20260306]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Gautham-R-Shenoy/amd-pstate-Fix-memory-leak-in-amd_pstate_epp_cpu_init/20260306-180651
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
patch link: https://lore.kernel.org/r/20260306095753.17155-6-gautham.shenoy%40amd.com
patch subject: [PATCH 5/9] amd-pstate: Add support for CPPC_REQ2 and FLOOR_PERF
config: i386-defconfig (https://download.01.org/0day-ci/archive/20260307/202603070431.ykswVnpp-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260307/202603070431.ykswVnpp-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603070431.ykswVnpp-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/cpufreq/amd-pstate.c:497:48: warning: shift count >= width of type [-Wshift-count-overflow]
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:38: note: expanded from macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^
include/linux/bits.h:51:24: note: expanded from macro 'GENMASK'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^
include/linux/bits.h:48:20: note: expanded from macro 'GENMASK_TYPE'
48 | (type_max(t) << (l) & \
| ^
note: (skipping 6 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:686:9: note: expanded from macro '__compiletime_assert'
686 | if (!(condition)) \
| ^
include/asm-generic/rwonce.h:61:18: note: expanded from macro 'WRITE_ONCE'
61 | __WRITE_ONCE(x, val); \
| ~~~~~~~~~~~~~~~~^~~~
include/asm-generic/rwonce.h:55:33: note: expanded from macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
>> drivers/cpufreq/amd-pstate.c:497:48: warning: shift count >= width of type [-Wshift-count-overflow]
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:38: note: expanded from macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^
include/linux/bits.h:51:24: note: expanded from macro 'GENMASK'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^
include/linux/bits.h:49:20: note: expanded from macro 'GENMASK_TYPE'
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^
note: (skipping 6 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:686:9: note: expanded from macro '__compiletime_assert'
686 | if (!(condition)) \
| ^
include/asm-generic/rwonce.h:61:18: note: expanded from macro 'WRITE_ONCE'
61 | __WRITE_ONCE(x, val); \
| ~~~~~~~~~~~~~~~~^~~~
include/asm-generic/rwonce.h:55:33: note: expanded from macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
>> drivers/cpufreq/amd-pstate.c:497:48: warning: shift count >= width of type [-Wshift-count-overflow]
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:38: note: expanded from macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^
include/linux/bits.h:51:24: note: expanded from macro 'GENMASK'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^
include/linux/bits.h:48:20: note: expanded from macro 'GENMASK_TYPE'
48 | (type_max(t) << (l) & \
| ^
note: (skipping 6 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:686:9: note: expanded from macro '__compiletime_assert'
686 | if (!(condition)) \
| ^
include/asm-generic/rwonce.h:61:18: note: expanded from macro 'WRITE_ONCE'
61 | __WRITE_ONCE(x, val); \
| ~~~~~~~~~~~~~~~~^~~~
include/asm-generic/rwonce.h:55:33: note: expanded from macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
>> drivers/cpufreq/amd-pstate.c:497:48: warning: shift count >= width of type [-Wshift-count-overflow]
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:38: note: expanded from macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^
include/linux/bits.h:51:24: note: expanded from macro 'GENMASK'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^
include/linux/bits.h:49:20: note: expanded from macro 'GENMASK_TYPE'
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^
note: (skipping 6 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:686:9: note: expanded from macro '__compiletime_assert'
686 | if (!(condition)) \
| ^
include/asm-generic/rwonce.h:61:18: note: expanded from macro 'WRITE_ONCE'
61 | __WRITE_ONCE(x, val); \
| ~~~~~~~~~~~~~~~~^~~~
include/asm-generic/rwonce.h:55:33: note: expanded from macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
>> drivers/cpufreq/amd-pstate.c:497:48: warning: shift count >= width of type [-Wshift-count-overflow]
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:38: note: expanded from macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^
include/linux/bits.h:51:24: note: expanded from macro 'GENMASK'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^
include/linux/bits.h:48:20: note: expanded from macro 'GENMASK_TYPE'
48 | (type_max(t) << (l) & \
| ^
note: (skipping 6 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:686:9: note: expanded from macro '__compiletime_assert'
686 | if (!(condition)) \
| ^
include/asm-generic/rwonce.h:61:18: note: expanded from macro 'WRITE_ONCE'
61 | __WRITE_ONCE(x, val); \
| ~~~~~~~~~~~~~~~~^~~~
include/asm-generic/rwonce.h:55:33: note: expanded from macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
>> drivers/cpufreq/amd-pstate.c:497:48: warning: shift count >= width of type [-Wshift-count-overflow]
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:38: note: expanded from macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^
include/linux/bits.h:51:24: note: expanded from macro 'GENMASK'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^
include/linux/bits.h:49:20: note: expanded from macro 'GENMASK_TYPE'
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^
note: (skipping 6 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:686:9: note: expanded from macro '__compiletime_assert'
686 | if (!(condition)) \
| ^
include/asm-generic/rwonce.h:61:18: note: expanded from macro 'WRITE_ONCE'
61 | __WRITE_ONCE(x, val); \
| ~~~~~~~~~~~~~~~~^~~~
include/asm-generic/rwonce.h:55:33: note: expanded from macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
6 warnings generated.
vim +497 drivers/cpufreq/amd-pstate.c
457
458 static int msr_init_perf(struct amd_cpudata *cpudata)
459 {
460 union perf_cached perf = READ_ONCE(cpudata->perf);
461 u64 cap1, numerator, cppc_req;
462 u8 min_perf;
463
464 int ret = rdmsrq_safe_on_cpu(cpudata->cpu, MSR_AMD_CPPC_CAP1,
465 &cap1);
466 if (ret)
467 return ret;
468
469 ret = amd_get_boost_ratio_numerator(cpudata->cpu, &numerator);
470 if (ret)
471 return ret;
472
473 ret = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, &cppc_req);
474 if (ret)
475 return ret;
476
477 WRITE_ONCE(cpudata->cppc_req_cached, cppc_req);
478 min_perf = FIELD_GET(AMD_CPPC_MIN_PERF_MASK, cppc_req);
479
480 /*
481 * Clear out the min_perf part to check if the rest of the MSR is 0, if yes, this is an
482 * indication that the min_perf value is the one specified through the BIOS option
483 */
484 cppc_req &= ~(AMD_CPPC_MIN_PERF_MASK);
485
486 if (!cppc_req)
487 perf.bios_min_perf = min_perf;
488
489 perf.highest_perf = numerator;
490 perf.max_limit_perf = numerator;
491 perf.min_limit_perf = FIELD_GET(AMD_CPPC_LOWEST_PERF_MASK, cap1);
492 perf.nominal_perf = FIELD_GET(AMD_CPPC_NOMINAL_PERF_MASK, cap1);
493 perf.lowest_nonlinear_perf = FIELD_GET(AMD_CPPC_LOWNONLIN_PERF_MASK, cap1);
494 perf.lowest_perf = FIELD_GET(AMD_CPPC_LOWEST_PERF_MASK, cap1);
495 WRITE_ONCE(cpudata->perf, perf);
496 WRITE_ONCE(cpudata->prefcore_ranking, FIELD_GET(AMD_CPPC_HIGHEST_PERF_MASK, cap1));
> 497 WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
498
499 return 0;
500 }
501
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 5/9] amd-pstate: Add support for CPPC_REQ2 and FLOOR_PERF
2026-03-06 9:57 ` [PATCH 5/9] amd-pstate: Add support for CPPC_REQ2 and FLOOR_PERF Gautham R. Shenoy
2026-03-06 17:54 ` kernel test robot
2026-03-06 20:22 ` kernel test robot
@ 2026-03-07 0:08 ` kernel test robot
2 siblings, 0 replies; 18+ messages in thread
From: kernel test robot @ 2026-03-07 0:08 UTC (permalink / raw)
To: Gautham R. Shenoy, Mario Limonciello, Rafael J . Wysocki,
Viresh Kumar, K Prateek Nayak
Cc: oe-kbuild-all, linux-kernel, linux-pm, Gautham R. Shenoy
Hi Gautham,
kernel test robot noticed the following build warnings:
[auto build test WARNING on rafael-pm/linux-next]
[also build test WARNING on rafael-pm/bleeding-edge tip/x86/core amd-pstate/linux-next amd-pstate/bleeding-edge linus/master v7.0-rc2 next-20260306]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Gautham-R-Shenoy/amd-pstate-Fix-memory-leak-in-amd_pstate_epp_cpu_init/20260306-180651
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
patch link: https://lore.kernel.org/r/20260306095753.17155-6-gautham.shenoy%40amd.com
patch subject: [PATCH 5/9] amd-pstate: Add support for CPPC_REQ2 and FLOOR_PERF
config: i386-randconfig-r052-20260307 (https://download.01.org/0day-ci/archive/20260307/202603070828.5EfEKi5Y-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260307/202603070828.5EfEKi5Y-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603070828.5EfEKi5Y-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from ./arch/x86/include/generated/asm/rwonce.h:1,
from include/linux/compiler.h:372,
from include/linux/build_bug.h:5,
from include/linux/bitfield.h:10,
from drivers/cpufreq/amd-pstate.c:25:
drivers/cpufreq/amd-pstate.c: In function 'msr_init_perf':
>> include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:79:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
79 | BUILD_BUG_ON_MSG(__bf_cast_unsigned(mask, mask) > \
| ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:79:26: note: in expansion of macro '__bf_cast_unsigned'
79 | BUILD_BUG_ON_MSG(__bf_cast_unsigned(mask, mask) > \
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:177:17: note: in expansion of macro '__BF_FIELD_CHECK_REG'
177 | __BF_FIELD_CHECK_REG(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:79:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
79 | BUILD_BUG_ON_MSG(__bf_cast_unsigned(mask, mask) > \
| ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:79:26: note: in expansion of macro '__bf_cast_unsigned'
79 | BUILD_BUG_ON_MSG(__bf_cast_unsigned(mask, mask) > \
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:177:17: note: in expansion of macro '__BF_FIELD_CHECK_REG'
177 | __BF_FIELD_CHECK_REG(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:67:17: note: in expansion of macro 'BUILD_BUG_ON_MSG'
67 | BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask), \
| ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:67:17: note: in expansion of macro 'BUILD_BUG_ON_MSG'
67 | BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask), \
| ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:69:17: note: in expansion of macro 'BUILD_BUG_ON_MSG'
69 | BUILD_BUG_ON_MSG((_mask) == 0, _pfx "mask is zero"); \
| ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:69:17: note: in expansion of macro 'BUILD_BUG_ON_MSG'
69 | BUILD_BUG_ON_MSG((_mask) == 0, _pfx "mask is zero"); \
| ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:70:17: note: in expansion of macro 'BUILD_BUG_ON_MSG'
70 | BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ? \
| ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:70:17: note: in expansion of macro 'BUILD_BUG_ON_MSG'
70 | BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ? \
| ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:70:17: note: in expansion of macro 'BUILD_BUG_ON_MSG'
70 | BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ? \
| ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:71:47: note: in expansion of macro '__bf_shf'
71 | ~((_mask) >> __bf_shf(_mask)) & \
| ^~~~~~~~
include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:70:17: note: in expansion of macro 'BUILD_BUG_ON_MSG'
70 | BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ? \
| ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:71:47: note: in expansion of macro '__bf_shf'
71 | ~((_mask) >> __bf_shf(_mask)) & \
| ^~~~~~~~
include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
include/linux/build_bug.h:21:9: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
include/linux/bitfield.h:74:17: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
74 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
include/linux/build_bug.h:21:9: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
include/linux/bitfield.h:74:17: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
74 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
include/linux/build_bug.h:21:9: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
include/linux/bitfield.h:74:17: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
74 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:75:56: note: in expansion of macro '__bf_shf'
75 | (1ULL << __bf_shf(_mask))); \
| ^~~~~~~~
include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
include/linux/build_bug.h:21:9: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
include/linux/bitfield.h:74:17: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
74 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:75:56: note: in expansion of macro '__bf_shf'
75 | (1ULL << __bf_shf(_mask))); \
| ^~~~~~~~
include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
include/linux/build_bug.h:21:9: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
include/linux/bitfield.h:74:17: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
74 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
include/linux/build_bug.h:21:9: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
include/linux/bitfield.h:74:17: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
74 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
include/linux/build_bug.h:21:9: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
include/linux/bitfield.h:74:17: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
74 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:75:56: note: in expansion of macro '__bf_shf'
75 | (1ULL << __bf_shf(_mask))); \
| ^~~~~~~~
include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/compiler_types.h:694:9: note: in expansion of macro '__compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:706:9: note: in expansion of macro '_compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
include/linux/build_bug.h:21:9: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
include/linux/bitfield.h:74:17: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
74 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:75:56: note: in expansion of macro '__bf_shf'
75 | (1ULL << __bf_shf(_mask))); \
| ^~~~~~~~
include/linux/bitfield.h:97:17: note: in expansion of macro '__BF_FIELD_CHECK_MASK'
97 | __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/bits.h:48:27: warning: left shift count >= width of type [-Wshift-count-overflow]
48 | (type_max(t) << (l) & \
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/bitfield.h:98:52: note: in expansion of macro '__bf_shf'
98 | (typeof(mask))(((reg) & (mask)) >> __bf_shf(mask)); \
| ^~~~~~~~
include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bits.h:49:27: warning: right shift count >= width of type [-Wshift-count-overflow]
49 | type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
| ^~
include/asm-generic/rwonce.h:55:40: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
drivers/cpufreq/amd-pstate.c:497:9: note: in expansion of macro 'WRITE_ONCE'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~
include/linux/bitfield.h:98:52: note: in expansion of macro '__bf_shf'
98 | (typeof(mask))(((reg) & (mask)) >> __bf_shf(mask)); \
| ^~~~~~~~
include/linux/bitfield.h:178:17: note: in expansion of macro '__FIELD_GET'
178 | __FIELD_GET(_mask, _reg, "FIELD_GET: "); \
| ^~~~~~~~~~~
drivers/cpufreq/amd-pstate.c:497:45: note: in expansion of macro 'FIELD_GET'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~
include/linux/bits.h:51:33: note: in expansion of macro 'GENMASK_TYPE'
51 | #define GENMASK(h, l) GENMASK_TYPE(unsigned long, h, l)
| ^~~~~~~~~~~~
arch/x86/include/asm/msr-index.h:772:41: note: in expansion of macro 'GENMASK'
772 | #define AMD_CPPC_FLOOR_PERF_CNT_MASK GENMASK(39, 32)
| ^~~~~~~
drivers/cpufreq/amd-pstate.c:497:55: note: in expansion of macro 'AMD_CPPC_FLOOR_PERF_CNT_MASK'
497 | WRITE_ONCE(cpudata->floor_perf_cnt, FIELD_GET(AMD_CPPC_FLOOR_PERF_CNT_MASK, cap1));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +48 include/linux/bits.h
31299a5e021124 Vincent Mailhol 2025-03-26 35
19408200c09485 Vincent Mailhol 2025-03-26 36 /*
19408200c09485 Vincent Mailhol 2025-03-26 37 * Generate a mask for the specified type @t. Additional checks are made to
19408200c09485 Vincent Mailhol 2025-03-26 38 * guarantee the value returned fits in that type, relying on
19408200c09485 Vincent Mailhol 2025-03-26 39 * -Wshift-count-overflow compiler check to detect incompatible arguments.
19408200c09485 Vincent Mailhol 2025-03-26 40 * For example, all these create build errors or warnings:
19408200c09485 Vincent Mailhol 2025-03-26 41 *
19408200c09485 Vincent Mailhol 2025-03-26 42 * - GENMASK(15, 20): wrong argument order
19408200c09485 Vincent Mailhol 2025-03-26 43 * - GENMASK(72, 15): doesn't fit unsigned long
19408200c09485 Vincent Mailhol 2025-03-26 44 * - GENMASK_U32(33, 15): doesn't fit in a u32
19408200c09485 Vincent Mailhol 2025-03-26 45 */
19408200c09485 Vincent Mailhol 2025-03-26 46 #define GENMASK_TYPE(t, h, l) \
19408200c09485 Vincent Mailhol 2025-03-26 47 ((t)(GENMASK_INPUT_CHECK(h, l) + \
19408200c09485 Vincent Mailhol 2025-03-26 @48 (type_max(t) << (l) & \
19408200c09485 Vincent Mailhol 2025-03-26 49 type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
19408200c09485 Vincent Mailhol 2025-03-26 50
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 1/9] amd-pstate: Fix memory leak in amd_pstate_epp_cpu_init()
2026-03-06 9:57 ` [PATCH 1/9] amd-pstate: Fix memory leak in amd_pstate_epp_cpu_init() Gautham R. Shenoy
@ 2026-03-07 2:29 ` Mario Limonciello (AMD) (kernel.org)
0 siblings, 0 replies; 18+ messages in thread
From: Mario Limonciello (AMD) (kernel.org) @ 2026-03-07 2:29 UTC (permalink / raw)
To: Gautham R. Shenoy, Rafael J . Wysocki, Viresh Kumar,
K Prateek Nayak
Cc: linux-kernel, linux-pm
On 3/6/2026 3:57 AM, Gautham R. Shenoy wrote:
> On failure to set the epp, the function amd_pstate_epp_cpu_init()
> returns with an error code without freeing the cpudata object that was
> allocated at the beginning of the function.
>
> Ensure that the cpudata object is freed before returning from the
> function.
>
> This memory leak was discovered by Claude Opus 4.6 with the aid of
> Chris Mason's AI review-prompts
> (https://github.com/masoncl/review-prompts/tree/main/kernel).
>
> Assisted-by: Claude:claude-opus-4.6 review-prompts/linux
> Fixes: f9a378ff6443 ("cpufreq/amd-pstate: Set different default EPP policy for Epyc and Ryzen")
> Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> ---
> drivers/cpufreq/amd-pstate.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 5aa9fcd80cf51..d57969c72c9dc 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -1533,7 +1533,7 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy)
>
> ret = amd_pstate_set_epp(policy, cpudata->epp_default);
> if (ret)
> - return ret;
> + goto free_cpudata1;
>
> current_pstate_driver->adjust_perf = NULL;
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 0/9] amd-pstate: Introduce AMD CPPC Performance Priority
2026-03-06 9:57 [PATCH 0/9] amd-pstate: Introduce AMD CPPC Performance Priority Gautham R. Shenoy
` (8 preceding siblings ...)
2026-03-06 9:57 ` [PATCH 9/9] Documentation/amd-pstate: Add documentation for amd_pstate_floor_{freq,count} Gautham R. Shenoy
@ 2026-03-10 3:38 ` K Prateek Nayak
9 siblings, 0 replies; 18+ messages in thread
From: K Prateek Nayak @ 2026-03-10 3:38 UTC (permalink / raw)
To: Gautham R. Shenoy, Mario Limonciello, Rafael J . Wysocki,
Viresh Kumar
Cc: linux-kernel, linux-pm
Hello Gautham,
On 3/6/2026 3:27 PM, Gautham R. Shenoy wrote:
> Hello,
>
> This patchset adds support to the amd-pstate driver for a for a new
> feature named "CPPC Performance Priority" that will be available on
> some of the future AMD processors.
>
> Details of the feature can be found in the AMD Publication titled
> "AMD64 Collaborative Processor Performance Control (CPPC) Performance
> Priority" (https://docs.amd.com/v/u/en-US/69206_1.10_AMD64_CPPC_PUB)
Other than a s/GENMASK/GENMASK_U64/ for AMD_CPPC_FLOOR_PERF_CNT_MASK
that was flagged by the Intel test robot, the changes in the series
looks good to me.
Feel free to include:
Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>
--
Thanks and Regards,
Prateek
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 9/9] Documentation/amd-pstate: Add documentation for amd_pstate_floor_{freq,count}
2026-03-06 9:57 ` [PATCH 9/9] Documentation/amd-pstate: Add documentation for amd_pstate_floor_{freq,count} Gautham R. Shenoy
@ 2026-03-10 3:45 ` K Prateek Nayak
2026-03-11 10:32 ` Gautham R. Shenoy
0 siblings, 1 reply; 18+ messages in thread
From: K Prateek Nayak @ 2026-03-10 3:45 UTC (permalink / raw)
To: Gautham R. Shenoy, Mario Limonciello, Rafael J . Wysocki,
Viresh Kumar
Cc: linux-kernel, linux-pm, Jonathan Corbet, Shuah Khan
Hello Gautham,
On 3/6/2026 3:27 PM, Gautham R. Shenoy wrote:
> +``amd_pstate_floor_freq``
> +
> +The floor frequency associated with each CPU. Userspace can write any
> +value between ``cpuinfo_min_freq`` and ``scaling_max_freq`` into this
> +file. When the system is under power or thermal constraints, the
> +platform firmware will attempt to throttle the CPU frequency to the
> +value specified in ``amd_pstate_floor_freq`` before throttling it
> +further. This allows userspace to specify different floor frequencies
> +to different CPUs. For optimal results, threads of the same core
> +should have the same floor frequency value. This file is only visible
> +on platforms that support the CPPC Performance Priority feature.
nit. Should we note that the driver caches the closes perf value and the
read of the file will output the corresponding frequency of the perf
level?
Otherwise, it might come as a surprise to the user that the read of file
returns a value very close to what was written but not exactly equal to
it all the times.
Or should we just cache the raw frequency value when user modifies it
and keep the perf translation bits opaque to the user?
--
Thanks and Regards,
Prateek
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 9/9] Documentation/amd-pstate: Add documentation for amd_pstate_floor_{freq,count}
2026-03-10 3:45 ` K Prateek Nayak
@ 2026-03-11 10:32 ` Gautham R. Shenoy
0 siblings, 0 replies; 18+ messages in thread
From: Gautham R. Shenoy @ 2026-03-11 10:32 UTC (permalink / raw)
To: K Prateek Nayak
Cc: Mario Limonciello, Rafael J . Wysocki, Viresh Kumar, linux-kernel,
linux-pm, Jonathan Corbet, Shuah Khan
Hello Prateek,
On Tue, Mar 10, 2026 at 09:15:03AM +0530, K Prateek Nayak wrote:
> Hello Gautham,
>
> On 3/6/2026 3:27 PM, Gautham R. Shenoy wrote:
> > +``amd_pstate_floor_freq``
> > +
> > +The floor frequency associated with each CPU. Userspace can write any
> > +value between ``cpuinfo_min_freq`` and ``scaling_max_freq`` into this
> > +file. When the system is under power or thermal constraints, the
> > +platform firmware will attempt to throttle the CPU frequency to the
> > +value specified in ``amd_pstate_floor_freq`` before throttling it
> > +further. This allows userspace to specify different floor frequencies
> > +to different CPUs. For optimal results, threads of the same core
> > +should have the same floor frequency value. This file is only visible
> > +on platforms that support the CPPC Performance Priority feature.
>
> nit. Should we note that the driver caches the closes perf value and the
> read of the file will output the corresponding frequency of the perf
> level?
>
> Otherwise, it might come as a surprise to the user that the read of file
> returns a value very close to what was written but not exactly equal to
> it all the times.
>
> Or should we just cache the raw frequency value when user modifies it
> and keep the perf translation bits opaque to the user?
I think it is better to cache the user requested value of
amd_pstate_floor_freq in cpudata and report the same when the user
reads the sysfs file.
I will change this in v2. Thanks for the feedback.
>
> --
> Thanks and Regards,
> Prateek
>
--
Thanks and Regards
gautham.
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2026-03-11 10:33 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-06 9:57 [PATCH 0/9] amd-pstate: Introduce AMD CPPC Performance Priority Gautham R. Shenoy
2026-03-06 9:57 ` [PATCH 1/9] amd-pstate: Fix memory leak in amd_pstate_epp_cpu_init() Gautham R. Shenoy
2026-03-07 2:29 ` Mario Limonciello (AMD) (kernel.org)
2026-03-06 9:57 ` [PATCH 2/9] amd-pstate: Update cppc_req_cached in fast_switch case Gautham R. Shenoy
2026-03-06 9:57 ` [PATCH 3/9] amd-pstate: Make certain freq_attrs conditionally visible Gautham R. Shenoy
2026-03-06 9:57 ` [PATCH 4/9] x86/cpufeatures: Add AMD CPPC Performance Priority feature Gautham R. Shenoy
2026-03-06 10:45 ` Borislav Petkov
2026-03-06 9:57 ` [PATCH 5/9] amd-pstate: Add support for CPPC_REQ2 and FLOOR_PERF Gautham R. Shenoy
2026-03-06 17:54 ` kernel test robot
2026-03-06 20:22 ` kernel test robot
2026-03-07 0:08 ` kernel test robot
2026-03-06 9:57 ` [PATCH 6/9] amd-pstate: Add sysfs support for floor_freq and floor_count Gautham R. Shenoy
2026-03-06 9:57 ` [PATCH 7/9] amd-pstate: Introduce a tracepoint trace_amd_pstate_cppc_req2() Gautham R. Shenoy
2026-03-06 9:57 ` [PATCH 8/9] Documentation/amd-pstate: List prefcore related sysfs files Gautham R. Shenoy
2026-03-06 9:57 ` [PATCH 9/9] Documentation/amd-pstate: Add documentation for amd_pstate_floor_{freq,count} Gautham R. Shenoy
2026-03-10 3:45 ` K Prateek Nayak
2026-03-11 10:32 ` Gautham R. Shenoy
2026-03-10 3:38 ` [PATCH 0/9] amd-pstate: Introduce AMD CPPC Performance Priority K Prateek Nayak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox