From patchwork Thu Aug 15 14:36:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 819413 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1191900wrm; Thu, 15 Aug 2024 07:37:37 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWCkJEJEkVYtEnmSBK5Ki2g/k2SIYdj77D55vkbJiY9E1g6oLTfmRq+sG00SltUMZy+UQePwtG66667rQBnFqZw X-Google-Smtp-Source: AGHT+IGUzI8dIprlJc3xL/N19a3yhC47F1saJhpJLZljVmJ3EpDbOoyrAVYJwR0/kmSyMDrX59TG X-Received: by 2002:a05:6214:5412:b0:6b5:def0:b60 with SMTP id 6a1803df08f44-6bf5d164e0dmr66188466d6.4.1723732657020; Thu, 15 Aug 2024 07:37:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723732657; cv=none; d=google.com; s=arc-20160816; b=TB8ogDcp4lLunqKj/UbayfFMGQhNY2TJ1a9LsgMi0rp1O0yR74ScxT3F7bp1SkL5dC l1fPsOyK6JmiqflMfxiQP/nEnigyJFfgCNX0n8NMYzjhVOB+wzbSJ9j4cM20PSom0To8 gY4LoEmfiI1cQDmoHG4H9tfSVU/6+0xjohgMMnyS0zinmMdq99e5ov/xzvqgpogBc+pM 9MiC6M/yLQK5UJ4I3tSI8aj5nWoa33A569AAfjH2os48k3v36F87puRuIsk3UbW6zRe1 Y+59JHboN+sbDgkZxmXF9mtDNxx/BNwMV8X82s54U29C/yI32vmGbdgYSQkt94nk/BvE 88pA== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=kw/kMF2UrPFy/1Y87Dczx++p4s+nUe86BSQw9sw3PK8=; fh=yGWAaXXYYQtYW+LCE7nyqmcq5QIuKbScqyYf4NVD8c4=; b=tZNxiflsY8/ia5o726b0bS60nf8712FUMaQLfW7or2RveeFGCaFO3oEceokyLnPc9k fHL/TnmGvcs+EwCWcEXuTjh/SfvC4WVvp/dg4+g+L/Z1i+vOsWV98sFP563b7MW1/BrF vI0NXeP4Dsabms2aZbTIFGMRZJoxIhIv0f/9mULShXGiAkTZv7mwWyuuDGHQt1nK170e 7Ww5rXbJ0G4AVu8jtdXtskYBlkaYktt7RkVISMncvsxc14BRzAALpfDSSfgPfxIXzkji fuJS7bpNWemzNRCxBMGrL9EmxiVCbkldr2U5pMc1e87RnIB5UZ3744Om0BtB0xHv3G7C 2yrw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=egi9Y8hY; 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 6a1803df08f44-6bf6febedd4si18651316d6.275.2024.08.15.07.37.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 07:37:37 -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=egi9Y8hY; 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 1sebaj-0008OY-BS; Thu, 15 Aug 2024 10:36:41 -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 1sebai-0008N5-66 for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:36:40 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebag-0006Sf-Ei for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:36:39 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-367963ea053so669424f8f.2 for ; Thu, 15 Aug 2024 07:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723732596; x=1724337396; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=kw/kMF2UrPFy/1Y87Dczx++p4s+nUe86BSQw9sw3PK8=; b=egi9Y8hYPRy+/HeByUkCiG04B34XyN84g/eFf8D7p8nXHw9NrVpf7EY1HFvO5JIe2y +rue4tJc7u6AyK8w45m0uoeG2xSwXC/TKE1TQEXp0YRdxw2EgIGKJecI5RdL7c/vr6MS ZSOGnr0Q2YrsHpFB8iInqRE8CgTH5A9vY4fNwVQL8P4TuFb7Va6oLtspcu0Lyw31sF53 QMV2A5mBFsveHVSm2pdEZ3PVDVmZ/xbXJgPHiWo/OsOnaSmEsv9t6kt0oa3lffJ5SgcW kQGR4bt73m0UO8TjkXmUGzpP/qHe6i+h5RXASVWD1gB6gkudgwoOYFmYCminCchbs5mW 5Snw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723732596; x=1724337396; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kw/kMF2UrPFy/1Y87Dczx++p4s+nUe86BSQw9sw3PK8=; b=WenM5LfBEkh02l+2DH2ahBED3LDy51F8rdwVXatO3x+xszQCm/wBdaULnttn1pom1s W/VcpAxhPE+PNkRWPfC25/Fygb8zqVbIfpNzU240ux8N3yVDzaQFljBV6NKUszjiMTvb d7+5GO19Wb2ZoFl+6FNfzgujYiFidyn57fzD2QcYC3ERiSHMxMubV/PB2ENXQxZbJKrq 8U5JCY78yI4zueNZSsMUFpBA4Y25Jn4XbF0pbcPEHCpgjSLehV02wGgddjVBMjGIjJ8r aYxRRmunsBrMGSHKTPQ+uqTqxa0xYeERt1jk9Jlv3j3106fORkfmUr/5k8etSvf5POuj e3Uw== X-Gm-Message-State: AOJu0YxCVDOss2uDZDjD4I8nKvaJCSll5GPNomUhwh4PtLCIIrTvjkz6 HR16VMX0ID5uBi9oI1DF3wPLLAQN6zGSB+0hcD98okMKAqeqyddAxHDuMwyFrvJuPqIVgEtIWLt s X-Received: by 2002:a05:6000:4388:b0:371:83ae:809b with SMTP id ffacd0b85a97d-37183ae8285mr3118007f8f.4.1723732596272; Thu, 15 Aug 2024 07:36:36 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37189839f16sm1667146f8f.18.2024.08.15.07.36.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:36:35 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson Subject: [PATCH for-9.2] accel/tcg: Remove dead code from rr_cpu_thread_fn() Date: Thu, 15 Aug 2024 15:36:34 +0100 Message-Id: <20240815143634.3413679-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.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 --- 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 48c38714bd6..38ab16244e3 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)