Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7411303rdb; Wed, 3 Jan 2024 15:32:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IGm76UybzJD3uL52DnM4633+J01AV81TJbKe9cqGUeycYzPaMeFoGl0hqAtDFfi3uN1Osgu X-Received: by 2002:a05:6e02:3105:b0:35f:f02f:92d5 with SMTP id bg5-20020a056e02310500b0035ff02f92d5mr18873373ilb.63.1704324767919; Wed, 03 Jan 2024 15:32:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704324767; cv=none; d=google.com; s=arc-20160816; b=y0cKh2EmYpcRlh2p2vRN2EBwsHNXGVIPVbJBpsoHhY2q7/3h2Gx3wiVO7OmOSPfBYz kBBH0hX+PIL4HL5dzkBwzSanNU/C/hhkK5JRZGVVCXFI5uYyO8KCOtIavw9asvMO+R6K PiXeheKq3n3qlME25HxwaXlu0boRmPpB6aoxR/EBYR7FnC2Kd9GY5UifnBnjrsWhc7xD Y/SgIQYco7hFFlTye244pKcLBNu6idiYjiRVBLEqSnJAiiQMBQ5WxuuzaNfbLz8kowFo J4vn76xZESbWKdKSYXlDjW63OqW642GFQU3D2nTecoKfbjMbtOcqgIiWRB6IkiYaLux2 3U8Q== 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=i0jWCLIezpev9R+cDRwirQ8/iwCGPwmflSvPoBzieNo=; fh=GTVp2BiiLQLe9apkE+FvToYSmBhW20wwwpo3bV4Hh1A=; b=Xqiy7MImYlrZ6vd1RHWBoUMXhE3YplprYvnfSz8k97FSITeJcyNS4A8I5GK5qI18qH IF1lUUKDjSEMIEq+4J1ajCo4TPqMoNkayrw4fJSR0GYornrQr0sYSSJNjWXb4Pc7srRc l6EjBsxcYNXR6EjPoLw9MyxLQCpHB1sfPTx2SGIGSTGq1EIU1pPbeM81ouyEK1jg5Z4F EBUnQpT05JiixjF3U3hn6TZ41ck9TdJxYLlJ+AieQZDSmAnsNc3/MnMftwivXr815l79 3R0NZOKZJNe5lmvjBePJVo3jpu3yLGRZvhdvMZthvBf8td2pH6+uf73w1unGB1LwnLk/ ILXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm1 header.b=l+slDank; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Die2gcWQ; spf=pass (google.com: domain of linux-kernel+bounces-16122-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16122-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i15-20020a6561af000000b005ce0767c9d2si18545557pgv.582.2024.01.03.15.32.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 15:32:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16122-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm1 header.b=l+slDank; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Die2gcWQ; spf=pass (google.com: domain of linux-kernel+bounces-16122-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16122-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 7F273287D62 for ; Wed, 3 Jan 2024 23:32:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9F00320300; Wed, 3 Jan 2024 23:32:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b="l+slDank"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Die2gcWQ" X-Original-To: linux-kernel@vger.kernel.org Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (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 390B8200BD; Wed, 3 Jan 2024 23:32:15 +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.west.internal (Postfix) with ESMTP id D9E903200A0C; Wed, 3 Jan 2024 18:32:13 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 03 Jan 2024 18:32:15 -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=1704324733; x= 1704411133; bh=i0jWCLIezpev9R+cDRwirQ8/iwCGPwmflSvPoBzieNo=; b=l +slDankOsknDwjTs4ZjNniNwpGQB7FN37BL73TBSudXF8QIiYJwvXd4k1hmznStP RoXAwFM7tYYYRNeLLIhS5+OBCT/S6mMkRIl6nDldSrn+E/Qq6NEsGbk+AAzradmq 5iux/6PgupCScZULex5/CUH3a+3gewgp4SvB72nKC2gUsGQYWEXCD2R8t4+w5g3S jF/JMZKnThiXfI4VItb9Nzb9kziKIMAVVmu1EpBXdB3d5XiEXjd56l8crJtkwltO 05P6km6h2PrYM8YKW4CbS80hvKHeHr/9empTiQr+5xpCGPBoIYAScnjr6AQhux2G S4iw4mFV2Bm2KmsQ4DtOQ== 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=1704324733; x= 1704411133; bh=i0jWCLIezpev9R+cDRwirQ8/iwCGPwmflSvPoBzieNo=; b=D ie2gcWQDDYLw7t/kG/AhIFmM8EotrufLzeIefRYJfL21ikSo5A5Nt5hsBU1KuyFX WOw/3gDoxde/TDkzKKwwHniLk/xOa09BSsCXbUrvhG6U/xsLPYBtgxpWFGEYnFN4 kEAac6RSD9S+KhHxfX9aIunUwk5QmtUacZ+6sl1Dj78UDwmwgk1ZRVW6f5+fy7oj mh2a0LMcwUSmdf4mhDGhab3vX2eqpmpxdAxNIoHZAOAfLAS/gddpTuKZ6EHpG5+I Xhs0Pt2zmJv964QUWwdqM+iZpmFYKI9BL/Mlm4MqQLtIxEAC7iOs1qiunt34JLmd hfp+0audtJ5FLKNujJKSA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdegiedguddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpefhvf evufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffrghnihgvlhcuighuuceo ugiguhesugiguhhuuhdrgiihiieqnecuggftrfgrthhtvghrnhepgfefgfegjefhudeike dvueetffelieefuedvhfehjeeljeejkefgffeghfdttdetnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Jan 2024 18:32:11 -0500 (EST) From: Daniel Xu To: martin.lau@linux.dev, andrii@kernel.org, daniel@iogearbox.net, ast@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 1/2] bpf: btf: Support optional flags for BTF_SET8 sets Date: Wed, 3 Jan 2024 16:31:55 -0700 Message-ID: <29644dc7906c7c0e6843d8acf92c3e29089845d0.1704324602.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 optional 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 next commit will tag all 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 | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/include/linux/btf_ids.h b/include/linux/btf_ids.h index a9cb10b0e2e9..88f914579fa1 100644 --- a/include/linux/btf_ids.h +++ b/include/linux/btf_ids.h @@ -183,17 +183,21 @@ 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) \ 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 " #flags "\n" \ ".popsection; \n"); -#define BTF_SET8_START(name) \ +#define __BTF_SET8_START(name, scope, flags, ...) \ +___BTF_SET8_START(name, scope, flags) + +#define BTF_SET8_START(name, ...) \ __BTF_ID_LIST(name, local) \ -__BTF_SET8_START(name, local) +__BTF_SET8_START(name, local, ##__VA_ARGS__, 0) #define BTF_SET8_END(name) \ asm( \ @@ -214,7 +218,7 @@ extern struct btf_id_set8 name; #define BTF_SET_START(name) static struct btf_id_set __maybe_unused name = { 0 }; #define BTF_SET_START_GLOBAL(name) static struct btf_id_set __maybe_unused name = { 0 }; #define BTF_SET_END(name) -#define BTF_SET8_START(name) static struct btf_id_set8 __maybe_unused name = { 0 }; +#define BTF_SET8_START(name, ...) static struct btf_id_set8 __maybe_unused name = { 0 }; #define BTF_SET8_END(name) #endif /* CONFIG_DEBUG_INFO_BTF */ -- 2.42.1