Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp8071648rdb; Thu, 4 Jan 2024 18:46:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IEwGwPdY49dweGFmLlWkIMwou9nkBe/Q8L8loAz513VywOgs9LQLQ8X3tifLKr7sr3+rbED X-Received: by 2002:a05:6a20:7da9:b0:196:79ff:b83b with SMTP id v41-20020a056a207da900b0019679ffb83bmr1928716pzj.22.1704422805146; Thu, 04 Jan 2024 18:46:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704422805; cv=none; d=google.com; s=arc-20160816; b=wJJkfVutBmy/o0LZhyPoXkbZJPpWTDPoEhH/iL7ThpDH0poEI4QidFVXNZ0d4T8MDJ jX1IfuG09O99qIjqQtO0vKs+SNpe1oMAezvqEXzbImVUwR7Quj4NHf8GgHLKuZj7shSt vE0ORJlrKl3/1gAYM4HUvwrS0DIfGBAPaJRaPBfsnVJ4JuMvMDedd05BG8zS1i4D3tg+ +ma+cW5683svbewT1dR86wdXhJE62D31mZIR2h24zRJU7BpB7MLvpRLKDlD0YXab3aMN zlhdyNKWxLkURser1/y2YYd5982B2SiFwC1DFEyvAJ+iQq1ux7GxklIc4lk0Z9Yg/txD jS6g== 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=xLAZerEvAK6EzMXZEzB215DZ6mnFlGaQNMg2EFepO7o=; b=Em6fQIZYXE3PnAZe/kQOfdBqndn3Ef3F++B4c+opm0A2S2Nb5VU7h3tcxeJutHDAmF T9nUy+veqzipNd/Z5BdqzabOSlWSXShgc0EZwuWdGW0Xsfept6L2b5ibXcu8mrB+NKF6 nqrFk/PmVpQvg77B1l80FxPF+k4V87UHPAK+lA5wIR4uuPn+ujWB+zHjp8nCeu2cdq1N 5jlj2Zor0747Eq777vJ9UNSi9/DvzXwVzXmtx8I16+fW+2dHOZsSW0JNB+ol+aXi0cab 98di1BI7ag7AUdUjMi8FMzm3bAcCSdzUwAoDF0IAS3sr4uOPJnvrE3RjTh5KXbXBq4R8 RzSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm1 header.b=EIE6ATEG; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="Kaxu/wsO"; spf=pass (google.com: domain of linux-kernel+bounces-17433-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17433-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id fb36-20020a056a002da400b006d9af1fcfbbsi541713pfb.114.2024.01.04.18.46.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 18:46:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17433-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm1 header.b=EIE6ATEG; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="Kaxu/wsO"; spf=pass (google.com: domain of linux-kernel+bounces-17433-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17433-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CB768286541 for ; Fri, 5 Jan 2024 02:46:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23C225396; Fri, 5 Jan 2024 02:46:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b="EIE6ATEG"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Kaxu/wsO" X-Original-To: linux-kernel@vger.kernel.org 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 31A9253BF; Fri, 5 Jan 2024 02:46:05 +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 compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id D38333200A95; Thu, 4 Jan 2024 21:46:03 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 04 Jan 2024 21:46:05 -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=1704422763; x= 1704509163; bh=YykKmLIXmxhMLgQ+f77GEqZqd2U6B5FrHdnh5gln6Jo=; b=E IE6ATEGmyTBXZrR63xfrAAqeI8pw+kajZc8gzv2+9B2OucizK+i/tyMMieZ8/+3k dgV5GFvx1bVhBuajnW6/ZSpzSHes/q6SDhP6LpthpXiW3c+IRUz/fElngp86/0dl LSztHp/v5wXFMYI40Si6FslMS78krPjWgR3HzGG6vB0YRgI1eCXy2fFa/yXlTT8L NX6ftJeNxZkOMm0/bhwaj2QKGTuAf9XoDhotG5MouSYwqvDYaaLu9iJNCaAsRd2G u0VfmuGZJYFxW8FPIu6+KSr8lWYnLPRyUe3tptxRJKnXCWBgSDWesY61PpvmNP/X LfMAhaG8nhQQs3CdD5xig== 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=1704422763; x= 1704509163; bh=YykKmLIXmxhMLgQ+f77GEqZqd2U6B5FrHdnh5gln6Jo=; b=K axu/wsO//7RwXaakowSQvDQC/RD7jM8bWNvLfsR/wLX7hitfEqM9ivE4LlbRQVCU gfQptD/lm8S8onc6UT7qoXqitb/isJwEc8y8dhAiZzZxRNhXFGzr4QiEFWGq8OPr otCc7C46BmU9TgX8lIbwIMM+7qElnDc1NawEyQtcWhGjIfN0vm2sDsAjKSLEp/RT irfB07iuCUzQNR4dnrJ5OdoaSv/xMdHtugkf+UaqFlOXAuGIcqeM32IoO7FEHJBf ruaRmxbLW7A6LwQBUqVpw+5NeJUkzy6xEtk+SOSBn/HfAU3nxRMkWvHpt1rtcNhc zqn1bnVTyoFFtNr+r3ROQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdegkedgheduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpefhvf evufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffrghnihgvlhcuighuuceo ugiguhesugiguhhuuhdrgiihiieqnecuggftrfgrthhtvghrnhepgfefgfegjefhudeike dvueetffelieefuedvhfehjeeljeejkefgffeghfdttdetnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 4 Jan 2024 21:46:01 -0500 (EST) From: Daniel Xu To: martin.lau@linux.dev, daniel@iogearbox.net, ast@kernel.org, andrii@kernel.org, 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 v2 1/3] bpf: btf: Support flags for BTF_SET8 sets Date: Thu, 4 Jan 2024 19:45:47 -0700 Message-ID: <2204908a80467a4ff624fa250fbdb853dd829145.1704422454.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