On 15.08.2022 13:04, Juergen Gross wrote:
> Cpu cpu unplugging is calling schedule_cpu_rm() via stop_machine_run()
> with interrupts disabled, thus any memory allocation or freeing must
> be avoided.
> 
> Since commit 5047cd1d5dea ("xen/common: Use enhanced
> ASSERT_ALLOC_CONTEXT in xmalloc()") this restriction is being enforced
> via an assertion, which will now fail.
> 
> Before that commit cpu unplugging in normal configurations was working
> just by chance as only the cpu performing schedule_cpu_rm() was doing
> active work. With core scheduling enabled, however, failures could
> result from memory allocations not being properly propagated to other
> cpus' TLBs.
> 
> Fix this mess by allocating needed memory before entering
> stop_machine_run() and freeing any memory only after having finished
> stop_machine_run().
> 
> Fixes: 1ec410112cdd ("xen/sched: support differing granularity in 
> schedule_cpu_[add/rm]()")
> Reported-by: Gao Ruifeng <[email protected]>
> Signed-off-by: Juergen Gross <[email protected]>

Reviewed-by: Jan Beulich <[email protected]>


Reply via email to