From patchwork Thu Sep 5 13:00:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 825639 Delivered-To: patch@linaro.org Received: by 2002:adf:a345:0:b0:367:895a:4699 with SMTP id d5csp286508wrb; Thu, 5 Sep 2024 06:03:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWyU9n2/i64+/sWTaVFVaWs1tRR3SRb+bYhX85ysUTdb4LvSEeXqBW3M+lX/gIzLOIOtg0SSQ==@linaro.org X-Google-Smtp-Source: AGHT+IFIVNDVe0ejp/6/FsWfp1Gj52znDsnnbX+YPYr2eZaU8G47h20z6uIG4yGtkX2zdVWqP2a0 X-Received: by 2002:a5d:6e42:0:b0:374:c56c:fbc7 with SMTP id ffacd0b85a97d-376dd15a895mr4934141f8f.15.1725541397739; Thu, 05 Sep 2024 06:03:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725541397; cv=none; d=google.com; s=arc-20160816; b=OITGks12O68g1Hc/HFWwx6fY7OulgUJINK082plzKqOVeN//f0FdXwa5RCSA7U0sWD S4HPgd1fTLDlrA+CPG40UYVUHwDQdArNaXoNVut2M3vb+ToJ16LKR7Q2EfwELmt70cBD LPqcfukDfC8F8Sb48TEJUOxw2EURll3kgty13pIE8YOJVjafoBJqSRQ68JlKJ5wH5Kcd pSTFLolmgVj08ilN3t+8bCzuI29BC90Ln13yWV2o0vvdYaxBU9Wcst8CfWov3aYjUCOf muMHvdqYfhOw+89DWw3RR2Oc2LZaJrqsc6+9//M0Bp3joUtT4CIoF7iZnycq3RgE5I3C UzHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=x5PrsaI8e8/02sXu3878r/Hk09KLGVkhl986RODv/XE=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=GUcHH7Qbo/YVoEjWIlwZ1rQrrcirYu3DxpKQYQ1eyFDPkrUZDcsJ/A69yLxMFNMzJP cweV8f5BtXIucRugg9ziJa8wtf/EluFy2NUJvvICEczzS8FaPTzRdXKC0kavVChqd2q2 JUQac/Gn0Hz/u5mvkG4/hx8c0Zft8puD4GFqu4LkBp8baoHsWBR9tr5zcxw4UIAExd/Z iC33GuJmFOlGs9zZS7wpNceeW0tyky2MC8RsZrk0Adls+omRHwl7LfqSsMOt644E8hVc ZvT39+0XuEpy0qjPm+S1NpUcpdkJaTuaLikZZjIHr1Ah4wF+1SMhs0obt8Y8luLXPk27 /beg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sba6Ax62; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ffacd0b85a97d-37795a60fc7si1710606f8f.773.2024.09.05.06.03.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Sep 2024 06:03:17 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sba6Ax62; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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) 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-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) 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) 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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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(); } - rcu_remove_force_rcu_notifier(&force_rcu); - rcu_unregister_thread(); - return NULL; + g_assert_not_reached(); } void rr_start_vcpu_thread(CPUState *cpu)