From nobody Sun Nov 24 07:36:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1725541398; cv=none; d=zohomail.com; s=zohoarc; b=WLsJ+0QrxAgJxPOP6IPF5mBWaxiQyyzzxXcLFqCL+vuHJjnYFdAc7+ztPbRYz66bi8O5tgQhUi53Jk9CyurfQ5p0C6lTNVnqzPzpwdUECPIIRXtjwXJ8sE53/lTEdEbhM7YyXICVPD7jrdnpUlW/tqjfhKD5hOjHxWH6dw7iJyo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725541398; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=x5PrsaI8e8/02sXu3878r/Hk09KLGVkhl986RODv/XE=; b=hmg9D+YIsC/GhddjUDdf1l/V2dEoBnA553bFTJsMD7Uz47AmExVJPncuPgDyA5V041P4anRuWqrctNcBTxWtZClamsos6Iz9PCFKf6RLuYZltIa+la+CZauQiKkWtzzQijCJx4WWO5mqnHT7WopGD+iTiynjfEhvwJl0adlgvFo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1725541397989258.30744101012374; Thu, 5 Sep 2024 06:03:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1smC74-0001T4-5M; Thu, 05 Sep 2024 09:01:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smC6u-0000yN-9w for qemu-devel@nongnu.org; Thu, 05 Sep 2024 09:01:17 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1smC6s-0001k5-79 for qemu-devel@nongnu.org; Thu, 05 Sep 2024 09:01:15 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4280ca0791bso5918325e9.1 for ; Thu, 05 Sep 2024 06:01:11 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e355dfsm232251365e9.46.2024.09.05.06.01.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 06:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725541270; x=1726146070; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=x5PrsaI8e8/02sXu3878r/Hk09KLGVkhl986RODv/XE=; b=sba6Ax62CT2yHQVazfJLg3025KXP3J3ybrvrvSsTaQGtXV6GQu4uDM/U9+ZpI30Jm7 qIjNa9/iJYjhvOFMNfarx0oukXD32IM8LCpGYchbacBqZN930U+DcrRT6pXrhfmqN5Yp bjV33LVx9jC4EdIrVt0FoI75wU6FCwanNiSGj9j6xHZR2B9CWSrpgUOLNfyPkNSUgPFp PZ3dRZ9wUCstUP+rFwk2gcoVaT9tDfiPg+3fum5j6Bt7+jNthOO20iQ5jVDMGewlu54N bpkzfoq9/ZbGJv5o1Sh0dQgf4oO5bF8YMOrQ57fvGsqi0FyRX2vcB1BZVJOg/p/wL2cQ Uf2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725541270; x=1726146070; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x5PrsaI8e8/02sXu3878r/Hk09KLGVkhl986RODv/XE=; b=Wwy2vNViK7Rr+ypJhvBSVslt5sDbtNYO6MU4aeAKI/dD9fyXy74X2monsIQay7il7H RKpmad92DGwiNKxT8jUULBE0pE22Q8yCSbpejtXfAuclHPUg8dB9BugT75sA5j1EOjNf enSfZ9S1JzoxRzm7tXPSk9syeNtxIqqmd75yGbS3plf+rRyfgYMbuDRMqcE/c/va9DD7 t6WPTNjuGq3qjGGG9RmUmC2AbqgKBtuX+opDsRYSe4GHAPZYJn9r5AmiCYChwlJRE8WK y1ez9BW644+7ttiar+ML7BQapG0gI0OVxUokSG9z+D0YbKFdvVPbx+hXQjGXq3szFebu LbcA== X-Gm-Message-State: AOJu0YzoBGyg+PyZaFNsO/yYRtQGRdY9JTCXVLzo/gvSJA7cgbeoKPJl s5p7XSWvBxeCz+biiHxcX0zA+dDwQpcfN/1mOiZF4cYtXpRN713lJ6o+S3kxgAvzr03FHjaaIzI a X-Google-Smtp-Source: AGHT+IGO6WZaM0UDCcDaWJAApAF6947o6wKQV5HBbxFDH+Sdn8bSiLVmTovx+0v85FayZYodlGgT4w== X-Received: by 2002:adf:f64d:0:b0:371:7e3f:6cc with SMTP id ffacd0b85a97d-376dcc8b871mr5003657f8f.9.1725541269785; Thu, 05 Sep 2024 06:01:09 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 09/25] accel/tcg: Remove dead code from rr_cpu_thread_fn() Date: Thu, 5 Sep 2024 14:00:44 +0100 Message-Id: <20240905130100.298768-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240905130100.298768-1-peter.maydell@linaro.org> References: <20240905130100.298768-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1725541399620116600 Content-Type: text/plain; charset="utf-8" The main loop in rr_cpu_thread_fn() can never terminate, so the code at the end of the function to clean up the RCU subsystem is dead code. Replace it with g_assert_not_reached(). (This is different from the other cpu_thread_fn for e.g. MTTCG or for the KVM accelerator -- those can exit, if the vCPU they are responsible for is unplugged. But the RR cpu thread fn handles all CPUs in the system in a round-robin way, so even if one is unplugged it keeps looping.) Resolves: Coverity CID 1547782 Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20240815143634.3413679-1-peter.maydell@linaro.org --- accel/tcg/tcg-accel-ops-rr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/tcg-accel-ops-rr.c index c59c77da4b3..8ebadf8e9e1 100644 --- a/accel/tcg/tcg-accel-ops-rr.c +++ b/accel/tcg/tcg-accel-ops-rr.c @@ -302,9 +302,7 @@ static void *rr_cpu_thread_fn(void *arg) rr_deal_with_unplugged_cpus(); } =20 - rcu_remove_force_rcu_notifier(&force_rcu); - rcu_unregister_thread(); - return NULL; + g_assert_not_reached(); } =20 void rr_start_vcpu_thread(CPUState *cpu) --=20 2.34.1