From patchwork Thu Jul 16 15:17:37 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 35885 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6GFHhED010973 for ; Thu, 16 Jul 2009 15:17:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932390AbZGPPRk (ORCPT ); Thu, 16 Jul 2009 11:17:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757663AbZGPPRk (ORCPT ); Thu, 16 Jul 2009 11:17:40 -0400 Received: from mtagate2.de.ibm.com ([195.212.17.162]:48713 "EHLO mtagate2.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757648AbZGPPRj (ORCPT ); Thu, 16 Jul 2009 11:17:39 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate2.de.ibm.com (8.13.1/8.13.1) with ESMTP id n6GFHdvq006508; Thu, 16 Jul 2009 15:17:39 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n6GFHdTk1474780; Thu, 16 Jul 2009 17:17:39 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n6GFHcZ2012613; Thu, 16 Jul 2009 17:17:38 +0200 Received: from cborntra.localnet (dyn-9-152-224-56.boeblingen.de.ibm.com [9.152.224.56]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n6GFHcg0012610; Thu, 16 Jul 2009 17:17:38 +0200 From: Christian =?iso-8859-1?q?Borntr=E4ger?= To: Avi Kivity Subject: [PATCH] kvm-390: fix wait_queue handling Date: Thu, 16 Jul 2009 17:17:37 +0200 User-Agent: KMail/1.11.4 (Linux/2.6.30-release; KDE/4.2.4; i686; ; ) Cc: Julia Lawall , kvm@vger.kernel.org, Carsten Otte , linux-s390@vger.kernel.org, Martin Schwidefsky , Heiko Carstens References: <4A599D51.8030506@redhat.com> In-Reply-To: <4A599D51.8030506@redhat.com> Organization: IBM MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200907161717.38035.borntraeger@de.ibm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Christian Borntraeger There are two waitqueues in kvm for wait handling: vcpu->wq for virt/kvm/kvm_main.c and vpcu->arch.local_int.wq for the s390 specific wait code. the wait handling in kvm_s390_handle_wait was broken by using different wait_queues for add_wait queue and remove_wait_queue. There are two options to fix the problem: o move all the s390 specific code to vcpu->wq and remove vcpu->arch.local_int.wq o move all the s390 specific code to vcpu->arch.local_int.wq This patch chooses the 2nd variant for two reasons: o s390 does not use kvm_vcpu_block but implements its own enabled wait handling. Having a separate wait_queue make it clear, that our wait mechanism is different o the patch is much smaller Report-by: Julia Lawall Signed-off-by: Christian Borntraeger --- arch/s390/kvm/interrupt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: kvm/arch/s390/kvm/interrupt.c =================================================================== --- kvm.orig/arch/s390/kvm/interrupt.c +++ kvm/arch/s390/kvm/interrupt.c @@ -386,7 +386,7 @@ no_timer: } __unset_cpu_idle(vcpu); __set_current_state(TASK_RUNNING); - remove_wait_queue(&vcpu->wq, &wait); + remove_wait_queue(&vcpu->arch.local_int.wq, &wait); spin_unlock_bh(&vcpu->arch.local_int.lock); spin_unlock(&vcpu->arch.local_int.float_int->lock); hrtimer_try_to_cancel(&vcpu->arch.ckc_timer);