aboutsummaryrefslogtreecommitdiff
path: root/src/cpu/intel/hyperthreading/intel_sibling.c
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2012-07-04 12:02:58 +0300
committerAnton Kochkov <anton.kochkov@gmail.com>2012-08-03 12:19:31 +0200
commitdf0fbc7455bb7e7a6081c539c9c94d68168e72d6 (patch)
treec067889f5f0281beed1cc6a36d361d4f057d5c57 /src/cpu/intel/hyperthreading/intel_sibling.c
parent15cf0adc3edaf184d98a3b3c228e0858ff7b24d3 (diff)
Intel CPUs: Fix counting of CPU cores
Detection for a hyper-threading CPU was not compatible with multicore CPUs. When using CPUID eax==4, also need to set ecx=0. CAR init tested on real hardware with hyper-threading model_f25 and under qemu 0.15.1 with multicore CPU. Change-Id: I28ac8790f94652e4ba8ff88fe7812c812f967608 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/1172 Tested-by: build bot (Jenkins) Reviewed-by: Anton Kochkov <anton.kochkov@gmail.com>
Diffstat (limited to 'src/cpu/intel/hyperthreading/intel_sibling.c')
-rw-r--r--src/cpu/intel/hyperthreading/intel_sibling.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cpu/intel/hyperthreading/intel_sibling.c b/src/cpu/intel/hyperthreading/intel_sibling.c
index b9a9ae7bb1..f30ea45da5 100644
--- a/src/cpu/intel/hyperthreading/intel_sibling.c
+++ b/src/cpu/intel/hyperthreading/intel_sibling.c
@@ -28,8 +28,11 @@ int intel_ht_sibling(void)
apic_ids = 1;
core_ids = 1;
- if (cpuid_eax(0) >= 4)
- core_ids += (cpuid_eax(4) >> 26) & 0x3f;
+ if (cpuid_eax(0) >= 4) {
+ struct cpuid_result result;
+ result = cpuid_ext(4, 0);
+ core_ids += (result.eax >> 26) & 0x3f;
+ }
threads = (apic_ids / core_ids);
return !!(lapicid() & (threads-1));