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:
parent
0aeedd42ee
commit
bdfa35315f
|
@ -23,6 +23,14 @@ bool intel_ht_sibling(void)
|
||||||
if (!intel_ht_supported())
|
if (!intel_ht_supported())
|
||||||
return false;
|
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;
|
apic_ids = 1;
|
||||||
if (cpuid_eax(0) >= 1)
|
if (cpuid_eax(0) >= 1)
|
||||||
apic_ids = (cpuid_ebx(1) >> 16) & 0xff;
|
apic_ids = (cpuid_ebx(1) >> 16) & 0xff;
|
||||||
|
|
Loading…
Reference in New Issue