From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 793FC221700; Mon, 7 Apr 2025 18:12:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744049529; cv=none; b=el/b5jQZTh2I8GjIwR2svoNZzUoqFFzhGtWqBCoI9zSJSAy71d/Bfu5kIe9u4R3PAvoCB27O1Cc6UsUDRPQ3ngIxktAtg7qo+717ZPpKTzpMN4d2WjIG+rKSF6K0gZgsvwnBZ/Y1qKLB87oyj4rN+ZVHd/n0XBPm4Rt/475yT20= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744049529; c=relaxed/simple; bh=Dx699RHRPm2jhU54u4uIzhGxafYiIyErLqG2ynWIl5Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Y9TwaqZUgl0tEMqiN4y8Wse8F1RDi5Bh6rAYDC29img2TBvQmTUvbMeAHQU7xXLhG/+HpmSEt4bSZc/Kre++LcujOE3dhfYUN7A5cIqGpk5IQ2gG6q5++mgB6nkmox/1IUczrYo9m0xx1sKq6HG9/PxtxWM3ITbZpDBm9p2o1zk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pXDwYqnF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pXDwYqnF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17A4FC4CEE9; Mon, 7 Apr 2025 18:12:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744049529; bh=Dx699RHRPm2jhU54u4uIzhGxafYiIyErLqG2ynWIl5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pXDwYqnFYd7sa+5J7fxrjlgK2+NgwO7Os85aE69fIzok6/fU+A+dCHF3qXvvvPHNT CLfjAOwMXg/gh8l7Z8XjrcPxl0uBjH4VnZdCBA7pVCKuqKZpiEtM8VFSW80ePe9BZX eDe77EPVfp1a1i1uYX4CX3enLlrbkhIojf++Qn4H7itnK0Dde8aKXMXM8/OpWF2VUt PSkMoioZOtB4cAD0zxhECHqRn+thCLqL606ICY6NuwTf6iQB/jqCTIO2hmuyI3OrCJ IqoM7D1EBVH7QXs0L2dXEtfERbpsL7tMQwkQ0v6Lq6hJ+BbPxe3k0KjGtwj6veOuCv 6OpRx6cecS7ew== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Josh Poimboeuf , Ingo Molnar , kernel test robot , Linus Torvalds , Sasha Levin , peterz@infradead.org Subject: [PATCH AUTOSEL 6.14 27/31] objtool: Silence more KCOV warnings Date: Mon, 7 Apr 2025 14:10:43 -0400 Message-Id: <20250407181054.3177479-27-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250407181054.3177479-1-sashal@kernel.org> References: <20250407181054.3177479-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.14.1 Content-Transfer-Encoding: 8bit From: Josh Poimboeuf [ Upstream commit 6b023c7842048c4bbeede802f3cf36b96c7a8b25 ] In the past there were issues with KCOV triggering unreachable instruction warnings, which is why unreachable warnings are now disabled with CONFIG_KCOV. Now some new KCOV warnings are showing up with GCC 14: vmlinux.o: warning: objtool: cpuset_write_resmask() falls through to next function cpuset_update_active_cpus.cold() drivers/usb/core/driver.o: error: objtool: usb_deregister() falls through to next function usb_match_device() sound/soc/codecs/snd-soc-wcd934x.o: warning: objtool: .text.wcd934x_slim_irq_handler: unexpected end of section All are caused by GCC KCOV not finishing an optimization, leaving behind a never-taken conditional branch to a basic block which falls through to the next function (or end of section). At a high level this is similar to the unreachable warnings mentioned above, in that KCOV isn't fully removing dead code. Treat it the same way by adding these to the list of warnings to ignore with CONFIG_KCOV. Reported-by: Ingo Molnar Reported-by: kernel test robot Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Cc: Linus Torvalds Link: https://lore.kernel.org/r/66a61a0b65d74e072d3dc02384e395edb2adc3c5.1742852846.git.jpoimboe@kernel.org Closes: https://lore.kernel.org/Z9iTsI09AEBlxlHC@gmail.com Closes: https://lore.kernel.org/oe-kbuild-all/202503180044.oH9gyPeg-lkp@intel.com/ Signed-off-by: Sasha Levin --- tools/objtool/check.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index ce973d9d8e6d8..9b5852299957e 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -3488,6 +3488,9 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, !strncmp(func->name, "__pfx_", 6)) return 0; + if (file->ignore_unreachables) + return 0; + WARN("%s() falls through to next function %s()", func->name, insn_func(insn)->name); return 1; @@ -3707,6 +3710,9 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, if (!next_insn) { if (state.cfi.cfa.base == CFI_UNDEFINED) return 0; + if (file->ignore_unreachables) + return 0; + WARN("%s: unexpected end of section", sec->name); return 1; } -- 2.39.5