Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp281375pxm; Wed, 2 Mar 2022 15:20:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJyyty2nYePVIQeCFuWnjSvVOTHxb4hqZ3R1ivhXTLf1LvjILxjR+I08qjumGXXmxAileef3 X-Received: by 2002:a63:5124:0:b0:375:9f87:f881 with SMTP id f36-20020a635124000000b003759f87f881mr25244930pgb.578.1646263200733; Wed, 02 Mar 2022 15:20:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646263200; cv=none; d=google.com; s=arc-20160816; b=vJXC8rGXx2RoKIEZ9OZCNYPAuzqrCDL6S/s+1XxZWVFmLx8WdWLhDkYY9OY62NZJeR ON+pFZQmrggfwq4eC47i9DkoqBWknBOZogZ1rxI4H+iYEQpU4p0hgFnAvs/3UpOfPxVU WXvdIlg0x6ct52FwjI0YWrjcMc6V7QKBRGQfOHSI1l0gbTzTKXmNWyoVt7nSUFGzVWPl 6Ymt+8IVw7yRdTlP4P2Yac6eXC0RLKo4QN5xzQAkHgoFLViBNUXTAC/k+mCBy/WIVWX1 4gdjJOgHpPsCVKmqTGbBYi5vVHS3aD7Zu/ZEdz/ANWirxm1SNadC1RnwW42YqtNrUt9v Xpuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=bYSWwwzywt0AwIeqxP+/hfyojDM5EKSRaP52sC05E4U=; b=AsPMbK21+jvv+BoOB1N1jj82wcJeT6fd2I6vZHEH8O4xqM9jtrEB4zdEpRn9vOys06 DEgqW9CjEOqikh0VojmWcsNlmnHjQsRnd+c98hQAjZPNZCfLeNJU+C8FlwWYCx4J5qkD wEtpdDZOyv7YIq+Kiy4306CLSAresQC174WHnp6mMg7MWPgWboVxtdQODqlp0a+gox0O qOgKYVpisohTDz0F4qhdCl79s9ZNnOWHMQrXTgCwNb8tKEtRvR8GU+ile+vZBOduYrFW XQItK0B+Gn458BZ2ilXUPlJO9aVNooab+UcRbmmt9jq0sNzDOHEjoeeSc7jh+z92Rt0v BRAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JPIfXGZk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id bk1-20020a056a02028100b00373ec9fcb5asi415952pgb.270.2022.03.02.15.20.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 15:20:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JPIfXGZk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DA856113AE7; Wed, 2 Mar 2022 14:56:41 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232166AbiCBLVT (ORCPT + 99 others); Wed, 2 Mar 2022 06:21:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241423AbiCBLUs (ORCPT ); Wed, 2 Mar 2022 06:20:48 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C6676EB38 for ; Wed, 2 Mar 2022 03:19:53 -0800 (PST) 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 82D37617CB for ; Wed, 2 Mar 2022 11:19:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E627FC340F4 for ; Wed, 2 Mar 2022 11:19:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646219992; bh=rKqEy+mljiJeDH91pzeIIiBqaH2MgyBfQqWXX4aKmok=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=JPIfXGZkoZFuGm/k72Osm5X+bYdhBxMIarc3B2pvc/DjsK2TnXr/IvOGEDW2QmGNY Z+D+7hql2Gy6NF3FcjsPbzs1RVJZ/wGkfvh8YcTCTkfsU2Vorra3LkRQIkO4QQNzrK pO23r2sFIEzF2aDJNuj47mWlronOn0dD2/Ru+64urdY/aRyQ5Fhirqd7yLMeyW/aug /Kce2RQ9uW9rdfW2GjtEJIT5ut8Xflu6y7RNGEZk9140gWVLxFHPPYea4Dz8tyzAeb iCQ5ntAP+7Asn4laM7X8nuBN61e9JXIS2yzKaRbPFNBWR2CH85rFKSEDMXIGqaS+rF afI6lMc13Y5qg== Received: by mail-yb1-f173.google.com with SMTP id t63so246729ybi.8 for ; Wed, 02 Mar 2022 03:19:52 -0800 (PST) X-Gm-Message-State: AOAM533ddWT0iBAYby5PM8gW7d1ydjex2B8NfvTzisSU/jU6wp9KQoWe /HutSIN/hEppAR3nNfghQqKF4R4DimRzeFr0QPU= X-Received: by 2002:a25:6c43:0:b0:61d:e94b:3c55 with SMTP id h64-20020a256c43000000b0061de94b3c55mr28960913ybc.224.1646219991940; Wed, 02 Mar 2022 03:19:51 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Ard Biesheuvel Date: Wed, 2 Mar 2022 12:19:40 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: boot flooded with unwind: Index not found To: "Russell King (Oracle)" Cc: Corentin Labbe , Linus Walleij , Arnd Bergmann , Linux ARM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2 Mar 2022 at 12:12, Russell King (Oracle) wrote: > > On Wed, Mar 02, 2022 at 11:09:49AM +0100, Corentin Labbe wrote: > > The crash disappeared (but the suspicious RCU usage is still here). > > As the trace on those is: > > [ 0.239629] unwind_backtrace from show_stack+0x10/0x14 > [ 0.239654] show_stack from init_stack+0x1c54/0x2000 > > unwind_backtrace() and show_stack() are both C code, the compiler will > emit the unwind information for it. show_stack() isn't called from > assembly code, only from C code, so the next function's unwind > information should also be generated by the compiler. > > However, init_stack is not a function - it's an array of unsigned long. > There is no way this should appear in the trace, and this suggests that > the unwind of show_stack() has gone wrong. > > I don't see anything obvious in Ard's changes that would cause that > though. > > Did it used to work fine with previous versions of linux-next - those > versions where we had Ard's "arm-vmap-stacks-v6" tag merged in > (commit 2fa394824493) and did this only appear when I merged > "arm-ftrace-for-rmk" (commit 74aaaa1e9bba) ? Did merging > "arm-ftrace-for-rmk" cause any change in your .config? > I can reproduce the RCU warnings, and I have tracked this down to the change I made to return_address() for the graph tracer, which I thought was justified after removing the call to kernel_text_address(): --- a/arch/arm/include/asm/ftrace.h +++ b/arch/arm/include/asm/ftrace.h @@ -35,26 +35,8 @@ static inline unsigned long ftrace_call_adjust(unsigned 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=y and CONFIG_ARM_UNWIND=y walk_stackframe uses 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 However, the function graph tracer works happily with this bit reverted, and so that is probably the best course of action here. I have already sent the patch that reintroduces the kernel_text_address() check - would you prefer a v2 of that one with this change incorporated? Or a second patch that just reverts the above? (Given that the bogus dereference was invoked from return_address() as well, I suspect that this change would make the get_kernel_nofault() change I proposed in this thread redundant)