diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2019-12-01 08:38:11 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-12-06 15:11:02 +0000 |
commit | 05fe16c4f344d3fe23725d35104d38dab590a746 (patch) | |
tree | 41c87eb9d0006bd7e36c84f22ca4232cbb6081e6 /src | |
parent | 934ae21b52492c9c730dc5accd2900b32c5c1492 (diff) | |
download | coreboot-05fe16c4f344d3fe23725d35104d38dab590a746.tar.xz |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/console/printk.c | 6 |
1 files changed, 3 insertions, 3 deletions
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); } |