]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV: Fix some races in starting secondary threads
authorPaul Mackerras <paulus@samba.org>
Mon, 15 Oct 2012 01:16:14 +0000 (01:16 +0000)
committerAlexander Graf <agraf@suse.de>
Tue, 30 Oct 2012 09:54:54 +0000 (10:54 +0100)
commit05510aa662b1908537102e9506ae2cdc89ac8574
tree52dc3cea624002ca0cfc023b9336676850e6acbd
parentca846d70d03c502ea5fff3ab0c58ffe7ee9730e3
KVM: PPC: Book3S HV: Fix some races in starting secondary threads

Subsequent patches implementing in-kernel XICS emulation will make it
possible for IPIs to arrive at secondary threads at arbitrary times.
This fixes some races in how we start the secondary threads, which
if not fixed could lead to occasional crashes of the host kernel.

This makes sure that (a) we have grabbed all the secondary threads,
and verified that they are no longer in the kernel, before we start
any thread, (b) that the secondary thread loads its vcpu pointer
after clearing the IPI that woke it up (so we don't miss a wakeup),
and (c) that the secondary thread clears its vcpu pointer before
incrementing the nap count.  It also removes unnecessary setting
of the vcpu and vcore pointers in the paca in kvmppc_core_vcpu_load.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/kvm/book3s_hv_rmhandlers.S