[U-Boot] [PATCH 4/7] x86: qemu: use actual CPU number for allocating memory

Bin Meng bmeng.cn at gmail.com
Tue Dec 29 07:19:18 CET 2015


Hi Miao,

Please remove the qemu tag from the commit title, as this is a change
to common x86 codes.

On Mon, Dec 28, 2015 at 5:18 PM, Miao Yan <yanmiaobest at gmail.com> wrote:
> Use actual CPU number , instead of maximum cpu configured,

nits: remove the space after 'number'

> to allocate stack memory in 'load_sipi_vector'
>
> Signed-off-by: Miao Yan <yanmiaobest at gmail.com>
> ---
>  arch/x86/cpu/mp_init.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/cpu/mp_init.c b/arch/x86/cpu/mp_init.c
> index 2f34317..2a3ce48 100644
> --- a/arch/x86/cpu/mp_init.c
> +++ b/arch/x86/cpu/mp_init.c
> @@ -210,7 +210,7 @@ static int save_bsp_msrs(char *start, int size)
>         return msr_count;
>  }
>
> -static int load_sipi_vector(atomic_t **ap_countp)
> +static int load_sipi_vector(atomic_t **ap_countp, int num_cpus)
>  {
>         struct sipi_params_16bit *params16;
>         struct sipi_params *params;
> @@ -239,7 +239,7 @@ static int load_sipi_vector(atomic_t **ap_countp)
>         params->idt_ptr = (uint32_t)x86_get_idt();
>
>         params->stack_size = CONFIG_AP_STACK_SIZE;
> -       size = params->stack_size * CONFIG_MAX_CPUS;
> +       size = params->stack_size * num_cpus;
>         stack = memalign(size, 4096);
>         if (!stack)
>                 return -ENOMEM;
> @@ -483,7 +483,7 @@ int mp_init(struct mp_params *p)
>         mp_info.records = p->flight_plan;
>
>         /* Load the SIPI vector */
> -       ret = load_sipi_vector(&ap_count);
> +       ret = load_sipi_vector(&ap_count, num_cpus);
>         if (ap_count == NULL)
>                 return -1;
>
> --

Other than that,
Reviewed-by: Bin Meng <bmeng.cn at gmail.com>

Regards,
Bin


More information about the U-Boot mailing list