Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3308431pxp; Tue, 8 Mar 2022 11:33:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzy1Fw9j/uJejkfjfo3KI/hDgjAoOnefF9hcwea1y83UIQyayfLH4jsWHsagQPQVkIt3L+j X-Received: by 2002:a17:907:608a:b0:6da:b884:c11e with SMTP id ht10-20020a170907608a00b006dab884c11emr14695138ejc.373.1646768025954; Tue, 08 Mar 2022 11:33:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1646768025; cv=pass; d=google.com; s=arc-20160816; b=BDzBp1ISrpwzTsiPzTP6bj18trket9K7MjurZzlrT48TEo5rftIOrIk8Ru48Fhusob Psud8LZduWCGI/G/Oaf8CS9d4ckTroztnWsAq2Ol1g9Fg3qtWmakSSR2L4CVR5V8vsuU U+dJSIT6TbZX8st7f2Y7EvjCaeWN4ivnv6cEjpglseM2b1eanC7SvFnT3Lkadkv3VWW+ P7r3sqHIhpAcJcFspvaen0WLXLikG7v2G2YPJxaIY8UQVVDOG5FvXa0qxZ4ya/YwIAxv cIBjKNQvcq4jg+fnCBI2fKKHpfdHoCyFOGKnQXm9hIpgv62yB7gtVlA86/hXHMYp71fi g4Eg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=Ee7kaV50oVgHt4QfkfGNUBbJGUSLPG6GZW6hGUtojbw=; b=AB2I6YEc1zXJ5bCKaLdH44pNyLTgCk2/vUj0nQI/J7613gu19a4sDbKn9nUsAF9ZK5 mVFwF5tXXe9jpPDUzPHIkBqNZs9JIAdhnoH3zPNpaW1ytisvpNhK7CQye2UlHaelFArR cUrIOoLhihs4FbWno1pxipah+YsrLJ8oiwN2BILW5xt1Aw21wYhHGmm4EmM2WxWOeGQm 3JcyccUyHapp/hW/lb1dDjg2SWfprrt+/w6aOMS6IVcUv9GksSQerNLvRs9cKklaTY9v caiZ2pi4oHvGpsX5cP7GP6odK2GN7PguIYyvt93kgRshve6LA49NebdpbX30HTt9hdDK E2ow== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nokia.onmicrosoft.com header.s=selector1-nokia-onmicrosoft-com header.b=epKy3N+K; arc=pass (i=1 spf=pass spfdomain=nokia.com dkim=pass dkdomain=nokia.com dmarc=pass fromdomain=nokia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nokia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bi19-20020a05640221d300b004132ced5365si11561290edb.521.2022.03.08.11.33.22; Tue, 08 Mar 2022 11:33:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nokia.onmicrosoft.com header.s=selector1-nokia-onmicrosoft-com header.b=epKy3N+K; arc=pass (i=1 spf=pass spfdomain=nokia.com dkim=pass dkdomain=nokia.com dmarc=pass fromdomain=nokia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nokia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239591AbiCHQEB (ORCPT + 99 others); Tue, 8 Mar 2022 11:04:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233290AbiCHQEA (ORCPT ); Tue, 8 Mar 2022 11:04:00 -0500 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2137.outbound.protection.outlook.com [40.107.21.137]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F2AA20F6F for ; Tue, 8 Mar 2022 08:03:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KDVV1pGUNKhysRL7EpoHdEvZ5vLSv7ChE1Ip6LBImfNcEW2wvHc76pzsxQhSlqz5cljipdpDiRnD2oR+IOpkCo7KltC79RA1dcv7n+0s3a/bS90yv3ZfVhT7jea4HKZA8Aw6WV24qwHUPwkLcQ1N7DJxhM/fIN75b9qil8QrvkBXFa9myChkksRtVn5f/WwJR/mrNUD+jAAMTzyoHQ8rXsGv1cXh7QzKsCqdQ6sGJiYe1qXDWHc6OZwmhr+thLGcoF/X+50Rt+GpnIvJ/VFUE8wAxVqYjMZu363PC1dqjhXIBXcOiqe6IkQ2sq8NKuKNkV2Wk+8O57jcfQTExkuO1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ee7kaV50oVgHt4QfkfGNUBbJGUSLPG6GZW6hGUtojbw=; b=BZ1CPPQKWXQ9sQjSfzRuyoF9EEvK+MRBN5zUOPk1tEr3buTAIAEP4dTBBQ4xq0/IPEsJhrcciWoevxbF6aaJ6yh1zdVtU4GakK/x1+TkPVJ0u3rinlSSoNRUnoa0U5ldXx7+yv1+yqu6C33iMAjRcST1famojPLzlKcGw3J7s88iEVHJhf83W1O5ivyV8tI+jbbdyHHxVb6iIwn0N4LKN9xQhXRRYz8h9tsvTbq4NjL/ZzVsnmEgj1Asre4hZGAOU/x7V+m0l0hGctBbtmOwIqwZOFiNnN225FJIHuhotuq7uDEMhgE8EyeK77hqCC7E3iPXRXWCms4h0CiCzv1Neg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nokia.com; dmarc=pass action=none header.from=nokia.com; dkim=pass header.d=nokia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ee7kaV50oVgHt4QfkfGNUBbJGUSLPG6GZW6hGUtojbw=; b=epKy3N+KKzLdGLYtn+JKjh/ZX+ug8FCgma9xI+mjavsB8crb9uIh+5xKZb60trW14mSmcdo92LViKsUZo2TtYHN1JZeV4oos4Utg08E4w+bDWighHHYDGvXdwLVTxDPyXTUax2jgM9gc6Cm7b4d75+S76fPBaaEl/F9+78e64YU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nokia.com; Received: from AM0PR07MB4531.eurprd07.prod.outlook.com (2603:10a6:208:6e::15) by PA4PR07MB7518.eurprd07.prod.outlook.com (2603:10a6:102:b8::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.8; Tue, 8 Mar 2022 16:02:59 +0000 Received: from AM0PR07MB4531.eurprd07.prod.outlook.com ([fe80::30a5:64a8:1672:4169]) by AM0PR07MB4531.eurprd07.prod.outlook.com ([fe80::30a5:64a8:1672:4169%4]) with mapi id 15.20.5061.018; Tue, 8 Mar 2022 16:02:59 +0000 Message-ID: <1dec8992-b924-7ea2-8e45-a6bbc10a6086@nokia.com> Date: Tue, 8 Mar 2022 17:02:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: ftrace bug Content-Language: en-US To: Steven Rostedt , Arend van Spriel Cc: Ingo Molnar , Linux Kernel Mailing List , Russell King , Abel Vesa , Rabin Vincent , Colin Cross References: <9a86b2c9-1009-1683-442e-61c5a7dc8cf3@broadcom.com> <20220307082450.641ed866@gandalf.local.home> <62c01368-b67f-66af-2e31-d62f4df75b61@broadcom.com> <20220308102007.6c6618e7@gandalf.local.home> From: Alexander Sverdlin In-Reply-To: <20220308102007.6c6618e7@gandalf.local.home> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: AM6PR05CA0006.eurprd05.prod.outlook.com (2603:10a6:20b:2e::19) To AM0PR07MB4531.eurprd07.prod.outlook.com (2603:10a6:208:6e::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: de614d72-9d3c-422a-5af7-08da011d1d3c X-MS-TrafficTypeDiagnostic: PA4PR07MB7518:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A0AxuWT3WOVdTHp64ae/bm949WR8T1UTCM6hsikLah/oy+7FivHq/8IncguTzDqNlkOnVY0w0oDiXPwBlE9RWcKUMMZubHt3w4oRF/cAVxL3ocg3OSMR/+iuZvMJC+5Nh0NX+zwhkNrdZO5wSC4w5Pn9VAzbYPX/BlYtMSCaLO6g+aZLHkioeyhAHeHwEbKRp/3CMjFoPzgFgDw0EIkrNfTtg53Vpp8SuSs4zKiVQw/noADv/YpsCEgHjtNGvKSuiOgk2F3dLBuQOkrRa3b0ea5rUDmC9gm42RP5HUOJoyAd1FfytdHO4nq7QBaaIaDmw5i1olfo9deObT3GzgSPYxhPKQWrf+nXcBnF1ZYRaMnB2Wp7R9ocTtp5ul/if/YCr5xL3Uj08qSvFY8ZwsrItp0DUs2IxKg/E0cEovn+kdCiM1zAuToM6TAxM6k5XZbe594duASH4cSQc1VGbUAgsEiEXsiWxVq2+Raedo/9Cl6fvzfak+QPXk1bTKvSGtThPrx+CPsVddNGgznO82muOHY6Fuu4NXfvnrjUA1f0X7SyMkq0CibtAkOfnsec2c3KQbFkYJl4VAnypwRmHXxusA6v2DBcMYlwXC/hZR2mmgnRY0wbkaz5b5QNEkYxRewlis8H+HZr+gWFti8+GyVwEwJrMAS3GPVaOmiOcf1gJiiah2030vKE7LV7gMarrl2fzJZLtRm1mtUgDD0j8beToCxyjiLBv0yAQI+FXO1DOpbWChVA0Mva3UNLtSONy+1fFz9lCb57+SqzEEVh7O3PGg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR07MB4531.eurprd07.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(316002)(8936002)(5660300002)(66476007)(38350700002)(38100700002)(6486002)(508600001)(2906002)(26005)(2616005)(186003)(4326008)(44832011)(83380400001)(66946007)(3480700007)(53546011)(52116002)(66556008)(36756003)(7116003)(6512007)(6506007)(6666004)(8676002)(86362001)(54906003)(110136005)(31696002)(31686004)(82960400001)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?clU4UDFpak90T1JsK0lyTStPcTRrRlV0dFZYR3Buemx4QlNvQWlqb25BVXUy?= =?utf-8?B?NytERDZCMEp4S0hVZlM5bVJiKy9RZEhEVTNZbzMxQnZPZXU1eFVnT3llUUVq?= =?utf-8?B?QnpQYTdKaE5uOHk0UERyRUFoMjdrd3duVVc5VUl2dUc5QnZHSERnaEw3dUdq?= =?utf-8?B?MDRFdnlzazNIcHhMOWZMcWZvVFFaQ3N6VGFuR3RJVE1nYTJ1OWRSNlBWZndN?= =?utf-8?B?Uy9wR3pYUXJhbDFPMUFRT0ljZ1dBYkgvVGk4azNLTXlUUkR1NElpMExaeXc1?= =?utf-8?B?WXF5N3FDZVcrVVhRdS9xUEg0VjJBMWVlK3ptNlBGOG4vRnRRSGdTNUlQelRl?= =?utf-8?B?NXRnOEVUUUFHOH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XNRT1RxaVlyMitnaEx5aVBOSWljbFpQcDJydFZCcWpzNVErbTZRaXgv?= =?utf-8?B?OFU3ZWxqejZUVmlhRVE0Z0JGWTBwSFMrbnlwTzF3bmdOWlIxVHc2cHhDcWFJ?= =?utf-8?B?c05sT1N0cld2bmFjZVdmWXVrYmdlcTRha0xqYnB4RUNWSEs2enlwSWFIS0dW?= =?utf-8?B?V2RXUmhlY0luRzlJSVFHL0RzdWtvR1JCME9FNXM3aUxhYk9OSk0xZXRCWDRv?= =?utf-8?B?MjhNOEFFTmJrWE8rNEdiVUNyVTVpV2xQMFQ3c1ZnR3M4d2dlQ1U2KzI4bDdN?= =?utf-8?B?cmRKMHJYUVJOUkNuQ1lNMHlQQVQ4QlhpQjlDcTZYTi9ITDlhcWhpdFhEbmpp?= =?utf-8?B?aHc0Y3ovMElJM1J0UmVQUFlEYlZlT0Zsc1VRczh4TExUaEg4R0ZxcThkV285?= =?utf-8?B?QzZmNHlIK0JEWVp5TFA1ZTQyTFJWRTlFeFRQVWh3dmVUaHFlMklmcXVsamtT?= =?utf-8?B?RmlBMDM4N0s5bUxYUUpBUmhZL0RXTWhyVVo0cXptL1hGU1U0U3BMSjdvZUdt?= =?utf-8?B?RmhJVkJwVEVrL2RQM2swZVU2WkMzU2NsNUZqbmhLNERjOThEcC9BcWk2ZVhi?= =?utf-8?B?ZmlUZmRPVFQvS3lMU3NYcFhJRkhUWXgwVmM4SjlRSEwxOCt4RjdwTXlyMmZk?= =?utf-8?B?NFl4NXJYWDdnb2xxYkhPNVI4UnkvUjBjYVQrSytMZzVrOUk2WDl3Tmx1elpK?= =?utf-8?Q?dac625ibEglvKOfPGctksir4JDbxrk=3D?= X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-Network-Message-Id: de614d72-9d3c-422a-5af7-08da011d1d3c X-MS-Exchange-CrossTenant-AuthSource: AM0PR07MB4531.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2022 16:02:58.5957 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hj48iQE9CoNojPpfSu4M5JqyWuRg6RNNqQZXOz7mKuBES9/cFiNruWDzdrpVOcUoI27HmyIY+yGMIDlKAG5m/rltd7xDUuApK/ajuK2e5cI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR07MB7518 X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_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 Hi Arend! On 08/03/2022 16:20, Steven Rostedt wrote: >>> 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 This problem is addressed by: commit 8113e622926ef6590771ede0f7f64821e1751b67 Author: Alex Sverdlin Date: Mon Sep 27 14:02:45 2021 -0700 ARM: 9079/1: ftrace: Add MODULE_PLTS support commit 79f32b221b18c15a98507b101ef4beb52444cc6f upstream Teach ftrace_make_call() and ftrace_make_nop() about PLTs. Teach PLT code about FTRACE and all its callbacks. Otherwise the following might happen: ------------[ cut here ]------------ WARNING: CPU: 14 PID: 2265 at .../arch/arm/kernel/insn.c:14 __arm_gen_branch+0x83/0x8c() ... Hardware name: LSI Axxia AXM55XX [] (unwind_backtrace) from [] (show_stack+0x11/0x14) [] (show_stack) from [] (dump_stack+0x81/0xa8) [] (dump_stack) from [] (warn_slowpath_common+0x69/0x90) [] (warn_slowpath_common) from [] (warn_slowpath_null+0x17/0x1c) [] (warn_slowpath_null) from [] (__arm_gen_branch+0x83/0x8c) [] (__arm_gen_branch) from [] (ftrace_make_nop+0xf/0x24) [] (ftrace_make_nop) from [] (ftrace_process_locs+0x27b/0x3e8) [] (ftrace_process_locs) from [] (load_module+0x11e9/0x1a44) [] (load_module) from [] (SyS_finit_module+0x59/0x84) [] (SyS_finit_module) from [] (ret_fast_syscall+0x1/0x18) ---[ end trace e1b64ced7a89adcc ]--- ------------[ cut here ]------------ And if you wanna stick with 4.19.y, it's included starting from v4.19.209. -- Best regards, Alexander Sverdlin.