Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/37398 )
Change subject: console,monotonic_timer: Avoid calls from APs ......................................................................
console,monotonic_timer: Avoid calls from APs
The code in cpu/x86/lapic/apic_timer.c for timer_monotonic_get() is not SMP safe as LAPIC timers do not run as synchronised as TSCs.
The times reported for console for boot_states does not accumulate from APs now. Also remove console time tracking from ENV_SMM.
Change-Id: I1ea2c1e7172f8ab3692b42dee3f669c5942d864a Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/37398 Reviewed-by: Arthur Heymans arthur@aheymans.xyz Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/console/printk.c 1 file changed, 3 insertions(+), 3 deletions(-)
Approvals: build bot (Jenkins): Verified Arthur Heymans: Looks good to me, approved
diff --git a/src/console/printk.c b/src/console/printk.c index a08dd2f..b32fadb 100644 --- a/src/console/printk.c +++ b/src/console/printk.c @@ -25,20 +25,20 @@
DECLARE_SPIN_LOCK(console_lock)
-#define TRACK_CONSOLE_TIME (CONFIG(HAVE_MONOTONIC_TIMER)) +#define TRACK_CONSOLE_TIME (!ENV_SMM && CONFIG(HAVE_MONOTONIC_TIMER))
static struct mono_time mt_start, mt_stop; static long console_usecs;
static void console_time_run(void) { - if (TRACK_CONSOLE_TIME) + if (TRACK_CONSOLE_TIME && boot_cpu()) timer_monotonic_get(&mt_start); }
static void console_time_stop(void) { - if (TRACK_CONSOLE_TIME) { + if (TRACK_CONSOLE_TIME && boot_cpu()) { timer_monotonic_get(&mt_stop); console_usecs += mono_time_diff_microseconds(&mt_start, &mt_stop); }