]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV: Drop locks around call to kvmppc_pin_guest_page
authorPaul Mackerras <paulus@samba.org>
Fri, 1 Jun 2012 10:20:24 +0000 (20:20 +1000)
committerAvi Kivity <avi@redhat.com>
Tue, 19 Jun 2012 12:04:13 +0000 (15:04 +0300)
commitc2fdecdb4be5670d4b88ae627ee12d8272c1214b
tree057cb2a7b22d55cd50275a5a5dff6b8ce56abbb7
parentea3a4cca52c0821eec9dd19330133b92952d2d73
KVM: PPC: Book3S HV: Drop locks around call to kvmppc_pin_guest_page

At the moment we call kvmppc_pin_guest_page() in kvmppc_update_vpa()
with two spinlocks held: the vcore lock and the vcpu->vpa_update_lock.
This is not good, since kvmppc_pin_guest_page() calls down_read() and
get_user_pages_fast(), both of which can sleep.  This bug was introduced
in fca55ae8 ("KVM: PPC: Book3S HV: Make virtual processor area
registration more robust").

This arranges to drop those spinlocks before calling
kvmppc_pin_guest_page() and re-take them afterwards.  Dropping the
vcore lock in kvmppc_run_core() means we have to set the vcore_state
field to VCORE_RUNNING before we drop the lock, so that other vcpus
won't try to run this vcore.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/powerpc/kvm/book3s_hv.c