From patchwork Thu Aug 15 13:12:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 819410 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp1151838wrm; Thu, 15 Aug 2024 06:13:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX/vjLSM3+ZjGQez4egUOCEElJ0UXJuc5Afqkthif/+Soj0FYPXRcO/R+MRf831rhSgiIsh4sC7Crxc0jdy9xxA X-Google-Smtp-Source: AGHT+IGBwRr6fA68z9bEJsgDvK1V1/Ax1OcI6j2qHL3g/ve2s5o6wkitidGh5n+9fTLcCRp4mnCj X-Received: by 2002:a05:620a:2911:b0:7a2:c89:a557 with SMTP id af79cd13be357-7a4ee32e809mr808414985a.27.1723727584904; Thu, 15 Aug 2024 06:13:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723727584; cv=none; d=google.com; s=arc-20160816; b=0yCdocybF95B200sysRYUDJ4FN5rAb9Ovdu0e7ljydMI+VfRX92vTr8wDx8jcQjPV9 5DrvN2W44i24KPnxuUVXltrO35/hM02njq0TQkL7nAAU57BSVqm4pF8/tiTA9KlpL3Ki vF1GEtOgYxTL9yz0I58tEk8NSthFgk6I3jxjPdZx1RLDlGPeq7C7zXHaRWxB4j2fli8v 3gls5ixHuF/cpn5E+EAULrj+Slocn3l+W1x3QpCI6waHxhl8iXT2hu5u3be8uuRBwfMw 8m56udGERelhGWC336walCB6XTemU5rvKINHwLyiI93b21OFk3HEeUUd85ipnfpro76V TaFw== 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:cc:to :from:dkim-signature; bh=dUYdiSB91Owjfbe3qfsRkuZlpaUqKUBYcIWMaFHQa1k=; fh=OTkfrEnbNDInppsfj4HB8z6V33zCj7LOct256XBfW6M=; b=cZj7+ZadLFXOiBHj7bur4cncX9I2Ss3yyQTi64f6LkaHSBn50EqDgN0PGoPMQMoFZw OD7MfUxnwDBa1KogAO1xFsvxrJWvdlIuDnPhavNousbC9lXb6ZKtLJio8QwVP6E1/PX1 8JCPiLpFygJ75rRtyx+rsPVYas9yC2DjsIqUezbGNBEG92hQOoaTFdXXZAtk8qykwDRa qFQrB4tklCv3oFfjlxWpWxEDzn+8rONQcj+j7HumP3wWrMc5LqbKf4l2O2HCD3jd0mMf SfBfSe74/7lCEkJPDXPv1AHzQLmr/Pg8NTv0G1TXn7LAVGjSOTX7MApvCya3+oZ9ysJW 3oWg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xoZ43qJp; 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 af79cd13be357-7a4ff0b940fsi171668385a.227.2024.08.15.06.13.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2024 06:13:04 -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=xoZ43qJp; 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 1seaH0-0002gz-Px; Thu, 15 Aug 2024 09:12:14 -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 1seaGy-0002YL-Jm for qemu-devel@nongnu.org; Thu, 15 Aug 2024 09:12:12 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1seaGw-0001JL-2m for qemu-devel@nongnu.org; Thu, 15 Aug 2024 09:12:12 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-37189d8e637so365467f8f.3 for ; Thu, 15 Aug 2024 06:12:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723727528; x=1724332328; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dUYdiSB91Owjfbe3qfsRkuZlpaUqKUBYcIWMaFHQa1k=; b=xoZ43qJpRQz7i5GaOSfZ18gslGYgRUkp8nhrn6NWbZF8fh0PV7O0FejOd4NyMxyADx D+YiZUcsrhIUNzIwi2QxWkNbaIGR+IjpJGkl8fiWiv74hKNjBuaFElXTThIjCr4ViMAj KpTNQeA3eHbx8zqx3axUZfe0F8BZ0YDC2gkcpuVmp+9UOhC3h1YAUUY45VX9HkhvE7Lx Qvom/MJjq2DxxOoiAzBsRmyY60N2htjen/6zGRVBI9LdF3MHaIUpJiHUTqR5Px6SS6Xf Fg7u0aiUFuqvGhizKu0KpIHObSAgryr8izYlS76flY9sZAJS8gpAAVF5ZaTbeov8LfQx Fhhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723727528; x=1724332328; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dUYdiSB91Owjfbe3qfsRkuZlpaUqKUBYcIWMaFHQa1k=; b=UPpyrwPHE5rHLCoHpTyA/C0J/K1EMF7DpvrrWHVkgWO4tJfBrYXatPiNqXLiV2xQnE 28R7VEww8Wp83CPoYnjlfkOLWHtDQirFrO8uyrOND4fEHgd6TpCS7g63VnL8DFeyHUKy wTEZH+nNJTczViBDI8n5OcFTBAJojB29uh1EDjTFyEN+KBs8SDMJz/w4cixEwpcWmNAe 99Xn2XMY/BDmPN94aUqDHMXh/PqV/z9fd7ajsBlQeleQr0tFFYCewvsDkSLS+wBBNAyo ha/Ft/pb+JwQqdAnNBA9dswCpNXyZWFXrS3Ts1bsoa5iaWYwwYRHoc2/NKdooFGN33+M Poww== X-Gm-Message-State: AOJu0YzCnyHgWukpkwNhiJ4Nwg/8i0r+aGrxy0Ulq5H86haLiIz8YPFK 8akIDJ8fFOhwKSphMQMd0ZcSBmdjoskwyMfcUb+2BInz6zddJQUnHlrCs/6MRGMUacqgQEskTbk u X-Received: by 2002:a05:6000:4008:b0:368:3b1f:fe40 with SMTP id ffacd0b85a97d-3717778b7bdmr5878939f8f.20.1723727528438; Thu, 15 Aug 2024 06:12:08 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429ded19627sm48269935e9.5.2024.08.15.06.12.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 06:12:08 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Paolo Bonzini Subject: [PATCH for-9.2 2/2] kvm: Remove unreachable code in kvm_dirty_ring_reaper_thread() Date: Thu, 15 Aug 2024 14:12:06 +0100 Message-Id: <20240815131206.3231819-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240815131206.3231819-1-peter.maydell@linaro.org> References: <20240815131206.3231819-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.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 code at the tail end of the loop in kvm_dirty_ring_reaper_thread() is unreachable, because there is no way for execution to leave the loop. Replace it with a g_assert_not_reached(). (The code has always been unreachable, right from the start when the function was added in commit b4420f198dd8.) Resolves: Coverity CID 1547687 Signed-off-by: Peter Maydell --- accel/kvm/kvm-all.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 6c4cb263ba3..fe4cd721d9b 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -1525,11 +1525,7 @@ static void *kvm_dirty_ring_reaper_thread(void *data) r->reaper_iteration++; } - trace_kvm_dirty_ring_reaper("exit"); - - rcu_unregister_thread(); - - return NULL; + g_assert_not_reached(); } static void kvm_dirty_ring_reaper_init(KVMState *s)