aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kvm/book3s_hv.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index cd7e030087f8..1a7a281be3bd 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -1828,9 +1828,29 @@ static void kvmppc_wait_for_exec(struct kvm_vcpu *vcpu, int wait_state)
1828 */ 1828 */
1829static void kvmppc_vcore_blocked(struct kvmppc_vcore *vc) 1829static void kvmppc_vcore_blocked(struct kvmppc_vcore *vc)
1830{ 1830{
1831 struct kvm_vcpu *vcpu;
1832 int do_sleep = 1;
1833
1831 DEFINE_WAIT(wait); 1834 DEFINE_WAIT(wait);
1832 1835
1833 prepare_to_wait(&vc->wq, &wait, TASK_INTERRUPTIBLE); 1836 prepare_to_wait(&vc->wq, &wait, TASK_INTERRUPTIBLE);
1837
1838 /*
1839 * Check one last time for pending exceptions and ceded state after
1840 * we put ourselves on the wait queue
1841 */
1842 list_for_each_entry(vcpu, &vc->runnable_threads, arch.run_list) {
1843 if (vcpu->arch.pending_exceptions || !vcpu->arch.ceded) {
1844 do_sleep = 0;
1845 break;
1846 }
1847 }
1848
1849 if (!do_sleep) {
1850 finish_wait(&vc->wq, &wait);
1851 return;
1852 }
1853
1834 vc->vcore_state = VCORE_SLEEPING; 1854 vc->vcore_state = VCORE_SLEEPING;
1835 spin_unlock(&vc->lock); 1855 spin_unlock(&vc->lock);
1836 schedule(); 1856 schedule();