Skip to contentSkip to conversation

perf_counter/x86: Fix the model number of Intel Core2 processors

PATCH In review Yong Wang 3 participants 5 messages Jun 10, 2009 x86

lore
Share & tools
lore

Yong Wang

author
#0 lore raw

PATCH 1/1 perf_counter/x86: Fix the model number of Intel Core2 processors

Fix the model number of Intel Core2 processors according to the documentation Intel Processor Identification with the CPUID Instruction
http://www.intel.com/support/processors/sb/cs-009861.htm

---
 arch/x86/kernel/cpu/perf_counter.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/perf_counter.c +2 -1
index 40978aa..a49a82c 100644
@@ -1407,7 +1407,8 @@ static int intel_pmu_init(void)
 	 * Install the hw-cache-events table:
 	 */
 	switch (boot_cpu_data.x86_model) {
-	case 17:
+	case 15:
+	case 23:
 		memcpy(hw_cache_event_ids, core2_hw_cache_event_ids,
 		       sizeof(hw_cache_event_ids));
 
#1 lore raw
Commit-ID:  232f61fa1da4ec7e1aa3d7ca6444f3a436941d36
Gitweb:     http://git.kernel.org/tip/232f61fa1da4ec7e1aa3d7ca6444f3a436941d36
Author:     Yong Wang <[email protected]>
AuthorDate: Wed, 10 Jun 2009 17:06:12 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 10 Jun 2009 12:34:24 +0200

perf_counter/x86: Fix the model number of Intel Core2 processors

Fix the model number of Intel Core2 processors according to the
documentation: Intel Processor Identification with the CPUID
Instruction: http://www.intel.com/support/processors/sb/cs-009861.htm

Cc Peter Zijlstra <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/cpu/perf_counter.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/x86/kernel/cpu/perf_counter.c +2 -1
index 40978aa..a49a82c 100644
@@ -1407,7 +1407,8 @@ static int intel_pmu_init(void)
 	 * Install the hw-cache-events table:
 	 */
 	switch (boot_cpu_data.x86_model) {
-	case 17:
+	case 15:
+	case 23:
 		memcpy(hw_cache_event_ids, core2_hw_cache_event_ids,
 		       sizeof(hw_cache_event_ids));
 
#2 lore raw
In reply to Yong Wang

arch/x86/kernel/cpu/perf_counter.c static int intel_pmu_init(void) · line 1413

Quoted 13 lines · Yong Wang
arch/x86/kernel/cpu/perf_counter.c +2 -1
index 40978aa..a49a82c 100644
@@ -1407,7 +1407,8 @@ static int intel_pmu_init(void)
         * Install the hw-cache-events table:
         */
        switch (boot_cpu_data.x86_model) {
-       case 17:
+       case 15:
+       case 23:
                memcpy(hw_cache_event_ids, core2_hw_cache_event_ids,
                       sizeof(hw_cache_event_ids));

There are actually four model numbers that refer to the same core microarchitecture:

model 15: original 65 nm celeron/pentium/core2/xeon, "Merom"/"Conroe" model 22: single-core 65 nm celeron/core2solo "Merom-L"/"Conroe-L" model 23: current 45 nm celeron/core2/xeon "Penryn"/"Wolfdale" model 29: six-core 45 nm xeon "Dunnington"

You should probably list all of them here.

	Arnd <><
#3 lore raw
Quoted 18 lines · Arnd Bergmann

arch/x86/kernel/cpu/perf_counter.c static int intel_pmu_init(void) · line 1413

Quoted 13 lines · Yong Wang
arch/x86/kernel/cpu/perf_counter.c +2 -1
index 40978aa..a49a82c 100644
@@ -1407,7 +1407,8 @@ static int intel_pmu_init(void)
         * Install the hw-cache-events table:
         */
        switch (boot_cpu_data.x86_model) {
-       case 17:
+       case 15:
+       case 23:
                memcpy(hw_cache_event_ids, core2_hw_cache_event_ids,
                       sizeof(hw_cache_event_ids));

There are actually four model numbers that refer to the same core microarchitecture:

Quoted 6 lines

model 15: original 65 nm celeron/pentium/core2/xeon, "Merom"/"Conroe" model 22: single-core 65 nm celeron/core2solo "Merom-L"/"Conroe-L" model 23: current 45 nm celeron/core2/xeon "Penryn"/"Wolfdale" model 29: six-core 45 nm xeon "Dunnington"

You should probably list all of them here.

Yeah - i've amended the commit with your suggestions - thanks Arnd!

Ingo

#4 lore raw
In reply to Yong Wang
Commit-ID:  dc81081b2d9a6a9d64dad1bef1e5fc9fb660e53e
Gitweb:     http://git.kernel.org/tip/dc81081b2d9a6a9d64dad1bef1e5fc9fb660e53e
Author:     Yong Wang <[email protected]>
AuthorDate: Wed, 10 Jun 2009 17:06:12 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 10 Jun 2009 13:04:43 +0200

perf_counter/x86: Fix the model number of Intel Core2 processors

Fix the model number of Intel Core2 processors according to the
documentation: Intel Processor Identification with the CPUID
Instruction: http://www.intel.com/support/processors/sb/cs-009861.htm

Cc Peter Zijlstra <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>

LKML-Reference: <[email protected]>

[ Added two more model numbers suggested by Arnd Bergmann ]
---
 arch/x86/kernel/cpu/perf_counter.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
arch/x86/kernel/cpu/perf_counter.c +4 -1
index 40978aa..49f2585 100644
@@ -1407,7 +1407,10 @@ static int intel_pmu_init(void)
 	 * Install the hw-cache-events table:
 	 */
 	switch (boot_cpu_data.x86_model) {
-	case 17:
+	case 15: /* original 65 nm celeron/pentium/core2/xeon, "Merom"/"Conroe" */
+	case 22: /* single-core 65 nm celeron/core2solo "Merom-L"/"Conroe-L" */
+	case 23: /* current 45 nm celeron/core2/xeon "Penryn"/"Wolfdale" */
+	case 29: /* six-core 45 nm xeon "Dunnington" */
 		memcpy(hw_cache_event_ids, core2_hw_cache_event_ids,
 		       sizeof(hw_cache_event_ids));