Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1350648rdd; Wed, 10 Jan 2024 17:27:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IHYqWWkbekthcF6owIoPj+Dn5kdJljaTLbca8lpkZQDGWnfzhLgv1IRSRx5wnFNsmbaAhfK X-Received: by 2002:a05:6a00:2d18:b0:6d9:af4e:804 with SMTP id fa24-20020a056a002d1800b006d9af4e0804mr498193pfb.35.1704936459744; Wed, 10 Jan 2024 17:27:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704936459; cv=none; d=google.com; s=arc-20160816; b=P/BAsPzmMepguCMpIYAiYscl9aw26ysB69w7gnWS7gqP8V+wokbrOF6tbUWSetqJoo 3hzqP2BHCd4VYcuxl3gYRgqEV7WSB6lErYqRSfe6O1tg9mZ59RdrlbLZhIpu8b0CDeAT ydppJT1eKo9p4lEOX7vPsFHOJcMDCdApJykVUwKGX7uIvQBkmYSk1Pym3wIcoPNv9Oxy tqxbWmOKcsZ27/WDE8vaw8nvVKbg+aHi/oHfaaq5c4XIa39Z2N/N4guRu2rYO2nHMCkg 7aGbMx3Z0K5nZSYDGBK3Ye/WeGXXS7ShGSO0Er86JDuf7/CkLb/O1dPkvZ23nOZyZuN4 qLqw== 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=QgJ9yQRRKlfBjz+XKZdFtWiCEuEshUHPGj0G2dnzzCg=; fh=YpqemKBlzv23MV9ciPUkwmJh/tBdcSqwwTyCB7InhGQ=; b=lYs2NxXJW7OqKhYU9v5aBSLuTh3G80qJbpaLkknKH/leog51yjDl1DnPHzxYbm/dyy V31fVCC1wRbmWCfMl+QKUpV0916vuWZUGAu6U4zp/wrYxzvMtEKdnIsofAfBSVSomuEh WHwdBRw/s/ZZVN7Fyq5f1kbHQkYL4+bUWLnMSY9nFjHGAR7Nu9UlY0Mb7meNiIL9mJG0 cOTvCCcu7NfXVAWOxUskE1QCfHeuUTdKoQLAL7On6EIjYecYErrh3/6HjLv45RB8zKWq gAeOgva/pEmmhXUdZZKqLsHOpRXaYebhM7AdT0R9ZfBRcDf2i5v6LpWx0lFkrPHzb/Ug Q++g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm1 header.b=STBrG1bG; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=0Dvct0On; spf=pass (google.com: domain of linux-kernel+bounces-22926-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22926-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id g1-20020a636b01000000b005cecb6a1027si4892920pgc.702.2024.01.10.17.27.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 17:27:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22926-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm1 header.b=STBrG1bG; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=0Dvct0On; spf=pass (google.com: domain of linux-kernel+bounces-22926-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22926-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id ADAFFB24AA1 for ; Thu, 11 Jan 2024 01:27:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 20852ED6; Thu, 11 Jan 2024 01:27:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b="STBrG1bG"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="0Dvct0On" Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (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 69F63EA3; Thu, 11 Jan 2024 01:27:20 +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 compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 8E7543200B0F; Wed, 10 Jan 2024 20:27:17 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 10 Jan 2024 20:27:19 -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=1704936437; x=1705022837; bh=QgJ9yQRRKlfBjz+XKZdFtWiCEuEshUHPGj0G2dnzzCg=; b= STBrG1bGxG9KECg8tUylREuoybIu6frA/RDhI3qlD+TatlhS6DPr2KUWx0dMGbNf 8FtyvtQH/a8KTQTlx+KUhvDrr7ga5ficqg5mD7QZ/9he/7pFqHtsp+X2l0CkSlem zTAmGBcDdglWUzWnmPaQQahUgpdik0lA6W5LlKq2YwCZ59LtPDwkj2RNstPlfxxG DW9Vbz8Mwz7/imCPxxOOz4xZV4pb6cVvXKL1nDY2ti/0ouQzt55WLfLgJcoo8y2P nWWAkNXMFtZ988jgVKTgvI3UFoZF8b7O3ZuR11plDJHf2Epz4gYbyXmUq58YDvxr uDeu6uI+6AkEgXjRqIWMYQ== 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=1704936437; x= 1705022837; bh=QgJ9yQRRKlfBjz+XKZdFtWiCEuEshUHPGj0G2dnzzCg=; b=0 Dvct0OnhZVG/wGSy5gsSBaBR2WiUmUsEDzpaq9C5wsA2wO1SBr5FrmLV6FizRxA4 tHCee13S7hioNUNMUD2Uh93ZQWcyETroPMgZ1vTlScZt5jlFZEhN7NLLUrjuovc6 npL8mzK48TRW6+SFDgYL/Hc+J34J0DYIbs+QB1U3l8Twsw86Nhr88JXXVcnFX749 tTvx4NWSeX9SUYWT7oDn3DvwbN6MLxI9g+XBer6Us4vXNY8Hm1FaBoKoYBMjU6DE BjJewqTmZh2KQeFrJr7wFnup3Vhid8GjWLaDUtty8k0YyDRyxklPCFQeaNUuT7/h YhWtc186QJTDTSsHRqHBg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeivddgfedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtugfgjgestheksfdt tddtjeenucfhrhhomhepffgrnhhivghlucgiuhcuoegugihusegugihuuhhurdighiiiqe enucggtffrrghtthgvrhhnpedtgfeuueeukeeikefgieeukeffleetkeekkeeggeffvedt vdejueehueeuleefteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegugihusegugihuuhhurdighiii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 10 Jan 2024 20:27:15 -0500 (EST) Date: Wed, 10 Jan 2024 18:27:13 -0700 From: Daniel Xu To: Lorenz Bauer Cc: andrii@kernel.org, ast@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev, alexei.starovoitov@gmail.com, olsajiri@gmail.com, quentin@isovalent.com, alan.maguire@oracle.com, memxor@gmail.com, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH bpf-next v3 2/3] bpf: btf: Add BTF_KFUNCS_START/END macro pair Message-ID: <446p3sgkjndfa45dqfy7a3nu5nfbczn55eazpkup6b46zi5vnw@eu7us32trhcc> 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: On Mon, Jan 08, 2024 at 10:59:53AM -0700, Daniel Xu wrote: > On Mon, Jan 08, 2024 at 10:14:13AM +0100, Lorenz Bauer wrote: > > On Sat, Jan 6, 2024 at 7:25 PM Daniel Xu wrote: > > > > > > This macro pair is functionally equivalent to BTF_SET8_START/END, except > > > with BTF_SET8_KFUNCS flag set in the btf_id_set8 flags field. The next > > > commit will codemod all kfunc set8s to this new variant such that all > > > kfuncs are tagged as such in .BTF_ids section. > > > > > > Signed-off-by: Daniel Xu > > > --- > > > include/linux/btf_ids.h | 11 +++++++++++ > > > 1 file changed, 11 insertions(+) > > > > > > diff --git a/include/linux/btf_ids.h b/include/linux/btf_ids.h > > > index dca09b7f21dc..0fe4f1cd1918 100644 > > > --- a/include/linux/btf_ids.h > > > +++ b/include/linux/btf_ids.h > > > @@ -8,6 +8,9 @@ struct btf_id_set { > > > u32 ids[]; > > > }; > > > > > > +/* This flag implies BTF_SET8 holds kfunc(s) */ > > > +#define BTF_SET8_KFUNCS (1 << 0) > > > > Nit: could this be an enum so that the flag is discoverable via BTF? > > Sure, makes sense. I took a look - don't think we can make it an enum. See include/linux/btf.h: /* These need to be macros, as the expressions are used in assembler input */ #define KF_ACQUIRE (1 << 0) /* kfunc is an acquire function */ #define KF_RELEASE (1 << 1) /* kfunc is a release function */ [..] Could do some redefines but maybe not worth it. The new flag is a pretty deep impl detail anyways. Thanks, Daniel