From mboxrd@z Thu Jan 1 00:00:00 1970 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 0DBEDC4167B for ; Fri, 1 Dec 2023 18:23:46 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EhGns+pSFHx9N/Y0/MFQIi8wJ5OZeGLGa3JAlP76PXs=; b=OUlSyVUKjmUryG KOKZ7v+t2fsgI1Yn2VRNxzsUXO7hPBtZmRgxmP2ri4WRZe67Co0wMyBSkm8t4efsLoW+WNboARfa0 vQerVxGFB0jinhzDlTQihUCzu4oYFyK4+IjkH3wkBbwY747YIAJtGdmY20ih9N4M0SweWTQKpZ+GB SFmiPCn5jnXCLXJ7dPwuM7mf0eJeFP5bCwfv5d76Pl4DDvu4GgE6YBxwP+YqoWokY+FwBPAevKbnK EF4fk2hu6oSg3TZ9cYH/TjONX7U8+K7A95k79sOIYUHmbrfz3XHNOMgLTcDIZaeQ+cRznXuh1c+R3 Rfoan6/r4RwS35eGcIuw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r98AV-00EQMu-24; Fri, 01 Dec 2023 18:23:15 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r98AR-00EQMJ-2o for linux-arm-kernel@lists.infradead.org; Fri, 01 Dec 2023 18:23:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8KvERjRQqiKIU2aozT18Qav8ul+lZde50rCvSyjwtek=; b=Hihgs8m2gRe3YqPtkP4UV6i4zD idJQaOTXNDkBg7qgQFrjf8yGfv8yRBWIjg0u1kAMKJeT52nDJ4atWT66uw6p5gyl8Fxw+2HlLzpVX 52BIzC3hUX6nwUAtSj3DdDlpXHxPsZqF7rBdjSLh8dPYsVhRWiFU2H06PFXeTXeaP7+VPkrheSW8C j+d3Vq5+Fxc2xAIKkrCX7oXUpLxvfIrnHz4v/OyV59HHXtfx9mafF/km6o2b3DYaeBHVsmo4m7Y5u AlO+oCXXJQ5n2wB5UdWZwTSw7JmUtwNg6HV06aWNNDWoY9/WKYqiFTeHVlPuENUEO18YVMa6/7+2B PO0px6zw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:40058) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1r98AA-0003Qx-2q; Fri, 01 Dec 2023 18:22:56 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1r98AA-0006F7-GW; Fri, 01 Dec 2023 18:22:54 +0000 Date: Fri, 1 Dec 2023 18:22:54 +0000 From: "Russell King (Oracle)" To: Ard Biesheuvel Cc: Justin Chen , rostedt@goodmis.org, mhiramat@kernel.org, mark.rutland@arm.com, linux-trace-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Florian Fainelli , Doug Berger Subject: Re: ARM Ftrace Function Graph Fails With UNWINDER_FRAME_POINTER Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231201_102312_209591_E271F413 X-CRM114-Status: GOOD ( 15.56 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Dec 01, 2023 at 10:12:48AM +0100, Ard Biesheuvel wrote: > It appears the sub instruction at 0x6dd0 correctly accounts for the > extra 8 bytes, so the frame pointer is valid. So it is our assumption > that there are no gaps between the stack frames is invalid. > > Could you try the following change please? > > --- a/arch/arm/kernel/ftrace.c > +++ b/arch/arm/kernel/ftrace.c > @@ -235,8 +235,12 @@ > return; > > if (IS_ENABLED(CONFIG_UNWINDER_FRAME_POINTER)) { > - /* FP points one word below parent's top of stack */ > - frame_pointer += 4; > + /* > + * The top of stack of the parent is recorded in the stack > + * frame at offset [fp, #-8]. > + */ > + get_kernel_nofault(frame_pointer, > + (unsigned long *)(frame_pointer - 8)); Yes, this will get the value of the stack pointer when the function was entered - which may be the bottom of the parent function's stack _or_ the start of non-register arguments to this function. So your replacement has always been more correct. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel