summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2021-05-31 15:15:27 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2021-06-07 21:03:39 +0000
commit34806cce60002a4f06b8724d79d2558385988e98 (patch)
tree837a1442f2ce7cff53874e4a9578c285b446f0a9
parent41a2c73b064b6ab68e63dd8ce75ef07561d2857d (diff)
arch/x86: Do not call lapicid() without SMP
The LAPIC may not be enabled or implemented. Change-Id: I2e0f42641ca15d177590d1696475054eda6ce125 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/55244 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Wonkyu Kim <wonkyu.kim@intel.com> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
-rw-r--r--src/arch/x86/exception.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/arch/x86/exception.c b/src/arch/x86/exception.c
index f10c7bf8ba..aa94d3fe73 100644
--- a/src/arch/x86/exception.c
+++ b/src/arch/x86/exception.c
@@ -486,6 +486,7 @@ void x86_exception(struct eregs *info)
#else /* !CONFIG_GDB_STUB */
int logical_processor = 0;
+ u32 apic_id = CONFIG(SMP) ? lapicid() : 0;
#if ENV_RAMSTAGE
logical_processor = cpu_index();
@@ -505,7 +506,7 @@ void x86_exception(struct eregs *info)
"r10: %016llx r11: %016llx\n"
"r12: %016llx r13: %016llx\n"
"r14: %016llx r15: %016llx\n",
- logical_processor, (unsigned int)lapicid(),
+ logical_processor, apic_id,
info->vector, info->cs, info->rip,
info->error_code, info->rflags, read_cr2(),
info->rax, info->rbx, info->rcx, info->rdx,
@@ -522,7 +523,7 @@ void x86_exception(struct eregs *info)
"Code: %d eflags: %08x cr2: %08x\n"
"eax: %08x ebx: %08x ecx: %08x edx: %08x\n"
"edi: %08x esi: %08x ebp: %08x esp: %08x\n",
- logical_processor, (unsigned int)lapicid(),
+ logical_processor, apic_id,
info->vector, info->cs, info->eip,
info->error_code, info->eflags, read_cr2(),
info->eax, info->ebx, info->ecx, info->edx,