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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE5F9C433F5 for ; Fri, 8 Oct 2021 08:07:39 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8CAA060F43 for ; Fri, 8 Oct 2021 08:07:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8CAA060F43 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=m1yIo+wp91xdqq8INoFpI3HkPXefYhbZGdPVxz52BoI=; b=jgxIwOkWSZ4Nbk frr37ZiHnh3p8YnMx5X5kjy9YP1APBiVx6R2TFiEJhdbHrhyRDLjiM6Na+PbbP1XxzWVxZ/V9w1Yk E/KuFSwpsVO2nlj4/5cPMj+Bksxrx9/SREGgOtTXs8Lb2fazXB+u/qzgPOzHZIlafnCJ/hjqI2Ypx v5q2DxgkurOBVuRPCPOKYJtayTEBJZcdDcww8sMVMVHpKIXFqTF102OQzoYxsFATKcN1DoZGErFem uf0QvCt+YrqEDyShG0mnKI/iJlLp6JChedLx06QAaBuVoXLqLiNKnxwVtE55E3LsCo3UVQe5I2FYk taFW/VQ4PdNd+w9KcmaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYktB-001yxD-7u; Fri, 08 Oct 2021 08:05:57 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYkt7-001ywW-Ak for linux-arm-kernel@lists.infradead.org; Fri, 08 Oct 2021 08:05:54 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9B3C56103C; Fri, 8 Oct 2021 08:05:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633680352; bh=COR155gusrZdnvjVpDgWU/uP+eypfCBlb2p3HAxgdNY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VPYXFxNGcUnrkUiTXqUrGrNF6857sCPIa3VbA9Ln3H9Ytv1H9z/KtySug1lsycvpE B1W+zG2S9cC6KyYyPyPdQFnqs3WEjZ5CBvEgMah7XuwOx95AiHikeUTAFETZKYgOne dm5Lm3iQHuWpA8rJ03dpPz1T2s94PlVagOdIrdUwPqcaSyaE3SAhowF5JRdtM3iIVw A+JVx1cx9dQ4TUmWlnn+UHah+IS/a99U9kO1e/LQyE4u9AXNlGZj2piqKRjWvgKLeG FN8hz0uDnBSniDzsgwDWxE1xG2FmrdvDVSIoUF+MeidtlrHNvfXjhmzyjaYg4MLFQo YCkRiztPlKAXg== Date: Fri, 8 Oct 2021 09:05:46 +0100 From: Will Deacon To: Sumit Garg Cc: Mark Rutland , Sami Tolvanen , linux-arm-kernel , Steven Rostedt , Ingo Molnar , Catalin Marinas , ben.dai@unisoc.com, Nathan Chancellor , Kees Cook , Nick Desaulniers , Daniel Thompson , LKML , llvm@lists.linux.dev Subject: Re: [PATCH v2] arm64: ftrace: use function_nocfi for _mcount as well Message-ID: <20211008080546.GA495@willie-the-truck> References: <20211005123645.2766258-1-sumit.garg@linaro.org> <20211005153523.GD6678@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211008_010553_423532_1EDF8C7F X-CRM114-Status: GOOD ( 28.90 ) 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 Hi Sumit, On Wed, Oct 06, 2021 at 11:05:52AM +0530, Sumit Garg wrote: > On Tue, 5 Oct 2021 at 21:05, Mark Rutland wrote: > > On Tue, Oct 05, 2021 at 08:20:02AM -0700, Sami Tolvanen wrote: > > > On Tue, Oct 5, 2021 at 5:37 AM Sumit Garg wrote: > > > > diff --git a/arch/arm64/include/asm/ftrace.h b/arch/arm64/include/asm/ftrace.h > > > > index 91fa4baa1a93..347b0cc68f07 100644 > > > > --- a/arch/arm64/include/asm/ftrace.h > > > > +++ b/arch/arm64/include/asm/ftrace.h > > > > @@ -15,7 +15,7 @@ > > > > #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS > > > > #define ARCH_SUPPORTS_FTRACE_OPS 1 > > > > #else > > > > -#define MCOUNT_ADDR ((unsigned long)_mcount) > > > > +#define MCOUNT_ADDR ((unsigned long)function_nocfi(_mcount)) > > > > #endif > > > > > > > > /* The BL at the callsite's adjusted rec->ip */ > > > > -- > > > > 2.17.1 > > > > > > > > > > Clang >= 10 supports -fpatchable-function-entry and CFI requires Clang > > > 12, so I assume this is only an issue if > > > CONFIG_DYNAMIC_FTRACE_WITH_REGS is explicitly disabled? > > > > I don't believe it's possible to disable explicitly, since > > DYNAMIC_FTRACE_WITH_REGS isn't user selectable, and is def bool y, > > depending on HAVE_DYNAMIC_FTRACE_WITH_REGS. > > > > Ah, I see. > > > Sumit, have you actually seen a problem, or was this found by > > inspection? > > > > Actually I have seen this ftrace problem with the android11-5.4-lts > kernel and AOSP master user-space on db845c. The reason being kernel > v5.4 LTS doesn't support ftrace with -fpatchable-function-entry on > arm64. > > With the mainline, I haven't tried to reproduce this issue but it was > rather by inspection that this needs to be fixed as well. > > > If this isn't an issue in practice, we could add the funciton_nocfi() > > for consistency, but we should make that clear in the commit message, > > and drop the fixes tag. > > Sure, let me drop the fixes tag and update the commit description in > v3 as mainline only enabled CFI_CLANG for arm64 when > "-fpatchable-function-entry" is supported. Did you post a v3? Just want to make sure I didn't miss it. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel