Attention is currently required from: Patrick Rudolph. Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/58384 )
Change subject: cpu/intel/hyperthreading: Use cpuid_get_max_func() ......................................................................
cpu/intel/hyperthreading: Use cpuid_get_max_func()
Change-Id: I4b69b1d20b5a768c269d85f0ea23f79e02391a71 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/cpu/intel/common/hyperthreading.c 1 file changed, 5 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/84/58384/1
diff --git a/src/cpu/intel/common/hyperthreading.c b/src/cpu/intel/common/hyperthreading.c index 2936770..3297b381 100644 --- a/src/cpu/intel/common/hyperthreading.c +++ b/src/cpu/intel/common/hyperthreading.c @@ -19,24 +19,26 @@ { struct cpuid_result result; unsigned int core_ids, apic_ids, threads; + unsigned int max_leaf;
if (!intel_ht_supported()) return false;
- if (cpuid_eax(0) >= 0xb) { + max_leaf = cpuid_get_max_func(); + if (max_leaf >= 0xb) { result = cpuid_ext(0xb, 0); const uint32_t div = 1 << (result.eax & 0x1f); return result.edx % div > 0; }
apic_ids = 1; - if (cpuid_eax(0) >= 1) + if (max_leaf >= 1) apic_ids = (cpuid_ebx(1) >> 16) & 0xff; if (apic_ids == 0) apic_ids = 1;
core_ids = 1; - if (cpuid_eax(0) >= 4) { + if (max_leaf >= 4) { result = cpuid_ext(4, 0); core_ids += (result.eax >> 26) & 0x3f; }