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 C2962C433F5 for ; Wed, 2 Mar 2022 12:45:00 +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=eN9NxcY2T6YU0DJ7Zmv0oVz/lYLvvJ1z3k3MmKZD1LY=; b=djb9GNlcl7Zqx/ scb9PQSGuMO7Qz/phSPDHruP5NOWpW+F5Zcx1g9pEfADIpxNJEcvVDvaRwU5/A8jtvC2LdgZpngTn zQs2mxgpHa+oAocXAUmGFNDVfp2fBC7qJ/zfJJHe+5fUI55LMj7J/XzKlO/mqT/GjaU2Liz2PYIe5 DQDUApOJYqjRHOijPRseoG8h1aptVxKpM/c+jy1am6hkufXPOSeZq6sRAfKpC7FZiB4zb81/rW5vS ZseVGYIZ0CXdZOuWQFMJpYCDbrMSOKRLIUmxxjxvER6H8gBOtHNOQImy0MyWcuPKyGIsI6Wg8/LlP 606NpAaIoGG5SO0XLynQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPOKW-002ekb-Kg; Wed, 02 Mar 2022 12:43:44 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPOKS-002eij-B8 for linux-arm-kernel@lists.infradead.org; Wed, 02 Mar 2022 12:43:41 +0000 Received: by mail-wr1-x42c.google.com with SMTP id d3so2621239wrf.1 for ; Wed, 02 Mar 2022 04:43:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=JEEYQR28aCloRRLqefUizpnHK6W5GlhdIkcq9mPHcXs=; b=k2XRyMYJYkEP6XEKB7cdLJ190JESykZzXQvhU7bLNl2lsG+FShKBlnpYNjnFRV5uIM ybmlj5Mq94zokFwdLPnfSKkuLZH0kHgNTkvcPeQI2Fa2CBS5MTCIrmCBe0+Fsiik3pQ3 3etb05nh4EnOywFVJhKPKLLnbV7GzJR8rb4KoDUjj0H6EvZ14j4ZVLwpHMT7CNw4uEDA hy5VOljLrASupWEybrn6diB65BXkrQ3OcKTfLN938fTHNP9HwvM4V92lx20H0xChCAuV Sq7cldj2nTylq6SJGiiXNb84qpcbAM5Oqr1vxdPSzQ4reX7hdqLRBsK1eec0bqE3pnbo rrdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=JEEYQR28aCloRRLqefUizpnHK6W5GlhdIkcq9mPHcXs=; b=4GNY/KQxC0yQA8etN3pEEJPq3u6W80HOCSppLz9+zvRHjkcBRZ0Wr2YZ/mSBBwQ1sx 9tIitufYbrOm1ng6u4nnwjmoTlJrQetsXgcQGuovsjwEnw+urebqb4PKg/xLlwoapDLF wzAKuhQspKOJPO+bmwAYY35lCFJGQn3xehv+5oJu4Pg5NukM2ATxW7f6EBq8T3TEHMc5 39jLUyZQS6lDxILcOkfV0KuujwKEsD1Zns+EAj2Zj7btVEn9DLDCtaroOzP3EAMjam9K LzYqh1KFBGqqaMR8EIUdN9Se5/79oEgs/M82KND4fUiEt8i1AJcEtFa9C21pqBeT6oNU fGaQ== X-Gm-Message-State: AOAM531zCRqjLaPMv6wSiEhvtqwKq9yMMGbqwvFMQ6+lPORAM5bdDvin cwRm419Uw0TVCL8aeJ3g48I= X-Google-Smtp-Source: ABdhPJzJITa4Aj10n/oqA1Bdkc7ezGPyxiKtq2abOmF3TF9WdCXqj7TEUdMluh8w4PtoRaW5+0dktw== X-Received: by 2002:a05:6000:188b:b0:1f0:46f4:a494 with SMTP id a11-20020a056000188b00b001f046f4a494mr967528wri.259.1646225018457; Wed, 02 Mar 2022 04:43:38 -0800 (PST) Received: from Red ([2a01:cb1d:3d5:a100:264b:feff:fe03:2806]) by smtp.googlemail.com with ESMTPSA id e4-20020a05600c218400b003818133ab4dsm5412044wme.14.2022.03.02.04.43.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 04:43:38 -0800 (PST) Date: Wed, 2 Mar 2022 13:43:35 +0100 From: Corentin Labbe To: Ard Biesheuvel Cc: linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ARM: return_address: disable again for CONFIG_ARM_UNWIND=y Message-ID: References: <20220302113201.1864406-1-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220302113201.1864406-1-ardb@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220302_044340_406473_4E771DC0 X-CRM114-Status: GOOD ( 26.92 ) 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="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Le Wed, Mar 02, 2022 at 12:32:01PM +0100, Ard Biesheuvel a =E9crit : > Commit 41918ec82eb6 ("ARM: ftrace: enable the graph tracer with the EABI > unwinder") removed the dummy version of return_address() that was > provided for the CONFIG_ARM_UNWIND=3Dy case, on the assumption that the > removal of the kernel_text_address() call from unwind_frame() in the > preceding patch made it safe to do so. > = > However, this turns out not to be the case: Corentin reports warnings > about suspicious RCU usage and other strange behavior that seems to > originate in the stack unwinding that occurs in return_address(). > = > Given that the function graph tracer (which is what these changes were > enabling for CONFIG_ARM_UNWIND=3Dy builds) does not appear to care about > this distinction, let's revert return_address() to the old state. > = > Cc: Corentin Labbe > Fixes: 41918ec82eb6 ("ARM: ftrace: enable the graph tracer with the EABI = unwinder") > Signed-off-by: Ard Biesheuvel > --- > arch/arm/include/asm/ftrace.h | 18 ++++++++++++++++++ > arch/arm/kernel/Makefile | 5 ++++- > 2 files changed, 22 insertions(+), 1 deletion(-) > = > diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h > index 5358aad67831..7e9251ca29fe 100644 > --- a/arch/arm/include/asm/ftrace.h > +++ b/arch/arm/include/asm/ftrace.h > @@ -35,8 +35,26 @@ static inline unsigned long ftrace_call_adjust(unsigne= d long addr) > = > #ifndef __ASSEMBLY__ > = > +#if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) > +/* > + * return_address uses walk_stackframe to do it's work. If both > + * CONFIG_FRAME_POINTER=3Dy and CONFIG_ARM_UNWIND=3Dy walk_stackframe us= es unwind > + * information. For this to work in the function tracer many functions = would > + * have to be marked with __notrace. So for now just depend on > + * !CONFIG_ARM_UNWIND. > + */ > + > void *return_address(unsigned int); > = > +#else > + > +static inline void *return_address(unsigned int level) > +{ > + return NULL; > +} > + > +#endif > + > #define ftrace_return_address(n) return_address(n) > = > #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME > diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile > index 5cebb8d5a1d6..56511856ff9d 100644 > --- a/arch/arm/kernel/Makefile > +++ b/arch/arm/kernel/Makefile > @@ -25,7 +25,10 @@ obj-y :=3D elf.o entry-common.o irq.o opcodes.o \ > KASAN_SANITIZE_stacktrace.o :=3D n > KASAN_SANITIZE_traps.o :=3D n > = > -obj-y +=3D return_address.o > +ifneq ($(CONFIG_ARM_UNWIND),y) > +obj-$(CONFIG_FRAME_POINTER) +=3D return_address.o > +endif > + > obj-$(CONFIG_ATAGS) +=3D atags_parse.o > obj-$(CONFIG_ATAGS_PROC) +=3D atags_proc.o > obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) +=3D atags_compat.o > -- = > 2.30.2 > = This patch remove the RCU warning and the boot is now clean. Reported-by: Corentin Labbe Tested-by: Corentin Labbe Thanks! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel