On Thu, 2020-02-13 at 15:35 +0100, Juergen Gross wrote: > get_cpu_idle_time() is calling vcpu_runstate_get() for an idle vcpu. > With core scheduling active this is fragile, as idle vcpus are > assigned > to other scheduling units temporarily, and that assignment is changed > in some cases without holding the scheduling lock, and > vcpu_runstate_get() is using v->sched_unit as parameter for > unit_schedule_[un]lock_irq(), resulting in an ASSERT() triggering in > unlock in case v->sched_unit has changed meanwhile. > > Fix that by using a local unit variable holding the correct unit. > > Signed-off-by: Juergen Gross > Reviewed-by: Dario Faggioli And... > I have verified that all other uses of v->sched_unit are not > problematic: they are all for non-idle vcpus, or in scheduling paths > dealing with scheduling themselves and thus being aware of the > potential problem or not vulnerable by it. > ... Thanks for having done this as well. :-) Regards -- Dario Faggioli, Ph.D http://about.me/dario.faggioli Virtualization Software Engineer SUSE Labs, SUSE https://www.suse.com/ ------------------------------------------------------------------- <> (Raistlin Majere)