Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7840556rdb; Thu, 4 Jan 2024 09:12:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEHqz64Eb6xMSh04pz0ohanlm9Cp0EBvDsnwuz9wauCl7Q/mT1L9Evo7K3fy3EkICqzkQwJ X-Received: by 2002:a17:907:1184:b0:a26:c748:44e5 with SMTP id uz4-20020a170907118400b00a26c74844e5mr417414ejb.183.1704388355940; Thu, 04 Jan 2024 09:12:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704388355; cv=none; d=google.com; s=arc-20160816; b=Eoy8XeDJCWGwp7GyvxmnC9dTxNwcY7gICYo/2uwi5IYUG7fDTEBK+uYIoQK7Oab1kO gCuUfMt4qkdAiJy/Cg3BfuIoN+veWOoNQ3/mxFUe3I8TAX6/1QG5rvA8CSUk+zCyqsB5 x7h7vQxcSHCd4SfvbwI9Lohv1F739UgVUvLU8usENvU62CcAXf7+/Y5u5RI+7gpSOPoQ W/WHT+rcGZbomZ4YCNrFdbQlEdW+ThyzBLbhqPVZW4pRX4r8QYtAWXDZbErTESzRXnGf zjVQF+fKn5bpjugrxy3Wc3iEtF0P9sniWyD/YnoeP9blfVir0khnFYJxI9IOg+kouY41 foNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=sG8Bg4Obabo/M1F6Z0bcCE/ORgoAsgpcDvLFbC7PvC0=; fh=+KYAPySkEXT5V6bcfS1huIwWWvXx5xGEzr+N/KyWIKg=; b=GmDeAKFpDQ0H7sA0ZplGLWlSSMDu00Oa5vAUG69qcLh6KDRpM/qLMIcHP+iJwDJ8of 1ygjF2axiwweA9ueHXDib0xJ4SgXlMphKobv3N4/OF+GV3GMoj0Q6XKcDyD+2JbS6QLt M0MdoldpLWmNuUKGfBBYGXYE+1Zw9Kpy+IzlTF5w2Aq7P1+56/nFDTN4IyEXEqj8M/Y5 7uz3Ri8MZmHMbvWrEYG5+dcOmGDKBIFUfh2jICg8d3oMb+gvSErV8NLlUuX1snF5cWo4 qj0KLJdzeYHecfk9trWnOfcLx1ZsQFcaueWga5l2uX4JiFgj2XuoIa6Es2R4CbjhFDzO C/Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=G198+TT6; spf=pass (google.com: domain of linux-kernel+bounces-16990-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16990-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gh14-20020a1709073c0e00b00a26f5e238d0si8707243ejc.686.2024.01.04.09.12.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 09:12:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16990-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=G198+TT6; spf=pass (google.com: domain of linux-kernel+bounces-16990-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16990-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id AD6BA1F24450 for ; Thu, 4 Jan 2024 17:12:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 22D44288DD; Thu, 4 Jan 2024 17:12:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="G198+TT6" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C7448286A6; Thu, 4 Jan 2024 17:12:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-40d8909a6feso7002635e9.2; Thu, 04 Jan 2024 09:12:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704388329; x=1704993129; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=sG8Bg4Obabo/M1F6Z0bcCE/ORgoAsgpcDvLFbC7PvC0=; b=G198+TT6ZkGF44YR0ReYgh3GxKH1C1vlzbj5CoBo5runEdmXyo1aotE6IKZezRmp9v +GICWuyeRJED+mS3lJcD2TbczAsxGTc7CMDDsv/8awSadopBIEjRlAtw4YZIo7+6J/z/ 1sX2E+9VLYI23YoWnT3cH2HHlRSNH0+RBEMB/tR3bGP9Erf+4AbaN6CM64TkLliLL+IH McaAsY+vFmoAqIkWPI8VCF+Npf1EBBmBVJghpeiLaMj05Jw7FSED9SXjEPYs7j50SqmI CzgyeGLwq19rOTicBLLU0ZCJM30NESAoVjZNfakk8CICV1ReBKMESz2eBaClnLptGrl2 RoGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704388329; x=1704993129; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sG8Bg4Obabo/M1F6Z0bcCE/ORgoAsgpcDvLFbC7PvC0=; b=JYVoXPAeaEJ8XnzZwyXJVcyk3RcIPO8P8uRS7pkq7ab8FLdDij81T8/oq6Qk25fFiy gw9Jqj+LHqtf9O2L7U2DZjoUGQy5293jugy2uLqZXPPfzUBXKDKLKH7j3fyCdW1H2+B+ PPdUKDwYgu3WOjXT1O5SFdXr2/nRtJVNhyXPRDD3G4kodZnKa7GlgsirS5Qj5vOKIhBa 5Qd4vOE+zf1/TppdMV4nHJ7sPczE6Rrf46rRoZvNxtV0UfLd1vl3rb0gZJ2jxL+3tahk vjw2MC9X4SNjC7H9W0kKm2VejF9rgiIslBlWztP7+GsTHLN6mH2Tp6tyP+gYlqlZlW6l nqRg== X-Gm-Message-State: AOJu0YwlCW1a3nGP/uLRL6rc6KETgG/QoZU+YPgbLBl/8xT2iNYCYGFO IopLL4v6SXg+L+Jvw4AKsJIQUw4+pYnaBCYHVAc= X-Received: by 2002:a05:600c:21d7:b0:40d:432e:9984 with SMTP id x23-20020a05600c21d700b0040d432e9984mr385322wmj.176.1704388328704; Thu, 04 Jan 2024 09:12:08 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <29644dc7906c7c0e6843d8acf92c3e29089845d0.1704324602.git.dxu@dxuuu.xyz> In-Reply-To: From: Alexei Starovoitov Date: Thu, 4 Jan 2024 09:11:56 -0800 Message-ID: Subject: Re: [PATCH bpf-next 1/2] bpf: btf: Support optional flags for BTF_SET8 sets To: Jiri Olsa Cc: Daniel Xu , Martin KaFai Lau , Andrii Nakryiko , Daniel Borkmann , Alexei Starovoitov , Quentin Monnet , Alan Maguire , Kumar Kartikeya Dwivedi , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , bpf , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jan 4, 2024 at 3:23=E2=80=AFAM Jiri Olsa wrote= : > > On Wed, Jan 03, 2024 at 04:31:55PM -0700, Daniel Xu wrote: > > 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) > > I think it'd better to use something like: > > BTF_SET8_KFUNCS_START(fsverity_set_ids) > > instead of: > > BTF_SET8_START(fsverity_set_ids, BTF_SET8_KFUNC) > > and to keep current BTF_SET8_START without flags argument, like: > > #define BTF_SET8_START(name) \ > __BTF_SET8_START(... , 0, ... > > #define BTF_SET8_KFUNCS_START(name) \ > __BTF_SET8_START(... , BTF_SET8_KFUNC, ... I was about to suggest the same :) We can drop SET8 part as well, since it's implementation detail. Just BTF_KFUNCS_START and pair it with BTF_KFUNCS_END that will be the same as BTF_SET8_END. Until we need to do something else with these macros. > > also I'd rename BTF_SET8_KFUNC to BTF_SET8_KFUNCS (with S) > > do you have the pahole changes somewhere? would be great to > see all the related changes and try the whole thing +1 without corresponding pahole changes it's not clear whether it actually helps.