Skip to contentSkip to conversation

x86: fix typo in filter_cpuid_features()

PATCH Applied Yinghai Lu 2 participants 2 messages Feb 15, 2009 x86

lore
Share & tools
lore

Yinghai Lu

author
#0 lore raw

PATCH 1/1 x86: fix typo in filter_cpuid_features()

Impact: fix wrong diabling cpu features

on amd system got strange:
CPU: CPU feature monitor disabled due to lack of CPUID level 0x5 but in /proc/cpuinfo do have
cpuid level : 5

on intel system:
CPU: CPU feature monitor disabled due to lack of CPUID level 0x5
CPU: CPU feature dca disabled due to lack of CPUID level 0x9 but in /proc/cpuinfo do have
cpuid level : 11

it turns out there is one typo, and should use level member in df

---
 arch/x86/kernel/cpu/common.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/x86/kernel/cpu/common.c +4 -4
Index: linux-2.6/arch/x86/kernel/cpu/common.c
===================================================================
@@ -255,9 +255,9 @@ static void __cpuinit filter_cpuid_featu
 		 * signs here...
 		 */
 		if (cpu_has(c, df->feature) &&
-		    ((s32)df->feature < 0 ?
-		     (u32)df->feature > (u32)c->extended_cpuid_level :
-		     (s32)df->feature > (s32)c->cpuid_level)) {
+		    ((s32)df->level < 0 ?
+		     (u32)df->level > (u32)c->extended_cpuid_level :
+		     (s32)df->level > (s32)c->cpuid_level)) {
 			clear_cpu_cap(c, df->feature);
 			if (warn)
 				printk(KERN_WARNING
@@ -267,7 +267,7 @@ static void __cpuinit filter_cpuid_featu
 				       df->level);
 		}
 	}
-}	
+}
 
 /*
  * Naming convention should be: <Name> [(<Codename>)]
Applied
#1 lore raw
Quoted 13 lines · Yinghai Lu

Impact: fix wrong diabling cpu features

on amd system got strange:
CPU: CPU feature monitor disabled due to lack of CPUID level 0x5 but in /proc/cpuinfo do have
cpuid level : 5

on intel system:
CPU: CPU feature monitor disabled due to lack of CPUID level 0x5
CPU: CPU feature dca disabled due to lack of CPUID level 0x9 but in /proc/cpuinfo do have
cpuid level : 11

Quoted 7 lines

it turns out there is one typo, and should use level member in df

---
 arch/x86/kernel/cpu/common.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Applied to tip:x86/cpudetect, thanks Yinghai!

Ingo