From 05fe16c4f344d3fe23725d35104d38dab590a746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Sun, 1 Dec 2019 08:38:11 +0200 Subject: console,monotonic_timer: Avoid calls from APs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/37398 Reviewed-by: Arthur Heymans Tested-by: build bot (Jenkins) --- src/console/printk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/console') diff --git a/src/console/printk.c b/src/console/printk.c index a08dd2f80f..b32fadb8b1 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); } -- cgit v1.2.3