Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp126023rdb; Sun, 28 Jan 2024 17:25:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IGw8BJWJGJOvJdJgLZgr5Lepuw1plV0VN19s5LzsARp/aK4o5vhBydyElSpXDnzngmUqWGl X-Received: by 2002:a9d:6c45:0:b0:6dc:386:a263 with SMTP id g5-20020a9d6c45000000b006dc0386a263mr5727690otq.51.1706491538790; Sun, 28 Jan 2024 17:25:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706491538; cv=pass; d=google.com; s=arc-20160816; b=eoqScG2P1dsn6YlkHH04pwwMo/bVCEx52681pindIJw4jL0UJF3eVyGZiersWbpQiI ITpD7fi5JWih3hXyuZK3ywLi1cYYMZ8aAzeeSgZrY45/Iu0EPxsADtZb3Jz+vVREvHmV DDpM8XvcVp6e0criOTZhOjyzTsBlykfWQmqiAxZQPjl1XcznraxeC3VANewmctudkaJT ncbyCz1n5ornRl26yb0NrAdIpddOTETfWQjYc8pxPJDmZN3J+6YT4EP3RWsaMRAdYEqo uymegD9sw738E/wDbhb30zXIsm/djh+9gyoZReWdJskegmOrykOlaDkQym5VDQeyZNuL Jbrg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:feedback-id:dkim-signature:dkim-signature; bh=YykKmLIXmxhMLgQ+f77GEqZqd2U6B5FrHdnh5gln6Jo=; fh=Jw2KTs/RQtcWswZmSaZdTEIcjfPfgX/bPGJZxFViSZk=; b=EPMMHb+HXuxbrJOm/nxjTL1LsRbXTGWGW+i+VHj0hFocXFKiw85ZW/3CzT7wMcOnez 0NHWf4FJrXjnJbm+IoaTYtQr0a4bYMZP/utyT/P7g1vaXsOvgQlsmj/LHkrVTLWVT5am MjbzDigNvLNrBMeQR9faHeTvM3hmizRgUWJQ/G9BDBgO4LOkLaP9Kln+/EJvAJGpbWuW ISm3u9LZ58S3h4xnn3W8UwZc4Xhq/1Wzz8eMsDyRliehTKZ4+1FNGTj4cLm2bhxJockJ CO21ZO57xcPiEn1IWlNrUxnmPVIiOBU2fy1+nmLOjOEMbVWlWvDRYXg3xkMQ5/yvGyxc r8Qw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm2 header.b="sgd/t7OW"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="PA/2+nPi"; arc=pass (i=1 spf=pass spfdomain=dxuuu.xyz dkim=pass dkdomain=dxuuu.xyz dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-42056-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42056-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id i63-20020a638742000000b005c5fe04e4eesi4635591pge.852.2024.01.28.17.25.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 17:25:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42056-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm2 header.b="sgd/t7OW"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="PA/2+nPi"; arc=pass (i=1 spf=pass spfdomain=dxuuu.xyz dkim=pass dkdomain=dxuuu.xyz dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-42056-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42056-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 E759FB22BAF for ; Mon, 29 Jan 2024 01:25:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 077EBF9F2; Mon, 29 Jan 2024 01:24:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b="sgd/t7OW"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="PA/2+nPi" Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) (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 76262E55F; Mon, 29 Jan 2024 01:24:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.24 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706491468; cv=none; b=S05uTPTofPeOWgn+rsh3EGfborZpRNRrhpUsR7YkjVgLqQdPUSVjaDAtrz6joDIjqyjQsbUj+MLBPy96FKEOEgNi8Wl+iwIB0SVznWZkYwc5Rnoqj4X/AotMLl2OoGL5ETvUQaiGpj8QfWt2PoK/iPCpBHF4+QcV0ajTur0iAew= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706491468; c=relaxed/simple; bh=xu08oOgu2AJms3zybGKx7jyoSa03WTp6V9NSRZ9nLoM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iRVmH+QLgOYJNkLgWmQn2bg5x9h7H1ddJr4m12m2RVkaPlhEVC+1oBtf8Kv8E4wEbNcsLktoAQ4eYwlfEgMz0C6Rq1peQaxmDlHrRPG/vYrobgUvQCKuCeh5DX23l36yE1fXyXallA7p9WdcfwP/t7N4NIbpQOdDWgt80UQmMzg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz; spf=pass smtp.mailfrom=dxuuu.xyz; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b=sgd/t7OW; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=PA/2+nPi; arc=none smtp.client-ip=64.147.123.24 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 compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.west.internal (Postfix) with ESMTP id DEC9F3200A9C; Sun, 28 Jan 2024 20:24:23 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sun, 28 Jan 2024 20:24:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1706491463; x= 1706577863; bh=YykKmLIXmxhMLgQ+f77GEqZqd2U6B5FrHdnh5gln6Jo=; b=s gd/t7OWXBIGfT7HqLSeAH4847bD0qPwzvScZ6CDBqoIz2WVQjx1ArU6nyPmrtGLC IFw0TT5in/BIpRBiNUXP95KuXl/5bTpfQyvwOSDnDb2nlb81zXV6VIe5z//rryJh puikUYmtEpBsR96MHMcgm75E255n4bloOXEejPaRqusqP2XdANPw2esLU5dkVBAn nhmuqsAPRb5Rci1hKPAG5kqX3Aw6HxG4s+RqhFzCa1lk2mQ2mI/UydbC02HKnRUZ iEDm1ua/hNFwDgPFR9gaEc9C1YnCjExeGnXKgq78bSbMMLi6xFFJBO7De7ZYztjO e4JSUV+lD/fXDPK3JHliA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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=fm3; t=1706491463; x= 1706577863; bh=YykKmLIXmxhMLgQ+f77GEqZqd2U6B5FrHdnh5gln6Jo=; b=P A/2+nPiHDlQVmSm7V1kSuYaAu9EBsXiJHF/XJN+sAzlr7d+9IHiTjYDMDf1Lzqp2 zgVh6RPFPgfD/j57WJY0ofW4Y2UbcSNbujsePfg6YjGN9+ZRYX+duxwHGUnWFoHR IBBtlOs+o83Sxa353AjHU+A4HzcNXF/6zAJryGQAHEOxSux0XyI/z5hkLD8I/8qF 1R8R/BR8j/Yi7AXeDQQDOfk11K1ZwIsAX7IvIY+bZWGiqny+m5JamJdb//7NnWst ednsOVZ8nrvqY0ZyxHbjb5lOMqAZiA0X5nW5wdqkZZ4bAS51MYtUDeVue/zHIJTQ SXrZ9SKqKD09NZAbxhUUA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfedtfedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpefhvf evufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffrghnihgvlhcuighuuceo ugiguhesugiguhhuuhdrgiihiieqnecuggftrfgrthhtvghrnhepgfefgfegjefhudeike dvueetffelieefuedvhfehjeeljeejkefgffeghfdttdetnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 28 Jan 2024 20:24:21 -0500 (EST) From: Daniel Xu To: ast@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev, andrii@kernel.org, alexei.starovoitov@gmail.com, olsajiri@gmail.com, quentin@isovalent.com, alan.maguire@oracle.com, memxor@gmail.com Cc: eddyz87@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: [PATCH bpf-next v4 1/3] bpf: btf: Support flags for BTF_SET8 sets Date: Sun, 28 Jan 2024 18:24:06 -0700 Message-ID: <7bb152ec76d6c2c930daec88e995bf18484a5ebb.1706491398.git.dxu@dxuuu.xyz> X-Mailer: git-send-email 2.42.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This commit adds support for flags on BTF_SET8s. struct btf_id_set8 already supported 32 bits worth of flags, but was only used for alignment purposes before. We now use these bits to encode flags. The first use case is tagging kfunc sets with a flag so that pahole can recognize which BTF_ID_FLAGS(func, ..) are actual kfuncs. Signed-off-by: Daniel Xu --- include/linux/btf_ids.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/linux/btf_ids.h b/include/linux/btf_ids.h index a9cb10b0e2e9..dca09b7f21dc 100644 --- a/include/linux/btf_ids.h +++ b/include/linux/btf_ids.h @@ -21,6 +21,7 @@ struct btf_id_set8 { #include /* for __PASTE */ #include /* for __maybe_unused */ +#include /* * Following macros help to define lists of BTF IDs placed @@ -183,17 +184,18 @@ extern struct btf_id_set name; * .word (1 << 3) | (1 << 1) | (1 << 2) * */ -#define __BTF_SET8_START(name, scope) \ +#define __BTF_SET8_START(name, scope, flags) \ +__BTF_ID_LIST(name, local) \ asm( \ ".pushsection " BTF_IDS_SECTION ",\"a\"; \n" \ "." #scope " __BTF_ID__set8__" #name "; \n" \ "__BTF_ID__set8__" #name ":; \n" \ -".zero 8 \n" \ +".zero 4 \n" \ +".long " __stringify(flags) "\n" \ ".popsection; \n"); #define BTF_SET8_START(name) \ -__BTF_ID_LIST(name, local) \ -__BTF_SET8_START(name, local) +__BTF_SET8_START(name, local, 0) #define BTF_SET8_END(name) \ asm( \ -- 2.42.1