
On Fri, Jul 17, 2020 at 10:49 PM Simon Glass sjg@chromium.org wrote:
Add a way to run a function on a selection of CPUs. This supports either a single CPU, all CPUs, just the main CPU or just the 'APs', in Intel terminology.
It works by writing into a mailbox and then waiting for the CPUs to notice it, take action and indicate they are done.
When SMP is not yet enabled, this just calls the function on the main CPU.
Signed-off-by: Simon Glass sjg@chromium.org Reviewed-by: Wolfgang Wallner wolfgang.wallner@br-automation.com
(no changes since v4)
Changes in v4:
- Only enable this feature of CONFIG_SMP_AP_WORK is enabled
- Allow running on the BSP if SMP is not enabled
Changes in v3:
- Add a comment to run_ap_work()
- Rename flag to GD_FLG_SMP_READY
- Update the comment for run_ap_work() to explain logical_cpu_number
- Clarify meaning of @cpu_select in mp_run_on_cpus() comment
arch/x86/cpu/mp_init.c | 107 +++++++++++++++++++++++++++++++++++--- arch/x86/include/asm/mp.h | 33 ++++++++++++ 2 files changed, 134 insertions(+), 6 deletions(-)
Reviewed-by: Bin Meng bmeng.cn@gmail.com