Skip to content

Commit 873e391

Browse files
committed
tools/power/x86/intel-speed-select: Fix invalid core mask
The core mask display is wrong in some cases. This is showing more cpus than the mask has. This is because mask is 64 bit but it used with BIT() macro to get the presence of CPU which doesn't support unsigned long long. Added a new macro for BIT_ULL and use that to get the presence of a CPU. Signed-off-by: Srinivas Pandruvada <[email protected]>
1 parent e16ea66 commit 873e391

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

tools/power/x86/intel-speed-select/isst-config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ void set_cpu_mask_from_punit_coremask(int cpu, unsigned long long core_mask,
653653
pkg_id = get_physical_package_id(cpu);
654654

655655
for (i = 0; i < 64; ++i) {
656-
if (core_mask & BIT(i)) {
656+
if (core_mask & BIT_ULL(i)) {
657657
int j;
658658

659659
for (j = 0; j < topo_max_cpus; ++j) {

tools/power/x86/intel-speed-select/isst.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <sys/ioctl.h>
3030

3131
#define BIT(x) (1 << (x))
32+
#define BIT_ULL(nr) (1ULL << (nr))
3233
#define GENMASK(h, l) (((~0UL) << (l)) & (~0UL >> (sizeof(long) * 8 - 1 - (h))))
3334
#define GENMASK_ULL(h, l) \
3435
(((~0ULL) << (l)) & (~0ULL >> (sizeof(long long) * 8 - 1 - (h))))

0 commit comments

Comments
 (0)