cpu/x86/mp_init.c: Rename num_concurrent_stacks
This is just the amount of cpus so rename it for simplicity. Change-Id: Ib2156136894eeda4a29e8e694480abe06da62959 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/58699 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
parent
96451a7c6d
commit
2412c81fce
|
@ -763,7 +763,7 @@ static enum cb_err install_relocation_handler(int num_cpus, size_t real_save_sta
|
||||||
size_t save_state_size)
|
size_t save_state_size)
|
||||||
{
|
{
|
||||||
struct smm_loader_params smm_params = {
|
struct smm_loader_params smm_params = {
|
||||||
.num_concurrent_stacks = num_cpus,
|
.num_cpus = num_cpus,
|
||||||
.real_cpu_save_state_size = real_save_state_size,
|
.real_cpu_save_state_size = real_save_state_size,
|
||||||
.per_cpu_save_state_size = save_state_size,
|
.per_cpu_save_state_size = save_state_size,
|
||||||
.num_concurrent_save_states = 1,
|
.num_concurrent_save_states = 1,
|
||||||
|
@ -793,7 +793,7 @@ static enum cb_err install_permanent_handler(int num_cpus, uintptr_t smbase,
|
||||||
* size and save state size for each CPU.
|
* size and save state size for each CPU.
|
||||||
*/
|
*/
|
||||||
struct smm_loader_params smm_params = {
|
struct smm_loader_params smm_params = {
|
||||||
.num_concurrent_stacks = num_cpus,
|
.num_cpus = num_cpus,
|
||||||
.real_cpu_save_state_size = real_save_state_size,
|
.real_cpu_save_state_size = real_save_state_size,
|
||||||
.per_cpu_save_state_size = save_state_size,
|
.per_cpu_save_state_size = save_state_size,
|
||||||
.num_concurrent_save_states = num_cpus,
|
.num_concurrent_save_states = num_cpus,
|
||||||
|
|
|
@ -322,7 +322,7 @@ static int smm_module_setup_stub(const uintptr_t smbase, const size_t smm_size,
|
||||||
size = smm_size;
|
size = smm_size;
|
||||||
|
|
||||||
/* The number of concurrent stacks cannot exceed CONFIG_MAX_CPUS. */
|
/* The number of concurrent stacks cannot exceed CONFIG_MAX_CPUS. */
|
||||||
if (params->num_concurrent_stacks > CONFIG_MAX_CPUS) {
|
if (params->num_cpus > CONFIG_MAX_CPUS) {
|
||||||
printk(BIOS_ERR, "%s: not enough stacks\n", __func__);
|
printk(BIOS_ERR, "%s: not enough stacks\n", __func__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -397,7 +397,7 @@ static int smm_module_setup_stub(const uintptr_t smbase, const size_t smm_size,
|
||||||
__func__, smm_size);
|
__func__, smm_size);
|
||||||
|
|
||||||
/* Initialize the APIC id to CPU number table to be 1:1 */
|
/* Initialize the APIC id to CPU number table to be 1:1 */
|
||||||
for (i = 0; i < params->num_concurrent_stacks; i++)
|
for (i = 0; i < params->num_cpus; i++)
|
||||||
stub_params->apic_id_to_cpu[i] = i;
|
stub_params->apic_id_to_cpu[i] = i;
|
||||||
|
|
||||||
/* Allow the initiator to manipulate SMM stub parameters. */
|
/* Allow the initiator to manipulate SMM stub parameters. */
|
||||||
|
@ -429,8 +429,8 @@ int smm_setup_relocation_handler(struct smm_loader_params *params)
|
||||||
|
|
||||||
/* Since the relocation handler always uses stack, adjust the number
|
/* Since the relocation handler always uses stack, adjust the number
|
||||||
* of concurrent stack users to be CONFIG_MAX_CPUS. */
|
* of concurrent stack users to be CONFIG_MAX_CPUS. */
|
||||||
if (params->num_concurrent_stacks == 0)
|
if (params->num_cpus == 0)
|
||||||
params->num_concurrent_stacks = CONFIG_MAX_CPUS;
|
params->num_cpus = CONFIG_MAX_CPUS;
|
||||||
|
|
||||||
printk(BIOS_SPEW, "%s: exit\n", __func__);
|
printk(BIOS_SPEW, "%s: exit\n", __func__);
|
||||||
return smm_module_setup_stub(smram, SMM_DEFAULT_SIZE,
|
return smm_module_setup_stub(smram, SMM_DEFAULT_SIZE,
|
||||||
|
@ -506,7 +506,7 @@ int smm_load_module(const uintptr_t smram_base, const size_t smram_size,
|
||||||
|
|
||||||
/* FXSAVE goes below MSEG */
|
/* FXSAVE goes below MSEG */
|
||||||
if (CONFIG(SSE)) {
|
if (CONFIG(SSE)) {
|
||||||
fxsave_size = FXSAVE_SIZE * params->num_concurrent_stacks;
|
fxsave_size = FXSAVE_SIZE * params->num_cpus;
|
||||||
fxsave_area = (char *)base - fxsave_size;
|
fxsave_area = (char *)base - fxsave_size;
|
||||||
base -= fxsave_size;
|
base -= fxsave_size;
|
||||||
total_size += fxsave_size;
|
total_size += fxsave_size;
|
||||||
|
@ -548,7 +548,7 @@ int smm_load_module(const uintptr_t smram_base, const size_t smram_size,
|
||||||
handler_mod_params->smbase = smram_base;
|
handler_mod_params->smbase = smram_base;
|
||||||
handler_mod_params->smm_size = smram_size;
|
handler_mod_params->smm_size = smram_size;
|
||||||
handler_mod_params->save_state_size = params->real_cpu_save_state_size;
|
handler_mod_params->save_state_size = params->real_cpu_save_state_size;
|
||||||
handler_mod_params->num_cpus = params->num_concurrent_stacks;
|
handler_mod_params->num_cpus = params->num_cpus;
|
||||||
handler_mod_params->gnvs_ptr = (uintptr_t)acpi_get_gnvs();
|
handler_mod_params->gnvs_ptr = (uintptr_t)acpi_get_gnvs();
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "%s: smram_start: 0x%lx\n", __func__, smram_base);
|
printk(BIOS_DEBUG, "%s: smram_start: 0x%lx\n", __func__, smram_base);
|
||||||
|
@ -585,7 +585,7 @@ int smm_load_module(const uintptr_t smram_base, const size_t smram_size,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < params->num_concurrent_stacks; i++) {
|
for (int i = 0; i < params->num_cpus; i++) {
|
||||||
handler_mod_params->save_state_top[i] =
|
handler_mod_params->save_state_top[i] =
|
||||||
cpus[i].ss_start + params->per_cpu_save_state_size;
|
cpus[i].ss_start + params->per_cpu_save_state_size;
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,7 @@ static inline bool smm_points_to_smram(const void *ptr, const size_t len)
|
||||||
/* SMM Module Loading API */
|
/* SMM Module Loading API */
|
||||||
|
|
||||||
/* The smm_loader_params structure provides direction to the SMM loader:
|
/* The smm_loader_params structure provides direction to the SMM loader:
|
||||||
* - num_concurrent_stacks - number of concurrent cpus in handler needing stack
|
* - num_cpus - number of concurrent cpus in handler needing stack
|
||||||
* optional for setting up relocation handler.
|
* optional for setting up relocation handler.
|
||||||
* - per_cpu_save_state_size - the SMM save state size per cpu
|
* - per_cpu_save_state_size - the SMM save state size per cpu
|
||||||
* - num_concurrent_save_states - number of concurrent cpus needing save state
|
* - num_concurrent_save_states - number of concurrent cpus needing save state
|
||||||
|
@ -132,7 +132,7 @@ static inline bool smm_points_to_smram(const void *ptr, const size_t len)
|
||||||
* handle sparse APIC id space.
|
* handle sparse APIC id space.
|
||||||
*/
|
*/
|
||||||
struct smm_loader_params {
|
struct smm_loader_params {
|
||||||
size_t num_concurrent_stacks;
|
size_t num_cpus;
|
||||||
|
|
||||||
size_t real_cpu_save_state_size;
|
size_t real_cpu_save_state_size;
|
||||||
size_t per_cpu_save_state_size;
|
size_t per_cpu_save_state_size;
|
||||||
|
|
Loading…
Reference in New Issue