Re: [RFC PATCH v3 30/37] kvx: Add multi-processor (SMP) support

From: Thomas Gleixner
Date: Sat Jul 27 2024 - 10:22:54 EST


On Mon, Jul 22 2024 at 11:41, ysionneau@xxxxxxxxxxxxx wrote:
> +
> +int __cpu_up(unsigned int cpu, struct task_struct *tidle)
> +{
> + int ret;
> +
> + __cpu_up_stack_pointer[cpu] = task_stack_page(tidle) + THREAD_SIZE;
> + __cpu_up_task_pointer[cpu] = tidle;
> + /* We need to be sure writes are committed */
> + smp_mb();
> +
> + if (!smp_ops.smp_boot_secondary) {
> + pr_err_once("No smp_ops registered: could not bring up secondary CPUs\n");
> + return -ENOSYS;
> + }
> +
> + ret = smp_ops.smp_boot_secondary(cpu);
> + if (ret == 0) {
> + /* CPU was successfully started */
> + while (!cpu_online(cpu))
> + cpu_relax();

Please use the generic CPU hotplug synchronization mechanisms CONFIG_HOTPLUG_*_SYNC

Thanks,

tglx