From nobody Thu Oct 30 15:31:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1525817826151147.24607337049076; Tue, 8 May 2018 15:17:06 -0700 (PDT) Received: from localhost ([::1]:53515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGAuv-0004BE-Cj for importer@patchew.org; Tue, 08 May 2018 18:17:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGAsr-0002pe-Cl for qemu-devel@nongnu.org; Tue, 08 May 2018 18:14:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGAsq-0001Hd-0D for qemu-devel@nongnu.org; Tue, 08 May 2018 18:14:57 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:53762) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fGAsp-0001HG-Pz; Tue, 08 May 2018 18:14:55 -0400 Received: by mail-wm0-x241.google.com with SMTP id a67so21142706wmf.3; Tue, 08 May 2018 15:14:55 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-189-60.clienti.tiscali.it. [78.12.189.60]) by smtp.gmail.com with ESMTPSA id c15-v6sm14020129edr.78.2018.05.08.15.14.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 May 2018 15:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VLpWAGjlfONt03LN4EEaNlcSVAGHaIeDnHYYQeKu3V0=; b=XpklhMJtryE7Yy0Cctt7VpO3yrZbq68g8BoUzN+CI0lmdtl/eV1TwiHUlJK+8tZ2sZ wUoCt1DeErCc4zqmpVXF33Q6JZVTboqYVkjeML0z6wmtUxq7mz4d8lZoGU2TWo1xgBLV u1dS6MQj3CBZoapysCBs/32FLIaKlsNVycx1tSUuvw+3ypybH279J5CKTzNIPwPls67s ECnvYOJztEcZ6RQMuAeGGuGIEphXGiTZlQolDKhxlRDiIhJpKV1DwhR2BCQCrRqeQNlW ho5vBY4Aje1mxZMkO8jk7IlyaDRcN0l1eGUrA/EV91hg8nknzhwFfxMM/fNChf/cMwWR zFnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=VLpWAGjlfONt03LN4EEaNlcSVAGHaIeDnHYYQeKu3V0=; b=GT+dWHCajHKL6OtQh/nFJw7rWuFkC0dUpRIBRSFcjgg2R3b3+2vLNW9HS5p0q+lwcO H/OqEd0QAWLpK+cVlMiYZ2aXTzhRWLoNM/lyF0y7A/4gaAf+FoB/RE/LWm1z4J+kKwKo NT22cfOUUmkBs40xVtj7I/oyjrYsprBB0kv7tt6NcX4PVwdglAz6o8XCG75kFqnPNW7r LobBapfoihoFZkVC5r3KdnIvzuU+B3lqDx5+bq7CcZgJYQtyFBEzU94MKpNRtVEojEmu xnHVHu+KFFYkx4gvhUxairC8Vo5+WQ8px+Q/4izBP6EJMWhXP7B3Rs0rN3dD+307H+9q F+Fw== X-Gm-Message-State: ALQs6tCgfZQ3O4GKmxx36OpDTG16Qo5ShrACIMR5Tk2h7vXDut8AMtcb Gj709ssxkJa+u/164ovycVtSQoPJ X-Google-Smtp-Source: AB8JxZrjbhmv3i8568yGPUUrB8Xmd0rsG7aXJkjMJClBW4fPtLubEdNDVr13+Z/FH9hyqLELgtxVuQ== X-Received: by 2002:aa7:d5d1:: with SMTP id d17-v6mr55244955eds.312.1525817694468; Tue, 08 May 2018 15:14:54 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 9 May 2018 00:14:20 +0200 Message-Id: <1525817687-34620-4-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1525817687-34620-1-git-send-email-pbonzini@redhat.com> References: <1525817687-34620-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 03/30] cpus: tcg: fix never exiting loop on unplug X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: C=C3=A9dric Le Goater Commit 9b0605f9837b ("cpus: tcg: unregister thread with RCU, fix exiting of loop on unplug") changed the exit condition of the loop in the vCPU thread function but forgot to remove the beginning 'while (1)' statement. The resulting code : while (1) { ... } while (!cpu->unplug || cpu_can_run(cpu)); is a sequence of two distinct two while() loops, the first not exiting in case of an unplug event. Remove the first while (1) to fix CPU unplug. Signed-off-by: C=C3=83=C2=A9dric Le Goater Message-Id: <20180425131828.15604-1-clg@kaod.org> Cc: qemu-stable@nongnu.org Fixes: 9b0605f9837b68fd56c7fc7c96a3a1a3b983687d Signed-off-by: Paolo Bonzini Signed-off-by: C=C3=A9dric Le Goater --- cpus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpus.c b/cpus.c index be3a4eb..d1f1629 100644 --- a/cpus.c +++ b/cpus.c @@ -1648,7 +1648,7 @@ static void *qemu_tcg_cpu_thread_fn(void *arg) /* process any pending work */ cpu->exit_request =3D 1; =20 - while (1) { + do { if (cpu_can_run(cpu)) { int r; qemu_mutex_unlock_iothread(); --=20 1.8.3.1