Skip to content

Commit

Permalink
tools/power/x86/intel-speed-select: Fix invalid core mask
Browse files Browse the repository at this point in the history
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 <srinivas.pandruvada@linux.intel.com>
  • Loading branch information
Srinivas Pandruvada committed May 22, 2020
1 parent e16ea66 commit 873e391
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tools/power/x86/intel-speed-select/isst-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ void set_cpu_mask_from_punit_coremask(int cpu, unsigned long long core_mask,
pkg_id = get_physical_package_id(cpu);

for (i = 0; i < 64; ++i) {
if (core_mask & BIT(i)) {
if (core_mask & BIT_ULL(i)) {
int j;

for (j = 0; j < topo_max_cpus; ++j) {
Expand Down
1 change: 1 addition & 0 deletions tools/power/x86/intel-speed-select/isst.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <sys/ioctl.h>

#define BIT(x) (1 << (x))
#define BIT_ULL(nr) (1ULL << (nr))
#define GENMASK(h, l) (((~0UL) << (l)) & (~0UL >> (sizeof(long) * 8 - 1 - (h))))
#define GENMASK_ULL(h, l) \
(((~0ULL) << (l)) & (~0ULL >> (sizeof(long long) * 8 - 1 - (h))))
Expand Down

0 comments on commit 873e391

Please sign in to comment.