From patchwork Mon Feb 21 08:43:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 83793 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 874B8B715C for ; Mon, 21 Feb 2011 20:16:24 +1100 (EST) Received: from localhost ([127.0.0.1]:50426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrRsR-0006uC-NJ for incoming@patchwork.ozlabs.org; Mon, 21 Feb 2011 04:16:19 -0500 Received: from [140.186.70.92] (port=49411 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrRNI-0004hx-Cl for qemu-devel@nongnu.org; Mon, 21 Feb 2011 03:44:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrRNH-0000OU-5d for qemu-devel@nongnu.org; Mon, 21 Feb 2011 03:44:08 -0500 Received: from mail-wy0-f173.google.com ([74.125.82.173]:61006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrRNH-0000I2-1U for qemu-devel@nongnu.org; Mon, 21 Feb 2011 03:44:07 -0500 Received: by mail-wy0-f173.google.com with SMTP id 29so1150726wyb.4 for ; Mon, 21 Feb 2011 00:44:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:subject:date:message-id:x-mailer :in-reply-to:references; bh=HWwhr2YsZLUhX8fM5YEdh0pZNVoDMiYk5CnYvvpLqU0=; b=PovjSZwmyFZaUyo5dPwAK4vfCc1CCGGVy2OnDZ3vxtIGTAufrFvnF94YSQrJlox8Dc ifKMTPDCUzBqbepyLycbXt3HO85AuvMnqK43amdVVwS0bIVqAylRH1HUZWTkPj+7aqXG iRuYLarxHFWeZpRObhvoomjXuxnY/lvMlvXGM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; b=Bwx11zN6zPBnR96wFVO8P20l9MourDGzM9+zP7o3ZnVIqaHazVAW+R3ke2wP4Iufp+ zE95b1b3TR0GASWA/RSTkWC3BzzGD5wOotSE1c1queI7MHxOqZmcZVR/mqcP4AlasGrO ZN7YGHdSbyoLzTYVSiYXWI/ZcNjTRjCc+BVXk= Received: by 10.216.150.164 with SMTP id z36mr925622wej.52.1298277846647; Mon, 21 Feb 2011 00:44:06 -0800 (PST) Received: from localhost.localdomain (93-34-149-100.ip50.fastwebnet.it [93.34.149.100]) by mx.google.com with ESMTPS id t5sm1945464wes.9.2011.02.21.00.44.05 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 21 Feb 2011 00:44:05 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 21 Feb 2011 09:43:32 +0100 Message-Id: <1298277820-8817-14-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.3.5 In-Reply-To: <1298277820-8817-1-git-send-email-pbonzini@redhat.com> References: <1298277820-8817-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.173 Subject: [Qemu-devel] [PATCH 13/21] do not use timedwait on qemu_halt_cond X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The following conditions can cause cpu_has_work(env) to become true: * env->queued_work_first: run_on_cpu is already kicking the VCPU * env->stop = 1: pause_all_vcpus is already kicking the VCPU * env->stopped = 0: resume_all_vcpus is already kicking the VCPU * vm_running = 1: vm_start is calling resume_all_vcpus * env->halted = 0: see previous patch * qemu_cpu_has_work(env): when it becomes true, board code should set env->halted = 0 too. cpu_interrupt kicks the VCPU, too. Signed-off-by: Paolo Bonzini --- cpus.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index 670a42d..868857d 100644 --- a/cpus.c +++ b/cpus.c @@ -771,7 +771,7 @@ static void qemu_tcg_wait_io_event(void) CPUState *env; while (all_cpu_threads_idle()) { - qemu_cond_timedwait(tcg_halt_cond, &qemu_global_mutex, 1000); + qemu_cond_wait(tcg_halt_cond, &qemu_global_mutex); } qemu_mutex_unlock(&qemu_global_mutex); @@ -794,7 +794,7 @@ static void qemu_tcg_wait_io_event(void) static void qemu_kvm_wait_io_event(CPUState *env) { while (cpu_thread_is_idle(env)) { - qemu_cond_timedwait(env->halt_cond, &qemu_global_mutex, 1000); + qemu_cond_wait(env->halt_cond, &qemu_global_mutex); } qemu_kvm_eat_signals(env);