From nobody Sun Feb 8 12:37:57 2026 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1532379549600667.4601513917775; Mon, 23 Jul 2018 13:59:09 -0700 (PDT) Received: from localhost ([::1]:36571 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhhvA-0002Dn-AE for importer@patchew.org; Mon, 23 Jul 2018 16:59:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhhJl-0002y1-Hs for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:20:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhhJk-0004k1-Mr for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:20:29 -0400 Received: from mail-oi0-x243.google.com ([2607:f8b0:4003:c06::243]:38990) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fhhJk-0004jc-HC; Mon, 23 Jul 2018 16:20:28 -0400 Received: by mail-oi0-x243.google.com with SMTP id d189-v6so3482790oib.6; Mon, 23 Jul 2018 13:20:28 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id d5-v6sm7175889oia.57.2018.07.23.13.20.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jul 2018 13:20:26 -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=B2Xe/MYL9HdquHUy7rdn5+WCA/XvHWA8evaGwtKwy6M=; b=YQTJPmPJuMuAJcWdrj82sZDuQVdERMC7LRsDv0J3Y3hnJz16ZkBsPOzZWiWMnSJ0Oi puJanFB+FddhJzV1q/hy37SPYNJ+8wf7GIYXtGPHHZQ7pSqth767+ngMDjRpI1BsgX4a 4UCv8oKv3Ll6RM1xgZuA1wzW7zwO678hUBN+uK8S9/EP7I8Y80HH8GNtrsE6VrOwy0D9 v+nYZxaGW/EE/qPp//hvjS4L+Pdz87zQUPa1u7zve4nD95R5321wrir948V189RQXSD8 AYqtRALOFkh4m8XJUsVoWGOITZAWxA2i8HnyinEc5VI+AqNidTTwn5RDeWDdWAoU1vud aHeA== 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=B2Xe/MYL9HdquHUy7rdn5+WCA/XvHWA8evaGwtKwy6M=; b=cHhKf9ys49O8TWnJfc1bUhfmEOWS0jLLWDRvXWxuUQY+74BVTfMx6w0XQQ4/+XIht7 BpOvwHOH+K+e56WX+v46bicily3iqhkkXIlesnBw5u5WWe9KmM0yfe7oPLyny5VqOb8z 55zKzcHsJY8e48bcpnq5SbvVcZlN5OBIvKKbcyvWRG7eZuiCAg66VCf40ZmOZpzAUA4g eDuEpwRrFpOp5l4GB64dYfMiMjxQ9qIva/V7PxHX06O3Lk6zSW2HbfDpHLSugayIAOty QxYtRONMzH7PP8KnkRQbcKsp2XaCiS+EECZGHOzvG0slSKCAp9fJz+YJR/GdFTBeWN6A UIoQ== X-Gm-Message-State: AOUpUlE8ijna86VTg/qvWMcDk/YCHh+Hl2bJdUtKEGloccxYgM1tqcor ueiPK/65lP85g3RP8jltPg4s5ZvycFo= X-Google-Smtp-Source: AAOMgpeHiopESvv1Tx3eFsHTtqOm8BO7aK6oIJVTLXb2HcokR5mPCNulKg8S2aQs70MSgCRhq7wtlQ== X-Received: by 2002:aca:b702:: with SMTP id h2-v6mr326185oif.66.1532377227408; Mon, 23 Jul 2018 13:20:27 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 23 Jul 2018 15:17:03 -0500 Message-Id: <20180723201748.25573-55-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> References: <20180723201748.25573-1-mdroth@linux.vnet.ibm.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: 2607:f8b0:4003:c06::243 Subject: [Qemu-devel] [PATCH 54/99] 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: Paolo Bonzini , qemu-stable@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= 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 (cherry picked from commit 54961aac190df28d311802364d19e18d5cda8bab) Signed-off-by: Michael Roth --- cpus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpus.c b/cpus.c index 38eba8bff3..e1d94038fd 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 2.17.1