On 28.02.20 09:27, Jan Beulich wrote:
On 28.02.2020 08:19, Juergen Gross wrote:
With core scheduling active it is mandatory for stop_machine_run() to
be called in idle context only (so either during boot or in a tasklet),
as otherwise a scheduling deadlock would occur: stop_machine_run()
does a cpu rendezvous by activating a tasklet on all other cpus. In
case stop_machine_run() was not called in an idle vcpu it would block
scheduling the idle vcpu on its siblings with core scheduling being
active, resulting in a hang.

Put a BUG_ON() into stop_machine_run() to test for being called in an
idle vcpu only and adapt the missing call site (ucode loading) to use a
tasklet for calling stop_machine_run().

Signed-off-by: Juergen Gross <jgr...@suse.com>
---
V2:
- rephrase commit message (Julien Grall)
---
  xen/arch/x86/microcode.c  | 54 +++++++++++++++++++++++++++++------------------
  xen/common/stop_machine.c |  1 +
  2 files changed, 35 insertions(+), 20 deletions(-)

There's no mention anywhere of a connection to your RCU series,
nor to rcu_barrier(). Yet the change puts a new restriction also
on its use, and iirc this was mentioned in prior discussion. Did
I miss anything?

Basically this patch makes the restriction explicit. Without the patch
stop_machine_run() being called outside of a tasklet would just hang
with core scheduling being active. Now it will catch those violations
early even with core scheduling inactive.

Note that currently there are no violations of this restriction anywhere
in the hypervisor other than the one addressed by this patch.


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to