[PATCH] x86: fix typo in filter_cpuid_features()

From: Yinghai Lu
Date: Sun Feb 15 2009 - 03:00:26 EST



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

Signed-off-by: Yinghai Lu <yinghai@xxxxxxxxxx>

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

Index: linux-2.6/arch/x86/kernel/cpu/common.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/cpu/common.c
+++ 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>)]
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/