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=-7.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 A4B73C55ABD for ; Wed, 11 Nov 2020 12:37:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4052B20709 for ; Wed, 11 Nov 2020 12:37:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="FT+v6OSp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726516AbgKKMhm (ORCPT ); Wed, 11 Nov 2020 07:37:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:44710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726220AbgKKMhm (ORCPT ); Wed, 11 Nov 2020 07:37:42 -0500 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 135BD20659; Wed, 11 Nov 2020 12:37:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605098261; bh=tbOZUZNuGJOHeVqF2TBi+RYW50P2S55MdCC4L43u0hI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FT+v6OSpE4nVDjsHUiMMnUAdR1DpOA2ldxpKqnCLRaS3SwF7upyYrowUcRyHmjix7 8zIlK33+YiZwq+7IpEZ3jzze9HgnWnDHmY2R5SLPw8H1SVBnlzJ29GbBPZs/D4nhP9 4eslVMTuf+owBRe69cBOiMZFfvZPdxfcKzNqzReg= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 4CBDD411D1; Wed, 11 Nov 2020 09:37:38 -0300 (-03) Date: Wed, 11 Nov 2020 09:37:38 -0300 From: Arnaldo Carvalho de Melo To: Daniel Borkmann Cc: Jiri Olsa , Alexei Starovoitov , Andrii Nakryiko , Yonghong Song , netdev@vger.kernel.org, bpf@vger.kernel.org, Martin KaFai Lau , Song Liu , John Fastabend , KP Singh Subject: Re: [PATCHv6 bpf] bpf: Move iterator functions into special init section Message-ID: <20201111123738.GE355344@kernel.org> References: <20201110154017.482352-1-jolsa@kernel.org> <2a71a0b4-b5de-e9fb-bacc-3636e16245c5@iogearbox.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2a71a0b4-b5de-e9fb-bacc-3636e16245c5@iogearbox.net> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Em Wed, Nov 11, 2020 at 12:26:29PM +0100, Daniel Borkmann escreveu: > 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 Applied to what branch? I'm trying to test it now :-) - Arnaldo > 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. -- - Arnaldo