From patchwork Tue Feb 9 14:49:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 44909 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 7D210B7D03 for ; Wed, 10 Feb 2010 01:53:08 +1100 (EST) Received: from localhost ([127.0.0.1]:44200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NerQK-0005U7-4i for incoming@patchwork.ozlabs.org; Tue, 09 Feb 2010 09:50:44 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NerP7-0005U2-3b for qemu-devel@nongnu.org; Tue, 09 Feb 2010 09:49:29 -0500 Received: from [199.232.76.173] (port=45835 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NerP6-0005Tu-Ns for qemu-devel@nongnu.org; Tue, 09 Feb 2010 09:49:28 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NerP5-0002DN-90 for qemu-devel@nongnu.org; Tue, 09 Feb 2010 09:49:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:8936) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NerP4-0002DH-TV for qemu-devel@nongnu.org; Tue, 09 Feb 2010 09:49:27 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o19EnPkV032316 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2010 09:49:25 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o19EnOOf010937; Tue, 9 Feb 2010 09:49:24 -0500 Received: from amt.cnet (vpn-10-215.rdu.redhat.com [10.11.10.215]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o19EnMPn006740; Tue, 9 Feb 2010 09:49:23 -0500 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 57EC766E070; Tue, 9 Feb 2010 12:49:08 -0200 (BRST) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o19En4U7031433; Tue, 9 Feb 2010 12:49:04 -0200 Date: Tue, 9 Feb 2010 12:49:04 -0200 From: Marcelo Tosatti To: Jan Kiszka Message-ID: <20100209144904.GA31343@amt.cnet> References: <4B70143C.6000701@siemens.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4B70143C.6000701@siemens.com> User-Agent: Mutt/1.5.20 (2009-08-17) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Anthony Liguori , qemu-devel Subject: [Qemu-devel] [PATCH] iothread: fix vcpu stop with smp tcg 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 Round robin vcpus in tcg_cpu_next even if the vm stopped. This allows all cpus to enter stopped state. Signed-off-by: Marcelo Tosatti diff --git a/vl.c b/vl.c index 880bcd5..f61e362 100644 --- a/vl.c +++ b/vl.c @@ -3855,14 +3855,15 @@ static void tcg_cpu_exec(void) for (; next_cpu != NULL; next_cpu = next_cpu->next_cpu) { CPUState *env = cur_cpu = next_cpu; - if (!vm_running) - break; if (timer_alarm_pending) { timer_alarm_pending = 0; break; } if (cpu_can_run(env)) ret = qemu_cpu_exec(env); + else if (env->stop) + break; + if (ret == EXCP_DEBUG) { gdb_set_stop_cpu(env); debug_requested = 1;