From patchwork Tue Dec 13 13:24:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 13072067 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 4CC13C4332F for ; Tue, 13 Dec 2022 13:25:20 +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=qedW9wk27uiq+W1IzW+hoVyptNMQw9iajdezFsECtA0=; b=H/asB0to8fw94Z Z+NP5OMR552GI+Dwd71cHrUnY4NIZ8LYm837OVJsEGiyoHck1gbLSDtTUHDSlqD70MIVDeJ4uIo0x hcaLVyd7hcndUCvQovBlf9lWu/ryIkeffqMyFnhrZ5db52Y3Jkswcvf4TjcpdnYCRYCO6dSmwsdBx ZwqTCSWW6+JXaOHTELRhE6rNLTxb0E9EEZzUAJ1DNo9mbeQkszBSmaPLmJMjk7zRIb2maftAXNma9 5zcGc3Iqiyt2PDnGotz9jPibCzKUmrnp5PwoFSzJ4kXt52L3Se1d+tPEol1H0SjqKNc2/i/mu0Vqz yYika88wrZ2SvL7eSLvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p55Ge-000IlX-6I; Tue, 13 Dec 2022 13:24:20 +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 1p55Ga-000Ijc-JN for linux-arm-kernel@lists.infradead.org; Tue, 13 Dec 2022 13:24:18 +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 C74B8614DB; Tue, 13 Dec 2022 13:24:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE04CC433EF; Tue, 13 Dec 2022 13:24:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670937855; bh=mHI85944kZur/I4CBiUdFF76juSUIlt+zMNLlLSqPZ8=; h=From:To:Cc:Subject:Date:From; b=IV9WXljIbTf5qZyF10szhUbQ7GDeW/C8PPwzN1EbuNG9InaO/dJV5BaKBpmTq8Ztu 5q8rZM0ug728I+ZCTo3xgqjPvbdrgqDq1n7jwEF6BeeHgQEJqSnzRlcmu+ukEICg+Y De/LNTstQMZj33n8MwL3kOe23NeU39Qof75BzAtHFSOHaYJyR1IFxCHp5hyAkSFeBe EcLI1aYi9Qt6FJCz5RO78tryzMN//HupQ2vMm+NYM6sXzHsg/FdB7u2tQXgdJAHbjE F/Mt58R4lIMylcNHQLSh2F9bqS2UOyZWvd3O9PgYih4B0IVHl/Sw9U7MX6K+8ePlDP f5s9TVwnsa3Nw== From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Cc: will@kernel.org, mark.rutland@arm.com, rostedt@goodmis.org, Ard Biesheuvel Subject: [PATCH v2] ftrace: Allow WITH_ARGS flavour of graph tracer with shadow call stack Date: Tue, 13 Dec 2022 14:24:07 +0100 Message-Id: <20221213132407.1485025-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=1356; i=ardb@kernel.org; h=from:subject; bh=mHI85944kZur/I4CBiUdFF76juSUIlt+zMNLlLSqPZ8=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBjmHz2vaMwPFmRHFcRZe4MfEizVfynnu/e3KvrTNgW 7Ki23vCJAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCY5h89gAKCRDDTyI5ktmPJJmaC/ 9CmmdNoDrbugbeP8HC18UJdzeZ+8ALrY/3MJqFa8LkvdQ1KETOFffu/u1Okeg6RMO/Rh5rQt3noY4w nQUNa0R+NubcNIk4n1mm+z8kVohaIxXnehRDq/54Xz3Zd16z+rZCHqyVJUhYmsEGMf2jfaPeCenaey ea6hnYaxRJV+zUFg43utZHggzJlov1KFtheq0qRuAvGsXgRlC9p9aOsX2r8StKLNmr9JeJ6QuKTQnj VkgYPtWBuDVvgTc9p83tQa9KPFS0B/xaTRbV7DzR/JpZ6xVaBYPi/UInudzYNyWu3zbe7cKW2uZVv9 Ksnj49csAKXRslitbl0zlqtAKSTLDMvJye3Dw8jBhQLYLvNTba/BXGeJLQ4oAJhh8cP9cGATiuA8sU MYvdYu3YArFARmVnqWLWnS9nv6wvLvm7O2R0ipXBbmKfHlOSxQ0GZirfp7hxs0UdqutnC7ZBFRphQ7 tPbEHg9qohyo0p35SkL3b7928V2w8XZLdroAi3cB9DbKQ= 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-20221213_052416_700189_94532E14 X-CRM114-Status: GOOD ( 13.70 ) 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. So permit WITH_ARGS as well as WITH_REGS. Fixes: ddc9863e9e90 ("scs: Disable when function graph tracing is enabled") Acked-by: Mark Rutland Acked-by: Steven Rostedt (Google) Signed-off-by: Ard Biesheuvel --- arch/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/Kconfig b/arch/Kconfig index 2d0e7099eb3ffa21..b79c2de9ae5bda52 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -638,7 +638,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 || DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER help This option enables the compiler's Shadow Call Stack, which uses a shadow stack to protect function return addresses from