Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3554354pxp; Tue, 8 Mar 2022 17:19:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxyByMrVrYqAYG6f0im108p7OPWWJttCEbKbVNkV4ja8AZ7t/hJP7BI9c7BauXboZjrM2Yw X-Received: by 2002:a65:568b:0:b0:378:86b8:9426 with SMTP id v11-20020a65568b000000b0037886b89426mr16005790pgs.70.1646788772549; Tue, 08 Mar 2022 17:19:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646788772; cv=none; d=google.com; s=arc-20160816; b=oD3aA5YSeIUwIq20ijUBj4SgdvMT60E0ORuGv9LzDy3BNBoxy8QwXNeOd56miNadv/ fTdZc9wv5/fwAC3ppHbd78rTuA2w2bxESCl6EdWHnILorP7wVdz7tZevhy8DoPd2VWnR 9gzNoHg898jdc8aID6c5iZFpeoOYFrc/ZGF2dlpcMghhoTe+F1ejCzYdoaowOmYaTzXg xBvS4Hdig+q3jH6HQC5jBOLuwnRKRZsSD6rXOKxgwsBP+DjBGQhBkHDupbjwpxbHco3V YxsbubVklIBr3thFeQXjuHP0I+Ph3QHMtyDrJhD3pJcmWYv22xYYdL8XbHYmqvLPbSUv 7Q6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=imvzEW6fjyQJ24JWWCXSq1k19TQzUInvHknb1RjZsug=; b=uAVp4ywrpSs1MScC6VtM0vTGnwF4rJ1yG+zN7OC7I3urGbe/D532bSauh+UCpFW9I8 EE3C1WTtqc2WM7jZhDlT5nHNVp+bFc3HmhgFkYyUpgi2+j9ODaMqKLAFT8mtkOl4AKTK i1/kRCsle3+vKg8F9aOi0rcdGPW7DNsJEwRFcvykOTwvMoQ+QpkkaCBTr5KxM8F0/KsV wdCpw2amq+bL2rIuv06sdygJczhFXYiFj2f+OrPIc9rFScRV/d3V7FXB2cNnm/mlYnx/ 0D+7cPD+3fXaCl6EGgl1y9rBGpqZJK2vSRjSVT9mdhhMPKKIv88c9kwg1LSf8xF6ujTa EKAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h16-20020a056a00231000b004e177f7e087si461875pfh.353.2022.03.08.17.19.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 17:19:32 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 28EBF187E13; Tue, 8 Mar 2022 16:13:48 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347787AbiCHPVN (ORCPT + 99 others); Tue, 8 Mar 2022 10:21:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347753AbiCHPVI (ORCPT ); Tue, 8 Mar 2022 10:21:08 -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 F1F104DF4A for ; Tue, 8 Mar 2022 07:20:10 -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 1AEE961587 for ; Tue, 8 Mar 2022 15:20:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EF91C340EC; Tue, 8 Mar 2022 15:20:08 +0000 (UTC) Date: Tue, 8 Mar 2022 10:20:07 -0500 From: Steven Rostedt To: Arend van Spriel Cc: Ingo Molnar , Linux Kernel Mailing List , Russell King , Alex Sverdlin , Abel Vesa , Rabin Vincent , Colin Cross Subject: Re: ftrace bug Message-ID: <20220308102007.6c6618e7@gandalf.local.home> In-Reply-To: <62c01368-b67f-66af-2e31-d62f4df75b61@broadcom.com> References: <9a86b2c9-1009-1683-442e-61c5a7dc8cf3@broadcom.com> <20220307082450.641ed866@gandalf.local.home> <62c01368-b67f-66af-2e31-d62f4df75b61@broadcom.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 [ Adding ARM folks (and those that touched the ftrace ARM port) as I don't know the ARM code ] On Tue, 8 Mar 2022 11:53:35 +0100 Arend van Spriel wrote: > On 3/7/2022 2:24 PM, Steven Rostedt wrote: > > On Mon, 7 Mar 2022 12:26:45 +0100 > > Arend van Spriel wrote: > > > >> Hi Steven, > >> > >> I wanted to use FTRACE on an ARM platform and I hit the following > >> warning which results in ftrace bug. This happens upon loading a module. > >> Looking up the warning I suspect the branch target is too far off. The > >> module is quite large and therefor not loaded in the modules section. Is > >> there a way to exclude a module. In ftrace_module_init I see a check for > >> !mod->num_ftrace_callsites. Is there a way to avoid creating ftrace > >> callsites in a module? > > > > Are you sure it's the size. Just want to make sure that's the reason before > > going with different solutions. > > Interpreting the warning statement in insn.c and given the fact that the > module is loaded at 0xe3xxxxxx instead of kernel module space at > 0xbfxxxxxx I made this assumption, but .... > > >> > >> Regards, > >> Arend > >> > >> ------------[ cut here ]------------ > >> > >> WARNING: CPU: 2 PID: 1525 at arch/arm/kernel/insn.c:47 > >> __arm_gen_branch+0x70/0x78 > >> > >> CPU: 2 PID: 1525 Comm: insmod Tainted: P 4.19.183 #2 > >> > >> Hardware name: Generic DT based system > >> > >> [] (unwind_backtrace) from [] (show_stack+0x20/0x24) > >> > >> [] (show_stack) from [] (dump_stack+0x98/0xac) > >> > >> [] (dump_stack) from [] (__warn.part.0+0xcc/0xe8) > >> > >> [] (__warn.part.0) from [] > >> (warn_slowpath_null+0x54/0x74) > >> [] (warn_slowpath_null) from [] > >> (__arm_gen_branch+0x70/0x78) > >> [] (__arm_gen_branch) from [] > >> (ftrace_make_nop+0x64/0xec) > >> [] (ftrace_make_nop) from [] > >> (ftrace_process_locs+0x370/0x4b4) > >> > >> [] (ftrace_process_locs) from [] > >> (ftrace_module_init+0x38/0x3c) > >> > >> [] (ftrace_module_init) from [] > >> (load_module+0x18d0/0x2570) > >> [] (load_module) from [] > >> (sys_finit_module+0xe0/0xf8) > >> [] (sys_finit_module) from [] > >> (ret_fast_syscall+0x0/0x58) > >> Exception stack(0xd9b1bfa8 to 0xd9b1bff0) > >> > >> bfa0: 01170228 00000000 00000003 01170228 00000000 > >> beb7ceb3 > >> bfc0: 01170228 00000000 beb7cdc4 0000017b 00127010 00000000 00000000 > >> 00000000 > >> bfe0: beb7cc38 beb7cc28 0001a0dc 00012890 > >> > >> ---[ end trace f48808a851a4544a ]--- > >> > >> ------------[ cut here ]------------ > >> > >> WARNING: CPU: 2 PID: 1525 at kernel/trace/ftrace.c:2034 > >> ftrace_bug+0xfc/0x394 > > > > Three should be more content after the "cut here" that is very relevant (I > > hate that cut here, because I constantly need to tell people to show me > > more :-p I need to add a "ftrace bug cut here" line.) > > > > > > Could you show me the output right after that. > > ... here is the output I think you were looking for: > > ftrace failed to modify > > [] (suspected corrupt symbol) Is the above "suspected corrupt symbol" kernel output? I don't see it in my tree. What version of the kernel is this. I'm guessing the above address a82ca82d is where it is trying to modify, and is not in the symbol table. So something looks to be messed up. > > actual: 63:17:16:eb The above is what it found in that location. Perhaps others have ideas. -- Steve > > Initializing ftrace call sites > > ftrace record flags: 2000000 > > (0) > > expected tramp: c0211b88 > > ftrace failed to modify > > [<6c88ec64>] (suspected corrupt symbol) > > actual: 72:ab:08:eb > > Initializing ftrace call sites > > ftrace record flags: 2000000 > > (0) > > expected tramp: c0211b88 > > ftrace failed to modify > > [] (suspected corrupt symbol) > > actual: 04:12:04:eb > > Initializing ftrace call sites > > ftrace record flags: 2000000 > > (0) > > expected tramp: c0211b88 > > ftrace failed to modify > > [] (suspected corrupt symbol) > > actual: d6:7e:00:eb > > Initializing ftrace call sites > > ftrace record flags: 2000000 > > (0) > > expected tramp: c0211b88 > > Regards, > Arend