Skip to contentSkip to conversation

x86, cpufeature: Fix cpuid leaf 7 feature detection

tip:x86/cpufeature tip-bot for Fenghua Yu 1 participant 1 message May 17, 2011 1 message not in the archive x86

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Commit-ID:  2494b030ba9334c7dd7df9b9f7abe4eacc950ec5
Gitweb:     http://git.kernel.org/tip/2494b030ba9334c7dd7df9b9f7abe4eacc950ec5
Author:     Fenghua Yu <[email protected]>
AuthorDate: Tue, 17 May 2011 12:33:26 -0700
Committer:  H. Peter Anvin <[email protected]>
CommitDate: Tue, 17 May 2011 13:36:29 -0700

x86, cpufeature: Fix cpuid leaf 7 feature detection

CPUID leaf 7, subleaf 0 returns the maximum subleaf in EAX, not the number of subleaves. Since so far only subleaf 0 is defined (and only the EBX bitfield) we do not need to qualify the test.

---
 arch/x86/kernel/cpu/common.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
arch/x86/kernel/cpu/common.c +1 -2
index e2ced00..173f3a3 100644
@@ -565,8 +565,7 @@ void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c)
 
 		cpuid_count(0x00000007, 0, &eax, &ebx, &ecx, &edx);
 
-		if (eax > 0)
-			c->x86_capability[9] = ebx;
+		c->x86_capability[9] = ebx;
 	}
 
 	/* AMD-defined flags: level 0x80000001 */