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=-8.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 710EAC388F9 for ; Wed, 11 Nov 2020 11:26:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 10FF120659 for ; Wed, 11 Nov 2020 11:26:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725922AbgKKL0m (ORCPT ); Wed, 11 Nov 2020 06:26:42 -0500 Received: from www62.your-server.de ([213.133.104.62]:50048 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725882AbgKKL0i (ORCPT ); Wed, 11 Nov 2020 06:26:38 -0500 Received: from sslproxy05.your-server.de ([78.46.172.2]) by www62.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1kcoGk-0008A2-ME; Wed, 11 Nov 2020 12:26:30 +0100 Received: from [85.7.101.30] (helo=pc-9.home) by sslproxy05.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kcoGk-000GRu-CT; Wed, 11 Nov 2020 12:26:30 +0100 Subject: Re: [PATCHv6 bpf] bpf: Move iterator functions into special init section To: Jiri Olsa , Alexei Starovoitov , Andrii Nakryiko Cc: Arnaldo Carvalho de Melo , Yonghong Song , netdev@vger.kernel.org, bpf@vger.kernel.org, Martin KaFai Lau , Song Liu , John Fastabend , KP Singh References: <20201110154017.482352-1-jolsa@kernel.org> From: Daniel Borkmann Message-ID: <2a71a0b4-b5de-e9fb-bacc-3636e16245c5@iogearbox.net> Date: Wed, 11 Nov 2020 12:26:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20201110154017.482352-1-jolsa@kernel.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.102.4/25984/Tue Nov 10 14:18:29 2020) Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On 11/10/20 4:40 PM, Jiri Olsa wrote: > With upcoming changes to pahole, that change the way how and > which kernel functions are stored in BTF data, we need a way > to recognize iterator functions. > > Iterator functions need to be in BTF data, but have no real > body and are currently placed in .init.text section, so they > are freed after kernel init and are filtered out of BTF data > because of that. > > The solution is to place these functions under new section: > .init.bpf.preserve_type > > And add 2 new symbols to mark that area: > __init_bpf_preserve_type_begin > __init_bpf_preserve_type_end > > The code in pahole responsible for picking up the functions will > be able to recognize functions from this section and add them to > the BTF data and filter out all other .init.text functions. > > Cc: Arnaldo Carvalho de Melo > Suggested-by: Yonghong Song > Signed-off-by: Jiri Olsa LGTM, applied, thanks! Also added a reference to the pahole commit to the commit log so that this info doesn't get lost in the void plus carried over prior Acks given nothing changed logically in the patch. P.s.: I've been wondering whether we also need to align the begin/end symbols via ALIGN_FUNCTION() in case ld might realign to a different boundary on later passes but this seems neither the case for .init.text right now, likely since it doesn't matter for kallsyms data in our particular case.