Re: [PATCH] x86/smp: Factor out parts of native_smp_prepare_cpus()
From: Peter Zijlstra
Date: Mon Nov 08 2021 - 10:13:17 EST
On Tue, Nov 02, 2021 at 07:36:36PM -0400, Boris Ostrovsky wrote:
> Commit 66558b730f25 ("sched: Add cluster scheduler level for x86")
> introduced cpu_l2c_shared_map mask which is expected to be initialized
> by smp_op.smp_prepare_cpus(). That commit only updated
> native_smp_prepare_cpus() version but not xen_pv_smp_prepare_cpus().
> As result Xen PV guests crash in set_cpu_sibling_map().
>
> While the new mask can be allocated in xen_pv_smp_prepare_cpus() one can
> see that both versions of smp_prepare_cpus ops share a number of common
> operations that can be factored out. So do that instead.
>
> Fixes: 66558b730f25 ("sched: Add cluster scheduler level for x86")
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
Thanks! I'll go stick that somewhere /urgent (I've had another report on
that here:
https://lkml.kernel.org/r/20211105074139.GE174703@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
)
But looking at those functions; there seems to be more spurious
differences. For example, the whole sched_topology thing.
Should we re-architect this whole smp_prepare_cpus() thing instead? Have
a common function and a guest function? HyperV for instance seems to
call native_smp_prepare_cpus() and then does something extra (as does
xen_hvm).