Blob Blame History Raw
diff --git a/src/cpu/cpu.cpp b/src/cpu/cpu.cpp
index f3711f5..019d922 100644
--- a/src/cpu/cpu.cpp
+++ b/src/cpu/cpu.cpp
@@ -68,7 +68,7 @@ static class abstract_cpu * new_package(int package, int cpu, char * vendor, int
 	char packagename[128];
 	if (strcmp(vendor, "GenuineIntel") == 0)
 		if (family == 6)
-			if (is_supported_intel_cpu(model))
+			if (is_supported_intel_cpu(model, cpu))
 				ret = new class nhm_package(model);
 
 	if (!ret)
@@ -105,7 +105,7 @@ static class abstract_cpu * new_core(int core, int cpu, char * vendor, int famil
 
 	if (strcmp(vendor, "GenuineIntel") == 0)
 		if (family == 6)
-			if (is_supported_intel_cpu(model))
+			if (is_supported_intel_cpu(model, cpu))
 				ret = new class nhm_core(model);
 
 	if (!ret)
@@ -134,7 +134,7 @@ static class abstract_cpu * new_cpu(int number, char * vendor, int family, int m
 
 	if (strcmp(vendor, "GenuineIntel") == 0)
 		if (family == 6)
-			if (is_supported_intel_cpu(model))
+			if (is_supported_intel_cpu(model, number))
 				ret = new class nhm_cpu;
 
 	if (!ret)
diff --git a/src/cpu/intel_cpus.cpp b/src/cpu/intel_cpus.cpp
index 4c7b315..0030dba 100644
--- a/src/cpu/intel_cpus.cpp
+++ b/src/cpu/intel_cpus.cpp
@@ -77,13 +77,15 @@ static int intel_cpu_models[] = {
 
 static int intel_pstate_driver_loaded = -1;
 
-int is_supported_intel_cpu(int model)
+int is_supported_intel_cpu(int model, int cpu)
 {
 	int i;
+	uint64_t msr;
 
 	for (i = 0; intel_cpu_models[i] != 0; i++)
 		if (model == intel_cpu_models[i])
-			return 1;
+			if (cpu < 0 || read_msr(cpu, MSR_APERF, &msr) >= 0)
+				return 1;
 
 	return 0;
 }
diff --git a/src/cpu/intel_cpus.h b/src/cpu/intel_cpus.h
index d20db9a..79afb98 100644
--- a/src/cpu/intel_cpus.h
+++ b/src/cpu/intel_cpus.h
@@ -172,7 +172,7 @@ public:
 
 };
 
-int is_supported_intel_cpu(int model);
+int is_supported_intel_cpu(int model, int cpu);
 int byt_has_ahci();
 
 int is_intel_pstate_driver_loaded();