x86, cpufeature: Fix cpuid leaf 7 feature detection

This change “x86, cpufeature: Fix cpuid leaf 7 feature detection” (commit 2494b03) in Linux kernel is authored by Fenghua Yu <fenghua.yu [at] intel.com> on Tue May 17 12:33:26 2011 -0700.

Description of "x86, cpufeature: Fix cpuid leaf 7 feature detection"

The change “x86, cpufeature: Fix cpuid leaf 7 feature detection” introduces changes as follows.

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.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Link: http://lkml.kernel.org/r/1305660806-17519-1-git-send-email-fenghua.yu@intel.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: <stable@kernel.org> 2.6.36..39

Linux kernel releases containing commit 2494b03

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "x86, cpufeature: Fix cpuid leaf 7 feature detection"

There are 3 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 arch/x86/kernel/cpu/common.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
 
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index e2ced0074a45..173f3a3fa1a6 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -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 */

The commit for this change in Linux stable tree is 2494b03 (patch).

Last modified: 2020/02/10