cpu/intel/common: use lapicid api

Use lapicid api to support both x2apic mode and apic mode

BUG=None
BRANCH=None
TEST=boot to OS and check apic mode
cat /proc/cpuinfo | grep "apicid"

Signed-off-by: Wonkyu Kim <wonkyu.kim@intel.com>
Change-Id: I5ca5b09ae67941adcc07dfafdfe4ba78b0f81009
Reviewed-on: https://review.coreboot.org/c/coreboot/+/51725
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Wonkyu Kim 2021-03-22 20:08:11 -07:00 committed by Patrick Georgi
parent 0aeedd42ee
commit bdfa35315f
1 changed files with 8 additions and 0 deletions

View File

@ -23,6 +23,14 @@ bool intel_ht_sibling(void)
if (!intel_ht_supported())
return false;
if (is_x2apic_mode()) {
if (cpuid_eax(0) >= 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)
apic_ids = (cpuid_ebx(1) >> 16) & 0xff;