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 X-Spam-Level: X-Spam-Status: No, score=-4.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00051C433B4 for ; Tue, 4 May 2021 19:11:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CB57A6117A for ; Tue, 4 May 2021 19:11:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232183AbhEDTMB (ORCPT ); Tue, 4 May 2021 15:12:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231694AbhEDTMA (ORCPT ); Tue, 4 May 2021 15:12:00 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53D05C061574 for ; Tue, 4 May 2021 12:11:04 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id b15so8990419pfl.4 for ; Tue, 04 May 2021 12:11:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=TxzHRwKZbDTKhAa3rqkFK95SxSm1x12WqGIcE5Es6j4=; b=AFowgdU/OmbKbthBcKzRkr7Y5AT78+GPyr1ojZ6S//j2d0LhJwRPyFipq4OnJPXA31 JeZhy6Y+9i8KtY5CAN+rWgw/VqGDruzdEsEoJ7pS+Uor11OL2HFIlbFKLeqP2ltwvE8R RYuDwduyL+BQXtaXUWttDjQtueH2mbSfaHgpaFLVX4R1k6YaZmPm06w0KqJqpZdXmyKr YVXEAjmwq8yAUEcgZ9aB++GswYH+79ZBdpz5eDPWKgE5SRDelgoMn47a+6oS3ka4anC5 Y46lOpAz0ztEwzucbXqJbdo/KNtP7CvbHQYVW7VlMrgGqrAnHFLkp4jFhd+vS9PbOLOW Qhrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=TxzHRwKZbDTKhAa3rqkFK95SxSm1x12WqGIcE5Es6j4=; b=A6Brfxu+YRIry1nfE2EUHbW4qlDt1HofOjYjMAJnIv5EXlL5T2Fa19K9xLO+yAny2q ZiWglI5Y8aAWsbkIMth1AYEyGqbFDE4OWs2DfrYr0zNbun4XoW/oK86kjCMqxwkC9yL8 S7natMQ06pW9SmA6uo738P99v9PFGFzocjJBz6y1F9Www62E3KrLYTtt95rSAxhFQ9mg HUTAIcrQcf0VytMpoN6B2ZmRAa87B/ZCdIZZV4hb01rRUtzyTGEU1kUWxSwhD1GY0awy 49ABukoBLsng5oev11mFcUAdyiHqZxmg6Y4ZtCSaXis1IcBUEljUClPYBMC7SBfGnTWh y7BQ== X-Gm-Message-State: AOAM530ZW20Rc0lg7sQN5hkzkxXux+xhFfu9ryE5XRhHU33SyGvqFkN3 10JvhyPl4uxI5IrQRBMVxDv4LeYwp4w= X-Google-Smtp-Source: ABdhPJwesoeSKj4IzrFaOZdUqefGTqzsYZhBL0PG4+uoscVLKtLuvnTlt8c7QlURYqfUFwALg//c1Q== X-Received: by 2002:a17:90a:d24a:: with SMTP id o10mr6848029pjw.138.1620155464463; Tue, 04 May 2021 12:11:04 -0700 (PDT) Received: from [10.67.49.104] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id i126sm12638288pfc.20.2021.05.04.12.11.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 May 2021 12:11:03 -0700 (PDT) Subject: Re: [PATCH v8 0/3] ARM: Implement MODULE_PLT support in FTRACE To: Qais Yousef , Alexander Sverdlin Cc: linux-arm-kernel@lists.infradead.org, Steven Rostedt , Ingo Molnar , Russell King , linux-kernel@vger.kernel.org, Ard Biesheuvel , Linus Walleij References: <20210330114035.18575-1-alexander.sverdlin@nokia.com> <20210409153309.wbebto3eufui35qs@e107158-lin> <20210412110810.t7pqkwawn5zmqbca@e107158-lin.cambridge.arm.com> <20210419223448.vummlz37nyc3a64i@e107158-lin.cambridge.arm.com> From: Florian Fainelli Message-ID: <761c79cf-8709-6da6-cdb7-9e03e25f0272@gmail.com> Date: Tue, 4 May 2021 12:11:01 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210419223448.vummlz37nyc3a64i@e107158-lin.cambridge.arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/19/21 3:34 PM, Qais Yousef wrote: > On 04/19/21 14:54, Florian Fainelli wrote: >> >> >> On 4/12/2021 4:08 AM, Qais Yousef wrote: >>> Hi Alexander >>> >>> Fixing Ard's email as the Linaro one keeps bouncing back. Please fix that in >>> your future postings. >>> >>> On 04/12/21 08:28, Alexander Sverdlin wrote: >>>> Hi! >>>> >>>> On 09/04/2021 17:33, Qais Yousef wrote: >>>>> I still think the ifdefery in patch 3 is ugly. Any reason my suggestion didn't >>>>> work out for you? I struggle to see how this is better and why it was hard to >>>>> incorporate my suggestion. >>>>> >>>>> For example >>>>> >>>>> - old = ftrace_call_replace(ip, adjust_address(rec, addr)); >>>>> +#ifdef CONFIG_ARM_MODULE_PLTS >>>>> + /* mod is only supplied during module loading */ >>>>> + if (!mod) >>>>> + mod = rec->arch.mod; >>>>> + else >>>>> + rec->arch.mod = mod; >>>>> +#endif >>>>> + >>>>> + old = ftrace_call_replace(ip, aaddr, >>>>> + !IS_ENABLED(CONFIG_ARM_MODULE_PLTS) || !mod); >>>>> +#ifdef CONFIG_ARM_MODULE_PLTS >>>>> + if (!old && mod) { >>>>> + aaddr = get_module_plt(mod, ip, aaddr); >>>>> + old = ftrace_call_replace(ip, aaddr, true); >>>>> + } >>>>> +#endif >>>>> + >>>>> >>>>> There's an ifdef, followed by a code that embeds >>>>> !IS_ENABLED(CONFIG_ARM_MODULE_PLTS) followed by another ifdef :-/ >>>> >>>> No, it's actually two small ifdefed blocks added before and after an original call, >>>> which parameters have been modified as well. The issue with arch.mod was explained >>>> by Steven Rostedt, maybe you've missed his email. >>> >>> If you're referring to arch.mod having to be protected by the ifdef I did >>> address that. Please look at my patch. >>> >>> My comment here refers to the ugliness of this ifdefery. Introducing 2 simple >>> wrapper functions would address that as I've demonstrated in my >>> suggestion/patch. >> >> What is the plan to move forward with this patch series, should v8 be >> submitted into RMK's patch tracker and improved upon from there, or do >> you feel like your suggestion needs to be addressed right away? > > There's no objection from my side to submitting this and improve later. OK, thanks! Alexander, do you mind sending these patches to RMK's patch tracker: https://www.armlinux.org.uk/developer/patches/? Thank you! -- Florian