diff options
author | Felix Held <felix.held@amd.corp-partner.google.com> | 2021-10-19 02:57:22 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-10-20 22:43:10 +0000 |
commit | a8772dbb1ba4a8204c80a8ebf066e4107a7f7f7e (patch) | |
tree | 24cfdb74d4a5d12e77f6876f6c442d54f390444b /src/cpu | |
parent | 64ed1f1f86826fa8f2e165b8ae27b9658546972a (diff) |
cpu/x86/mp_init: rework start_aps to fix X86_AMD_INIT_SIPI case
When CONFIG_X86_AMD_INIT_SIPI was set, the second/final SIPI that
afterwards checks if all APs have checked in was skipped and if it got
so far, start_aps returned CB_SUCCESS despite not having checked if all
APs had checked in after the SIPI. This patch makes start_aps skip the
first SIPI in the CONFIG_X86_AMD_INIT_SIPI case so we use the proper
timeouts and error handling for the final and this case only SIPI and
signal the caller an error when not all APs have checked in after the
SIPI.
A timeless build for lenovo/x230 which is a mainboard that doesn't
select X86_AMD_INIT_SIPI results in identical binary, so this doesn't
change the behavior of the !X86_AMD_INIT_SIPI case.
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I39438229497c5d9c44dc7e247c7b2c81252b4bdb
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58456
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src/cpu')
-rw-r--r-- | src/cpu/x86/mp_init.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c index 806fc98123..fd2add0b9b 100644 --- a/src/cpu/x86/mp_init.c +++ b/src/cpu/x86/mp_init.c @@ -486,19 +486,16 @@ static enum cb_err start_aps(struct bus *cpu_bus, int ap_count, atomic_t *num_ap if (!CONFIG(X86_AMD_INIT_SIPI)) { printk(BIOS_DEBUG, "Waiting for 10ms after sending INIT.\n"); mdelay(10); - } - - /* Send 1st Startup IPI (SIPI) */ - if (send_sipi_to_aps(ap_count, num_aps, sipi_vector) != CB_SUCCESS) - return CB_ERR; - /* Wait for CPUs to check in up to 200 us. */ - wait_for_aps(num_aps, ap_count, 200 /* us */, 15 /* us */); + /* Send 1st Startup IPI (SIPI) */ + if (send_sipi_to_aps(ap_count, num_aps, sipi_vector) != CB_SUCCESS) + return CB_ERR; - if (CONFIG(X86_AMD_INIT_SIPI)) - return CB_SUCCESS; + /* Wait for CPUs to check in up to 200 us. */ + wait_for_aps(num_aps, ap_count, 200 /* us */, 15 /* us */); + } - /* Send 2nd SIPI */ + /* Send final SIPI */ if (send_sipi_to_aps(ap_count, num_aps, sipi_vector) != CB_SUCCESS) return CB_ERR; |