Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1780992rdb; Mon, 8 Jan 2024 09:59:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IFhvllFhXJP692YdzEem5CXFRjtpLGp1zfxSdE7Yk8mZo4zAu66XYonHyoSuGhBZFchp7GK X-Received: by 2002:a05:6808:3988:b0:3bc:e5e:ed6e with SMTP id gq8-20020a056808398800b003bc0e5eed6emr4774380oib.61.1704736752304; Mon, 08 Jan 2024 09:59:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704736752; cv=none; d=google.com; s=arc-20160816; b=05QWpeOwhVWBzhQIuxp6D6L/nxNzoA8zkJiP6MwyFad9gcC7rwYdkUpluJLu1epLyr JM7a6w2sxZu3YCO35Dh2MI0+zy9zRnA2wNTzQMJ17eJsWovxs/fgogc2VfADAJdMjYfJ OvIYMFxNqtisXt7b6IrPUSy7bkOAQIn+0PO5O27CIziv3KsMddvmsHQVDEyAK4mQaLGM uOFjVfyokcfsq6Q81ChESdafra/PdPBxfbjMFcFlQO9SO13Mq7Tknyon71Guk7AK4f8l /Nsv3rbcNuqNGcD9/noj5A6dvbFwdVGanGChB7fcekVBjzFfpyVslGNVsYuuwxnduC0D WPqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=U5vHpLovxHw2jLbFSMwbVDfMhB5fX3K4zCUa0DIZn9Q=; fh=OAV1m7/0G33kvKkIakSMrzKqoHbZMdERn9cIe8GWk8k=; b=G0dk1jHgq1zmu0f73X5oMdQsuMiw67jAyoFcVwjk34qb++C5zwUNCRyGxYzujajMy/ ZZa3FCX8a6kms94XC0xl0MQIXagEsrV0t/C4v5KYy3fbcEczioLx4YofS7mNbSIjXYgd 53fcT3YKndfdZ3K7a8/ye3IOSnXQUdW5epl12y/ufeFbF4Gks+vLIc0b1JzQOqlC17CL 68vNz160NCTG9s1/a6ln3teR/UDhW/EHvxIie8XhVyF0jPxsDv1FJGXVfRYOb97dLfKc H/2fWgCQ9cF84cqcod42qZbHbWn3O0wattlMjy+pm9/bhL3frBlI9Gbh7oQ5+1+HJ83Y 7OGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm1 header.b=QCuiJ8OT; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=HW+5pS6p; spf=pass (google.com: domain of linux-kernel+bounces-19919-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19919-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id s25-20020a0cb319000000b00680f74cf179si427646qve.464.2024.01.08.09.59.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 09:59:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19919-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm1 header.b=QCuiJ8OT; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=HW+5pS6p; spf=pass (google.com: domain of linux-kernel+bounces-19919-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19919-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D8AB61C22D74 for ; Mon, 8 Jan 2024 17:59:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3ADB154FA8; Mon, 8 Jan 2024 17:52:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b="QCuiJ8OT"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="HW+5pS6p" X-Original-To: linux-kernel@vger.kernel.org Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 735C854BF7; Mon, 8 Jan 2024 17:52:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dxuuu.xyz Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id C2DC53200D00; Mon, 8 Jan 2024 12:52:53 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 08 Jan 2024 12:52:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1704736373; x=1704822773; bh=U5vHpLovxHw2jLbFSMwbVDfMhB5fX3K4zCUa0DIZn9Q=; b= QCuiJ8OTr3lnfrzIujxwe/TZfLN1UIxB9lhaB8yim94u+mOcHro7SQ0ObxmjGCj4 Tb5u0npdf4GTBeVq7Cz2aFXmNa+QaEhiPOPcYSTHw5bxB+WNwzuSL0IBboyPK2jL RzROivW2MUr5bdEzhDn/fpTjaPkhuKq7Y2O2FlIsGTSQ9/BiKUju+JyX8yMRXGxy 4JPkPMqkebAGZ6X5Oy2CJOJRzQ+gue9Cqa/+eZVCp0qB+sAUPlgY+jxbyGXJVYhe X8V375V1byyUcuQNDBOBnTK7GBHSMhaLYEUU1U0iaoBJMrNlJHxV6qxUG3wMq5B0 uH7MPtSQ6xQmfd7oR7iFQQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1704736373; x= 1704822773; bh=U5vHpLovxHw2jLbFSMwbVDfMhB5fX3K4zCUa0DIZn9Q=; b=H W+5pS6p8StQO1iOCpRMUGETWwegLC/itEkr0WC7HcpACh+OG0OM0TAGa2hkvGwaP 5qvYy2mXuiO0tnh4P2u0crfFK96diRxzgDdqyWzqT/FYexQukTZ6mnUCLxYEbIIM 4VlhkzufmFARICF16ChUFz/yOoBP+iZekdv0UswKOkpjR6BNq5VapPZOg1q2qT/C 5PveKLQu44B16jB0rftks3B649wadrnfVLj2ZAxOpu0DO54vzbm8rXKi4m1mMfQ9 /eYc+hn5aySPRTAK8Hg9gCA/LLAcGWZE7njvQ556WjGBHBu6qQhslWNzlDUkyO8K iQsL/YuJcDENA1Msf1eVA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdehjedguddtgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggugfgjsehtkefs tddttdejnecuhfhrohhmpeffrghnihgvlhcuighuuceougiguhesugiguhhuuhdrgiihii eqnecuggftrfgrthhtvghrnheptdfgueeuueekieekgfeiueekffelteekkeekgeegffev tddvjeeuheeuueelfeetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 8 Jan 2024 12:52:51 -0500 (EST) Date: Mon, 8 Jan 2024 10:52:49 -0700 From: Daniel Xu To: Lorenz Bauer Cc: linux-input@vger.kernel.org, coreteam@netfilter.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-trace-kernel@vger.kernel.org, fsverity@lists.linux.dev, bpf@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, cgroups@vger.kernel.org, alexei.starovoitov@gmail.com, olsajiri@gmail.com, quentin@isovalent.com, alan.maguire@oracle.com, memxor@gmail.com Subject: Re: [PATCH bpf-next v3 0/3] Annotate kfuncs in .BTF_ids section Message-ID: <6t5bei3t2gwhuycu6ewftrgfuuyfhs26euymkysefqyfabgupa@3od5pe6ajybo> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Hi Lorenz, On Mon, Jan 08, 2024 at 10:15:45AM +0100, Lorenz Bauer wrote: > On Sat, Jan 6, 2024 at 7:25 PM Daniel Xu wrote: > > > > === Description === > > > > This is a bpf-treewide change that annotates all kfuncs as such inside > > .BTF_ids. This annotation eventually allows us to automatically generate > > kfunc prototypes from bpftool. > > > > We store this metadata inside a yet-unused flags field inside struct > > btf_id_set8 (thanks Kumar!). pahole will be taught where to look. > > This is great, thanks for tackling this. With yout patches we can > figure out the full set of kfuncs. Is there a way to extend it so that > we can tell which program context a kfunc can be called from? I think a potential approach would be to extend BTF_ID_FLAGS() with some more flags if we want to continue with .BTF_ids parsing technique. But it has some issues with program-type-less helpers that are associated with attachpoints as well as struct_ops helpers. Since it looks like we're in rather early stages of program-type-less world, maybe it'd be good to defer solving this problem until more use cases are established and we can find a good cut point to design around. Even with uapi helpers there was no way before. Thanks, Daniel