soc/intel/common: Use mp_run_on_all_cpus_synchronously for APs MTRR init

By using mp_run_on_all_cpus_synchronously to run APs MTRR init, it
gurantees the BSP will run post_cpus_add_romcache until all APs finishes
_x86_setup_mtrrs task.

BUG=b:225766934
TEST=Test on redrix and found the MTRR race condition on AP/BSP is gone.

Change-Id: I1fd889f880a0c605e6c739423a434d2adbc12d26
Signed-off-by: Kane Chen <kane.chen@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63567
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
This commit is contained in:
Kane Chen 2022-04-12 09:12:59 +08:00 committed by Werner Zeh
parent c9b1f8a28e
commit 2e96eebf01
1 changed files with 2 additions and 1 deletions

View File

@ -169,7 +169,8 @@ static void wrapper_x86_setup_mtrrs(void *unused)
/* Ensure to re-program all MTRRs based on DRAM resource settings */ /* Ensure to re-program all MTRRs based on DRAM resource settings */
static void post_cpus_init(void *unused) static void post_cpus_init(void *unused)
{ {
if (mp_run_on_all_cpus(&wrapper_x86_setup_mtrrs, NULL) != CB_SUCCESS) /* Ensure all APs finish the task and continue */
if (mp_run_on_all_cpus_synchronously(&wrapper_x86_setup_mtrrs, NULL) != CB_SUCCESS)
printk(BIOS_ERR, "MTRR programming failure\n"); printk(BIOS_ERR, "MTRR programming failure\n");
post_cpus_add_romcache(); post_cpus_add_romcache();