Subrata Banik has submitted this change. ( https://review.coreboot.org/c/coreboot/+/81663?usp=email )
(
11 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: drivers/intel/fsp2_0: Add dedicated caller function for ap procedure calls ......................................................................
drivers/intel/fsp2_0: Add dedicated caller function for ap procedure calls
Add FSP 2 Multi Processor Platform Initialization module a function indirection to ensure that efi_ap_procedure functions are called with the appropriate C calling convention.
BUG=b:329034258 TEST=Verified both x86_32 and x86_64 builds on Meteor Lake board (Rex)
Change-Id: I64e65b2941207375d5e27c84aa26061e7e72a7f6 Signed-off-by: Appukuttan V K appukuttan.vk@intel.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/81663 Reviewed-by: Subrata Banik subratabanik@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/drivers/intel/fsp2_0/ppi/mp_service_ppi.c 1 file changed, 32 insertions(+), 5 deletions(-)
Approvals: Subrata Banik: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/src/drivers/intel/fsp2_0/ppi/mp_service_ppi.c b/src/drivers/intel/fsp2_0/ppi/mp_service_ppi.c index a891ba0..41fccd6 100644 --- a/src/drivers/intel/fsp2_0/ppi/mp_service_ppi.c +++ b/src/drivers/intel/fsp2_0/ppi/mp_service_ppi.c @@ -12,6 +12,18 @@
#define BSP_CPU_SLOT 0
+struct efi_ap_procedure_caller_params { + efi_ap_procedure procedure; + void *argument; +}; + +static void efi_ap_procedure_caller(void *arg) +{ + struct efi_ap_procedure_caller_params *params = + (struct efi_ap_procedure_caller_params *)arg; + params->procedure(params->argument); +} + efi_return_status_t mp_get_number_of_processors(efi_uintn_t *number_of_processors, efi_uintn_t *number_of_enabled_processors) { @@ -58,14 +70,19 @@ efi_return_status_t mp_startup_all_aps(efi_ap_procedure procedure, bool run_serial, efi_uintn_t timeout_usec, void *argument) { + struct efi_ap_procedure_caller_params params = { + .procedure = procedure, + .argument = argument + }; + if (!cpu_info()) return FSP_DEVICE_ERROR;
if (procedure == NULL) return FSP_INVALID_PARAMETER;
- if (mp_run_on_all_aps((void *)procedure, argument, timeout_usec, !run_serial) != - CB_SUCCESS) { + if (mp_run_on_all_aps((void *)efi_ap_procedure_caller, ¶ms, + timeout_usec, !run_serial) != CB_SUCCESS) { printk(BIOS_DEBUG, "%s: Exit with Failure\n", __func__); return FSP_NOT_STARTED; } @@ -76,6 +93,11 @@ efi_return_status_t mp_startup_all_cpus(efi_ap_procedure procedure, efi_uintn_t timeout_usec, void *argument) { + struct efi_ap_procedure_caller_params params = { + .procedure = procedure, + .argument = argument + }; + if (!cpu_info()) return FSP_DEVICE_ERROR;
@@ -99,8 +121,8 @@ * due to lack of acquiring a spin lock while accessing common data structure in * multiprocessor environment. */ - if (mp_run_on_all_aps((void *)procedure, argument, timeout_usec, false) != - CB_SUCCESS) { + if (mp_run_on_all_aps((void *)efi_ap_procedure_caller, + ¶ms, timeout_usec, false) != CB_SUCCESS) { printk(BIOS_DEBUG, "%s: Exit with Failure\n", __func__); return FSP_NOT_STARTED; } @@ -111,6 +133,11 @@ efi_return_status_t mp_startup_this_ap(efi_ap_procedure procedure, efi_uintn_t processor_number, efi_uintn_t timeout_usec, void *argument) { + struct efi_ap_procedure_caller_params params = { + .procedure = procedure, + .argument = argument + }; + if (!cpu_info()) return FSP_DEVICE_ERROR;
@@ -123,7 +150,7 @@ if (procedure == NULL) return FSP_INVALID_PARAMETER;
- if (mp_run_on_aps((void *)procedure, argument, + if (mp_run_on_aps((void *)efi_ap_procedure_caller, ¶ms, processor_number, timeout_usec) != CB_SUCCESS) { printk(BIOS_DEBUG, "%s: Exit with Failure\n", __func__); return FSP_NOT_STARTED;