[PATCH v2 10/25] x86: mp: Support APs waiting for instructions

Wolfgang Wallner wolfgang.wallner at br-automation.com
Tue Jun 16 13:30:23 CEST 2020


Hi Simon,

-----"Simon Glass" <sjg at chromium.org> schrieb: -----
> Betreff: [PATCH v2 10/25] x86: mp: Support APs waiting for instructions
> 
> At present the APs (non-boot CPUs) are inited once and then parked ready
> for the OS to use them. However in some cases we want to send new requests
> through, such as to change MTRRs and keep them consistent across CPUs.
> 
> Change the last state of the flight plan to go into a wait loop, accepting
> instructions from the main CPU.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> 
> Changes in v2:
> - Add more comments
> 
>  arch/x86/cpu/mp_init.c    | 126 +++++++++++++++++++++++++++++++++++---
>  arch/x86/include/asm/mp.h |  11 ++++
>  2 files changed, 128 insertions(+), 9 deletions(-)

[snip]

> @@ -455,6 +478,86 @@ static int get_bsp(struct udevice **devp, int *cpu_countp)
>  	return dev->req_seq;
>  }
>  
> +/**
> + * read_callback() - Read the pointer in a callback slot
> + *
> + * This is called by APs to read their callback slow to see if there is a

Typo: callback slot

> + * pointer to new instructions
> + *
> + * @slot: Pointer to the AP's callback slot
> + * @return value of that pointer
> + */
> +static struct mp_callback *read_callback(struct mp_callback **slot)
> +{
> +	struct mp_callback *ret;
> +
> +	asm volatile ("mov	%1, %0\n"
> +		: "=r" (ret)
> +		: "m" (*slot)
> +		: "memory"
> +	);
> +	return ret;
> +}

[snip]


Reviewed-by: Wolfgang Wallner <wolfgang.wallner at br-automation.com>


More information about the U-Boot mailing list