aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorKane Chen <kane.chen@intel.corp-partner.google.com>2022-04-29 16:35:23 +0800
committerWerner Zeh <werner.zeh@siemens.com>2022-05-16 04:49:25 +0000
commitc9b1f8a28e90ff6890a4f74559f5136edc5a33f9 (patch)
treecff9eb50eb85a3bf618c7c24e22d750604eb45c4 /src/include
parent8b02bd1f8de71d852daf41df80d6bb27e86b90f7 (diff)
cpu/x86/mp_init.c: Add mp_run_on_all_cpus_synchronously
MTRR is a core level register which means 2 threads in one core share same MTRR. There is a race condition could happen that AP overrides BSP MTRR unintentionally. In order to prevent such race condition between BSP and APs, this patch provides a function to let BSP assign tasks to all APs and wait them to complete the assigned tasks. BUG=b:225766934 Change-Id: I8d1d49bca410c821a3ad0347548afc42eb860594 Signed-off-by: Kane Chen <kane.chen@intel.corp-partner.google.com> Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63566 Reviewed-by: Subrata Banik <subratabanik@google.com> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/cpu/x86/mp.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/cpu/x86/mp.h b/src/include/cpu/x86/mp.h
index 1b4c956b59..8105477c49 100644
--- a/src/include/cpu/x86/mp.h
+++ b/src/include/cpu/x86/mp.h
@@ -117,6 +117,10 @@ enum cb_err mp_run_on_all_aps(void (*func)(void *), void *arg, long expire_us,
/* Like mp_run_on_aps() but also runs func on BSP. */
enum cb_err mp_run_on_all_cpus(void (*func)(void *), void *arg);
+/* Like mp_run_on_all_cpus but make sure all APs finish executing the
+ function call. The time limit on a function call is 1 second. */
+enum cb_err mp_run_on_all_cpus_synchronously(void (*func)(void *), void *arg);
+
/*
* Park all APs to prepare for OS boot. This is handled automatically
* by the coreboot infrastructure.