diff options
author | Paul Mackerras <paulus@ozlabs.org> | 2018-10-08 07:30:54 +0200 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-10-09 07:04:27 +0200 |
commit | 53655ddd7771f703071ac81cc5823eae509b6653 (patch) | |
tree | 6e2d612098d8b5114035e352dd3b4d4f0e900a8a /arch/powerpc/kvm/book3s_xive.c | |
parent | KVM: PPC: Book3S: Rework TM save/restore code and make it C-callable (diff) | |
download | linux-53655ddd7771f703071ac81cc5823eae509b6653.tar.xz linux-53655ddd7771f703071ac81cc5823eae509b6653.zip |
KVM: PPC: Book3S HV: Call kvmppc_handle_exit_hv() with vcore unlocked
Currently kvmppc_handle_exit_hv() is called with the vcore lock held
because it is called within a for_each_runnable_thread loop.
However, we already unlock the vcore within kvmppc_handle_exit_hv()
under certain circumstances, and this is safe because (a) any vcpus
that become runnable and are added to the runnable set by
kvmppc_run_vcpu() have their vcpu->arch.trap == 0 and can't actually
run in the guest (because the vcore state is VCORE_EXITING), and
(b) for_each_runnable_thread is safe against addition or removal
of vcpus from the runnable set.
Therefore, in order to simplify things for following patches, let's
drop the vcore lock in the for_each_runnable_thread loop, so
kvmppc_handle_exit_hv() gets called without the vcore lock held.
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kvm/book3s_xive.c')
0 files changed, 0 insertions, 0 deletions