[Please CC me, as I am not subscribed to the list.]
Attempting to build the tools/power/x86/turbostat/ binary fails:
[linux-4.4.180]$ make -C tools/power/x86/turbostat/ make: Entering directory `/linux-stable/linux-4.4.180/tools/power/x86/turbostat' gcc -Wall -I../../../include -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"' turbostat.c -o /linux-stable/linux-4.4.180/tools/power/x86/turbostat/turbostat In file included from turbostat.c:23:0: ../../../../arch/x86/include/asm/msr-index.h:4:24: fatal error: linux/bits.h: No such file or directory #include <linux/bits.h> ^ compilation terminated. make: *** [turbostat] Error 1 make: Leaving directory `/linux-stable/linux-4.4.180/tools/power/x86/turbostat' [linux-4.4.180]$
A bisection showed:
683f9fba8c27817b6c2f7320a4095ca353022651 is the first bad commit commit 683f9fba8c27817b6c2f7320a4095ca353022651 Author: Thomas Gleixner tglx@linutronix.de Date: Thu Feb 21 12:36:50 2019 +0100
x86/msr-index: Cleanup bit defines
commit d8eabc37310a92df40d07c5a8afc53cebf996716 upstream.
Greg pointed out that speculation related bit defines are using (1 << N) format instead of BIT(N). Aside of that (1 << N) is wrong as it should use 1UL at least.
Clean it up.
[ Josh Poimboeuf: Fix tools build ]
Reported-by: Greg Kroah-Hartman gregkh@linuxfoundation.org Signed-off-by: Thomas Gleixner tglx@linutronix.de Reviewed-by: Greg Kroah-Hartman gregkh@linuxfoundation.org Reviewed-by: Borislav Petkov bp@suse.de Reviewed-by: Frederic Weisbecker frederic@kernel.org Reviewed-by: Jon Masters jcm@redhat.com Tested-by: Jon Masters jcm@redhat.com [bwh: Backported to 4.4: - Drop change to x86_energy_perf_policy, which doesn't use msr-index.h here - Drop changes to flush MSRs which we haven't defined] Signed-off-by: Ben Hutchings ben@decadent.org.uk Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org
:040000 040000 0ce430a14e73eef1007bf1558693e75e95ffe39a 3ab5675ed0798fc61e7d67ade87ac58dbbf33756 M arch :040000 040000 d45f1a90570a44d8924711e56280cde7041328de c603a03d7801225fb15869d1386224f793f1ba1d M tools
Fix by modifying the turbostat/Makefile CFLAGS and one #include line of the turbostat.c file.
Signed-off-by: Alan Bartlett ajb@elrepo.org Tested-by: Akemi Yagi toracat@elrepo.org Reviewed-by: Philip J Perry phil@elrepo.org
---
diff -Npru a/tools/power/x86/turbostat/Makefile b/tools/power/x86/turbostat/Makefile --- a/tools/power/x86/turbostat/Makefile 2019-05-16 13:45:18.000000000 -0400 +++ b/tools/power/x86/turbostat/Makefile 2019-05-21 10:19:21.580477034 -0400 @@ -8,8 +8,7 @@ ifeq ("$(origin O)", "command line") endif
turbostat : turbostat.c -CFLAGS += -Wall -I../../../include -CFLAGS += -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"' +CFLAGS += -Wall
%: %.c @mkdir -p $(BUILD_OUTPUT) diff -Npru a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c --- a/tools/power/x86/turbostat/turbostat.c 2019-05-16 13:45:18.000000000 -0400 +++ b/tools/power/x86/turbostat/turbostat.c 2019-05-21 10:29:58.007236178 -0400 @@ -20,7 +20,7 @@ */
#define _GNU_SOURCE -#include MSRHEADER +#include <asm/msr-index.h> #include <stdarg.h> #include <stdio.h> #include <err.h>