Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp819864rdb; Sat, 6 Jan 2024 10:25:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IHYdEzi8Epe+dzimdnPtcNDLfvxtbE6hJtuijPGXtSy3GuLMR/D+uzH3Ua34Fi9o31Zy3+T X-Received: by 2002:a17:90b:297:b0:28c:ea35:2c8a with SMTP id az23-20020a17090b029700b0028cea352c8amr1438174pjb.49.1704565526538; Sat, 06 Jan 2024 10:25:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704565526; cv=none; d=google.com; s=arc-20160816; b=ACtpHFhKUmUX6A2fj2J6bI76NZjwedJx1+1v/Zk+Bjn2Pzuz32VDvPMcfwgkTL3dM7 XLf0IMbQcS77/SKqrGudkfz/55Ip2lU3C6b+Q5T8h6jqxIOlIpRypzdTiMin7ZmdCz4A wQTUB/nCxVDYq0cBbQ7/7Y6gHlAFuBVHuSwP6KQcku6fDr4uqsnXoVcNrrof7uG6bOYA U6sj6yV2lPLJ6CeJJqCBi97SXjqz2Se9thR2HfAzddjHSEOwlUTX61inMTGTBCIld6Cp eTE4rKfRdtA+XiCJlRCuRZsXt7gRXd06UR2uZM1DB+mN19mBQYVtRi44a8mlsfDPKhSU pQkw== ARC-Message-Signature: i=1; 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=IVCGZ75Ua7FCFN20ntm4jreBBImEAAQ1ZgZeK7PHj2g=; b=VfLLhDYKeKMvGA7wIVZVTSfBlv4w7gOwXCkzefEsZRxvzqtHCQFa79hHm/Kry4aTDp MdE42/HhT93OcpdnX8jeuWd6Naz5LLM4rrhJGS5HKv++fsBRv9IJmL6m93ZgcPa+kLyv VUxofjFcNEl67m60m4UsOrjUqIW7ls89axQ9vRSEBy9ACMblrL9Cn3atDJ816HJ0rXCf zWuerM10J3u+9Bm6G5wTvwyjKilqu9b4V8gos9XXoD6y8acyjX5C8jUT6T2L/3wgkAkv kj5cYyoaU5rK2ay9f8ecP6MZJ5nihBhWSDH63KEPENL8WCtBakVvIuhv+QDxNmHFluis UDTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm1 header.b=YeV3Et35; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=7PBUg0pB; spf=pass (google.com: domain of linux-kernel+bounces-18689-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18689-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 bb8-20020a17090b008800b0028ce652392esi2909085pjb.142.2024.01.06.10.25.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jan 2024 10:25:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18689-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=YeV3Et35; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=7PBUg0pB; spf=pass (google.com: domain of linux-kernel+bounces-18689-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18689-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 4E2ECB224A2 for ; Sat, 6 Jan 2024 18:25:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26980E568; Sat, 6 Jan 2024 18:24:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b="YeV3Et35"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="7PBUg0pB" X-Original-To: linux-kernel@vger.kernel.org Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (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 A4220C8EA; Sat, 6 Jan 2024 18:24:52 +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 compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 998425C0200; Sat, 6 Jan 2024 13:24:51 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sat, 06 Jan 2024 13:24:51 -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=fm1; t=1704565491; x= 1704651891; bh=YykKmLIXmxhMLgQ+f77GEqZqd2U6B5FrHdnh5gln6Jo=; b=Y eV3Et35OesYXbw0w7RlWp3SriEYbHjidZotJhukH9d9W0AYnQY/YQ5KZk0dT4LOr cdMJGI3+7joYiyG/9Nq6eWZB9KHZR+Bi/6rfjLMs6rcl/U5I2GaKWdHGpkj+XxqI v0DaslPanzpS/EYI62sy/uqwtX499IFvXQA/KImtms/cn62kuMPHyHuBktEMJWNq tyYgt7ZxvJ1FldeFTwfLUcBD2f6FpikfdzdAi0Q/ISBpWxbnNGBioTvISbNuEbO1 gx+UJi01UFFdDJnXQaEI0pVyE9jXs+vqYYo+k/L1/RO2ZB84ZV0V4+Hj/+JSi103 l0+r+ZKfY6O1XZqhvzYBg== 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=fm2; t=1704565491; x= 1704651891; bh=YykKmLIXmxhMLgQ+f77GEqZqd2U6B5FrHdnh5gln6Jo=; b=7 PBUg0pBGhefK2MM2HY8PCDppQm8l3AZh4oRTr1IX6zmhAeG2aJlMk1t5RV12r4gX yrFDdBSfN0OqrwH67+ZJtxD6y1hBfYxYS364FNGfZE13AMyOOCj9cvNznjkGv3bl CE9ns2OlbaxeO2yTiaytfNjpMWmwCmwU+izpYZppN4usd3ZTTwi/4YG00cT0vvnW s4Y/Mrv/Pv7Vx/IizVT0maNeIudn03kRbH2nLKyoaNT8KzmpJotOo5fGt+xxTs/6 iukZpsahTKXdxWZ5ANoqrXhRn/DnvmjVetKV+bGOyFBgfdNNeZvg/imrhmZZIArL fkgL2hboMKsPuCjGYhj2A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdehuddguddutdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdejtddmnecujfgurhephf fvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepffgrnhhivghlucgiuhcu oegugihusegugihuuhhurdighiiiqeenucggtffrrghtthgvrhhnpefgfefggeejhfduie ekvdeuteffleeifeeuvdfhheejleejjeekgfffgefhtddtteenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegugihusegugihuuhhurdighiii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 6 Jan 2024 13:24:49 -0500 (EST) From: Daniel Xu To: 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 Cc: 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 v3 1/3] bpf: btf: Support flags for BTF_SET8 sets Date: Sat, 6 Jan 2024 11:24:08 -0700 Message-ID: <739b320eb08b15044a1f9e8675d6a22227f6af22.1704565248.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