From patchwork Fri Dec 9 14:34:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 13069660 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 75072C4332F for ; Fri, 9 Dec 2022 14:35:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=SE5entJ27dUwRChVvlt2/VmttGNvcWWeFJYGdgHIOTY=; b=H/cSE4QO5Oky/C t8Ri3UEvKNmT6+K8HDGZXfaQtlx87/wPnumYzi27Fudp1iqC3N9O71YLOn4B27CtuViI0n4hSufDF X+nQit0kvkz8V2hbv3d1VB5HhE3pKxz+pSjCi6r/Y2xVI6dFi+Adi8QpRtMlnnoQA/nx7C7upRFz7 0aHO3z4So7OJI3Q8+xSYZtp2Jou2wuToNAczE0DOIHfE8mP++/fTGVfV8XAbBCc9YJWq/qDMxt/wS McYL5WXOWyTU2GaTB+v6uVYxtEsWpROm+qU+PfAMZxU1ShzZy7rPU3AuTfqKHAVX/ftYW0Ur+PrmO 9X3asUqGaTkQqsUF07ew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3eS6-008TX7-9K; Fri, 09 Dec 2022 14:34:14 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3eS3-008TWC-Jf for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 14:34:12 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 37B7D62246; Fri, 9 Dec 2022 14:34:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABB7AC433EF; Fri, 9 Dec 2022 14:34:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670596448; bh=pLXGrv6QU5pjiha0Gmm0P9l4TU00BqZ7toYM+O8aNqo=; h=From:To:Cc:Subject:Date:From; b=qeTmW4fZNzcLD+0x8ka17uR60lVLqxsaCPD/GA94JUzMp6LwnhJegYFZw2mR5PWct MFH2e7Yc7hapk000BPRdCPosicpsYKGqMUygDgKVX0SBwlz1mle56kWt+p0Bz8vPHz 807O5Q1uxHLJC8nwDhfLXFsYNuDdVuz4cxUAgVRbQcYj1ssOhPFIH1bXdn/WvzcXLm V0RvL7NUvjAOP2LGlLrhO+ZcoVvr1aVt5xL9otfNUYr4RYD/DbNcW/d/j//DAj7RF+ A5tmSVU8PqqZLXAbcwNvpmK851ObKOa0C+cDYO9hZ56CLriD9FZAZcbnodxiDnyS8v 5dxiIqQcsKm6A== From: Ard Biesheuvel To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com, will@kernel.org, rostedt@goodmis.org, samitolvanen@google.com, keescook@chromium.org, mhiramat@kernel.org, Ard Biesheuvel Subject: [PATCH] ftrace: Allow WITH_ARGS flavour of graph tracer with shadow call stack Date: Fri, 9 Dec 2022 15:34:02 +0100 Message-Id: <20221209143402.3332369-1-ardb@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1349; i=ardb@kernel.org; h=from:subject; bh=pLXGrv6QU5pjiha0Gmm0P9l4TU00BqZ7toYM+O8aNqo=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBjk0dZBTgLiAH9vDjLSbo2y5Awsx6gYL476wnx23X/ vVWfK2iJAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCY5NHWQAKCRDDTyI5ktmPJBk6C/ 9V27+4l/iFZaaoDRAUTOz3OgxvFfNA10/QjiK8UWS5UpGRiq3KTKllk6hQIuovBv3jWyjo+1s2sz/R 3lp+oF4ka95H9eAvWQADNqgFsNLoBJxVQD0FCU7keE54ZnH1dGkw0u4QDU7k3nmCCwUsrbIOngyRz5 W+QrfzKrdn/p5G0YpdUHEFjm+xJbBODLgEenBvYcZgrgAMrLj+wLITAZLr3nqtntxG0XQnFFyT85Dx 9GAXqd+2rYwrZzRikexo+mBq+4ohaVr8UHAloUZwaxLCoErUIemtosQkeK3araw+/2Jj7uD7/u4iki 9UAI8m3i0paF2DiK51kmQQqo22G9ZENYrAbH2jJSbIILaNljFNJ7xr616S5F9oMJolm0uFxKP5uyUu fBYvUs0Ocwb5A362NHKED8wjnR+mfuvtqETlYjB7qndNr2D/HmeitbRFf49W6SLva8OJUbaWl20nX6 vke8SrRzXQGa+znEWjir6ka3BSLI/Pp/oqIcEqdAY8958= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_063411_703033_0840233B X-CRM114-Status: GOOD ( 14.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The recent switch on arm64 from DYNAMIC_FTRACE_WITH_REGS to DYNAMIC_FTRACE_WITH_ARGS failed to take into account that we currently require the former in order to allow the function graph tracer to be enabled in combination with shadow call stacks. This means that this is no longer permitted at all, in spite of the fact that either flavour of ftrace works perfectly fine in this combination. Given that arm64 is the only arch that implements shadow call stacks in the first place, let's update the condition to just reflect the arm64 change. When other architectures adopt shadow call stack support, this can be revisited if needed. Signed-off-by: Ard Biesheuvel Acked-by: Mark Rutland Acked-by: Steven Rostedt (Google) --- arch/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/Kconfig b/arch/Kconfig index 072a1b39e3afd0d1..683f365b5e31c856 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -635,7 +635,7 @@ config ARCH_SUPPORTS_SHADOW_CALL_STACK config SHADOW_CALL_STACK bool "Shadow Call Stack" depends on ARCH_SUPPORTS_SHADOW_CALL_STACK - depends on DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER + depends on DYNAMIC_FTRACE_WITH_ARGS || !FUNCTION_GRAPH_TRACER help This option enables the compiler's Shadow Call Stack, which uses a shadow stack to protect function return addresses from