Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8209e054 authored by Thomas Renninger's avatar Thomas Renninger Committed by Len Brown
Browse files

tools: turbostat: fix bitwise and operand



bug could cause false positive on indicating
presence of invarient TSC or APERF support.

Signed-off-by: default avatarThomas Renninger <trenn@suse.de>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 6148a47a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -892,7 +892,7 @@ void check_cpuid()
	 * this check is valid for both Intel and AMD
	 */
	asm("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (0x80000007));
	has_invariant_tsc = edx && (1 << 8);
	has_invariant_tsc = edx & (1 << 8);

	if (!has_invariant_tsc) {
		fprintf(stderr, "No invariant TSC\n");
@@ -905,7 +905,7 @@ void check_cpuid()
	 */

	asm("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (0x6));
	has_aperf = ecx && (1 << 0);
	has_aperf = ecx & (1 << 0);
	if (!has_aperf) {
		fprintf(stderr, "No APERF MSR\n");
		exit(1);