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
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
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
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
© 2016 - 2026 Red Hat, Inc.