diff options
Diffstat (limited to 'src/cpu/intel/model_206ax/model_206ax_init.c')
-rw-r--r-- | src/cpu/intel/model_206ax/model_206ax_init.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/cpu/intel/model_206ax/model_206ax_init.c b/src/cpu/intel/model_206ax/model_206ax_init.c index 2028af0196..922eb49538 100644 --- a/src/cpu/intel/model_206ax/model_206ax_init.c +++ b/src/cpu/intel/model_206ax/model_206ax_init.c @@ -37,8 +37,6 @@ #include "chip.h" #include <cpu/intel/smm/gen1/smi.h> -#define CORE_THREAD_COUNT_MSR 0x35 - /* * List of supported C-states in this processor * @@ -478,16 +476,24 @@ static void configure_mca(void) int cpu_get_apic_id_map(int *apic_id_map) { - msr_t msr; - int num_cpus, i; + struct cpuid_result result; + unsigned threads_per_package, threads_per_core, i, shift = 0; + + /* Logical processors (threads) per core */ + result = cpuid_ext(0xb, 0); + threads_per_core = result.ebx & 0xffff; + + /* Logical processors (threads) per package */ + result = cpuid_ext(0xb, 1); + threads_per_package = result.ebx & 0xffff; - msr = rdmsr(CORE_THREAD_COUNT_MSR); - num_cpus = msr.lo & 0xffff; + if (threads_per_core == 1) + shift++; - for (i = 0; i < num_cpus && i < CONFIG_MAX_CPUS; i++) - apic_id_map[i] = i; + for (i = 0; i < threads_per_package && i < CONFIG_MAX_CPUS; i++) + apic_id_map[i] = i << shift; - return num_cpus; + return threads_per_package; } /* |