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=-6.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 4A157C5517A for ; Wed, 11 Nov 2020 11:51:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D69DA2075A for ; Wed, 11 Nov 2020 11:51:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="A9ms+WRV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726495AbgKKLvO (ORCPT ); Wed, 11 Nov 2020 06:51:14 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:48151 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726203AbgKKLvM (ORCPT ); Wed, 11 Nov 2020 06:51:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605095467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fBZlME/NpyU2+DxETmjLqkp/S2r9CBRgxTt3fLfXBVU=; b=A9ms+WRVbuiDlJwiguuEEZYbzxvscYXKkkeNxzajjkVzyw63cn+Izi86voeWm6tyGeoqXI B6RfUpgxc+VCv+qKxhbPM/e36NJ/oBYpVprqB9sEmueYk4mI2dWL0ZrjmkaKkr2BedTEyK lvFQuYWVMFgW5YY+NJA1ByXyAX3VRVY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-366-2RsBwSU5OpyWTZPXMVWpMA-1; Wed, 11 Nov 2020 06:51:05 -0500 X-MC-Unique: 2RsBwSU5OpyWTZPXMVWpMA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 13ACE188C12F; Wed, 11 Nov 2020 11:51:04 +0000 (UTC) Received: from krava (unknown [10.40.194.237]) by smtp.corp.redhat.com (Postfix) with SMTP id 4AD1527BAE; Wed, 11 Nov 2020 11:51:01 +0000 (UTC) Date: Wed, 11 Nov 2020 12:51:00 +0100 From: Jiri Olsa To: Daniel Borkmann Cc: Jiri Olsa , Alexei Starovoitov , Andrii Nakryiko , Arnaldo Carvalho de Melo , 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: <20201111115100.GH387652@krava> 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-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Nov 11, 2020 at 12:26:29PM +0100, Daniel Borkmann wrote: > 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. > I'll check but I think it's not a problem as you said thanks, jirka