From patchwork Mon Aug 26 22:48:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: JP Kobryn X-Patchwork-Id: 13778651 X-Patchwork-Delegate: bpf@iogearbox.net Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 DA98419DF8C for ; Mon, 26 Aug 2024 22:48:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724712516; cv=none; b=HCIuaXU1o2/WbMYcnKDLcNEuTbarLy9Ry14+5Y1ySY/LA0C5R//jUpGM3JjXDLD/NucWPCMsVOMqgjy/mhA3Mis0dKzNO1wMT49YZ4BTFySK24Hl2FUlK7zpxw2ZqvekcIJUgRDspwCkpjpFIlB9ylNLqIq0Qu+QANtcmfahzeY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724712516; c=relaxed/simple; bh=5NwOudOFWnXh4lyHo42+i2xGtw4JYG8ZrpilEYzj5+4=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LzfygDuxrWnq9St3aOPDDv9BbYLEb2/8BV4/TKGmIb7CgYQuqRmGMunRGGlfTifVbEGvH1f/3s50LSDmrjNz5VCAJleyZxZxW/LipWIDW57Y6dGMnKFDxT9otl+WxZTIhLrI3z35vkwGDppFk6+bS+3fq0MORXN91qvUOMDTTSo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PkJ7MI9G; arc=none smtp.client-ip=209.85.214.182 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PkJ7MI9G" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2021c03c13aso36138015ad.1 for ; Mon, 26 Aug 2024 15:48:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724712514; x=1725317314; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=UfjT7GSOtZtNnx63ak6Ir9XNZzCuHiDAsgy7qozHdxI=; b=PkJ7MI9GaZ7pwBebPxGItMcEmzzRsgmy4kLCnhIrKq7WEbJu0zBcnD9TpQyxyqWok6 ZunoWja2IdZfxXqq+uAYvnEmSJAYTiFdEQaLkSogAnRhJGfWe4qhEhhhIDLaVMZqSNYt P+6rkr047EXsgscpXSnw6Hp9+aXsSlmi0iEahWGyh+sEuRYTEx2q2CqTPrhpPtVyEjuR jdORKvCqM1sYKE75qrIRjFsvilV7snPjsnuqL0QrUlpowDWM7pFIqtyihhPGfF06DCLx hAsy04EHv8RW13lRlWpdOoNs8uCaOs7cPdttdZyjWFuobqt0PrYeqLTnUBQH1OrJjtot wEeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724712514; x=1725317314; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UfjT7GSOtZtNnx63ak6Ir9XNZzCuHiDAsgy7qozHdxI=; b=aKZ6aeYxPHgEE2dJ7dNGIdmuFaU7pzRhtxbGAtKdZXFU66ZhoJYptujH9sVEW8UJcZ TsDsa8gpcwZKevPifH2pTBOZKXgG6gf9ly11DtJo27VeRp4q+KBm10wBUI3LMQC5dLo2 PFNxiniKg8R/HrJ/JiW8T5FiXdC7nGOgzraPJ5g6pqZuioGg7ZBsIuI96hsKW01dLaSA P66YMNBKE4XcQt9YC3fUUAZI6NDRQIKM2DEcKSNw1n520g9EPahbzjq1fda7rjQVvik7 HSM+ukt1kusjQi78QreNJrx2P1Fs5KhHsdFBHLM9VOIIvyGocs9c5o9T60lCm6WqvzWA e19Q== X-Forwarded-Encrypted: i=1; AJvYcCXrEcMlNG+J58GztdsVb3nqZ67jLrA70yEVt7/Zgndm9kCN3QhCSNEmHsqumWn7KixQqYs=@vger.kernel.org X-Gm-Message-State: AOJu0YyqU3Zq3/Ov9PwR5/5ZxFHIitAyirDsO3YC7jH6SJsOeVkbVAd5 036eWscA2TW94ZfL/ySEtUHCI4cOkKHT1zzMMpuK/cXqMzH98lvL8NksVA== X-Google-Smtp-Source: AGHT+IEtLkUmGEYfqFGSZZpuxNSnBH6qQzp8UXIY+nHkTyswcJqTVoBxomOtGuTB+OVvEGyXYNHl7g== X-Received: by 2002:a17:903:22c3:b0:1fb:80a3:5826 with SMTP id d9443c01a7336-204ddcba3e9mr17171685ad.4.1724712514076; Mon, 26 Aug 2024 15:48:34 -0700 (PDT) Received: from saturn.. (c-67-188-127-15.hsd1.ca.comcast.net. [67.188.127.15]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-203855808a7sm72128895ad.72.2024.08.26.15.48.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2024 15:48:33 -0700 (PDT) From: JP Kobryn To: andrii@kernel.org, ast@kernel.org, eddyz87@gmail.com, bpf@vger.kernel.org Subject: [PATCH bpf-next v2 1/3] bpf: new btf kfunc hooks for tracepoint and perf event Date: Mon, 26 Aug 2024 15:48:12 -0700 Message-ID: <20240826224814.289034-2-inwardvessel@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240826224814.289034-1-inwardvessel@gmail.com> References: <20240826224814.289034-1-inwardvessel@gmail.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: bpf@iogearbox.net The additional hooks (and prog-to-hook mapping) for tracepoint and perf event programs allow for registering kfuncs to be used within these program types. Signed-off-by: JP Kobryn --- kernel/bpf/btf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index 520f49f422fe..4816e309314e 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -210,6 +210,7 @@ enum btf_kfunc_hook { BTF_KFUNC_HOOK_TC, BTF_KFUNC_HOOK_STRUCT_OPS, BTF_KFUNC_HOOK_TRACING, + BTF_KFUNC_HOOK_TRACEPOINT, BTF_KFUNC_HOOK_SYSCALL, BTF_KFUNC_HOOK_FMODRET, BTF_KFUNC_HOOK_CGROUP_SKB, @@ -219,6 +220,7 @@ enum btf_kfunc_hook { BTF_KFUNC_HOOK_LWT, BTF_KFUNC_HOOK_NETFILTER, BTF_KFUNC_HOOK_KPROBE, + BTF_KFUNC_HOOK_PERF_EVENT, BTF_KFUNC_HOOK_MAX, }; @@ -8306,6 +8308,8 @@ static int bpf_prog_type_to_kfunc_hook(enum bpf_prog_type prog_type) case BPF_PROG_TYPE_TRACING: case BPF_PROG_TYPE_LSM: return BTF_KFUNC_HOOK_TRACING; + case BPF_PROG_TYPE_TRACEPOINT: + return BTF_KFUNC_HOOK_TRACEPOINT; case BPF_PROG_TYPE_SYSCALL: return BTF_KFUNC_HOOK_SYSCALL; case BPF_PROG_TYPE_CGROUP_SKB: @@ -8326,6 +8330,8 @@ static int bpf_prog_type_to_kfunc_hook(enum bpf_prog_type prog_type) return BTF_KFUNC_HOOK_NETFILTER; case BPF_PROG_TYPE_KPROBE: return BTF_KFUNC_HOOK_KPROBE; + case BPF_PROG_TYPE_PERF_EVENT: + return BTF_KFUNC_HOOK_PERF_EVENT; default: return BTF_KFUNC_HOOK_MAX; } From patchwork Mon Aug 26 22:48:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: JP Kobryn X-Patchwork-Id: 13778652 X-Patchwork-Delegate: bpf@iogearbox.net Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) (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 2312C19DF81 for ; Mon, 26 Aug 2024 22:48:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724712517; cv=none; b=Anyw+JRINTB/rb7Ir4NBHHfIRFR0B242ZFd2DxocbAOllDbWw0X4Jeppw4XMPNGHCbzp+h30SHssNfyaP2qpniozn0jerShJ7c75/clQSD1iYjXbhGXgKWg/do1W82nT3DWcAqNeimRKhKuTqZCuYq0QWXGmVxhOHhl3K4Ew+/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724712517; c=relaxed/simple; bh=9xKlfpFot22U5gqjjQOK2mI3/7fvoUTb1ZrOuqiYTFY=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SuCNas45U6+7LhoXqFY+8+xpdQEFJn1mzZGt1HLRlQR0GJj9Hx+ZwNsWlx7qsbh34LkLaZRPj5PM7ZZSgdfYu61j5TaheCPa+ZYg0JDSG7nxuVsmcA9pOBdSgdJ+b9Y0N2q28ucFba41o7tJiRr30gAQlV+Zz9maRht4xlIAKXc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TXZhNSwj; arc=none smtp.client-ip=209.85.215.176 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TXZhNSwj" Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-7cda0453766so1533352a12.2 for ; Mon, 26 Aug 2024 15:48:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724712515; x=1725317315; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=3NpR7sn9OYZ2aPx0CXsAWfuEcgGzMBxKsHHcmLUzgHc=; b=TXZhNSwjM+ikX0zU7MVE0kRs1bCSX+Xsr1jwrdoIxz0p2IrIiE/z+Wpl5J3XJ1lNEx pGWgMqBIDD0bgCCGFDCwEitpwO85I9b3CprIkRL1hm9isKiODYFanjY0rU6BnyTYSEfZ dTy4eEaL9RsQIxAsr+ua88xgpy8iNLZcukGzLyFoUO98/rA1z8eRKkUSF0T4PMfY/rnM 0vYA5LYUIOptelzlFU9RtqJpHoDhc2xbr3MnPq0W9ANVzO7M2w/lnJTr4ppXCPBIl0Ss SPTL3kMYHkBgAMDQVfnNol1IXRYo9Gq13XCd0qR5A3WNZb9Lm2zZwkUhpBdQAUWBL5Nm J4jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724712515; x=1725317315; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3NpR7sn9OYZ2aPx0CXsAWfuEcgGzMBxKsHHcmLUzgHc=; b=MES+DuMAMnayGMbCMvyc1HuDVrx90DeTziADGp51mrRiGK7/bGpC9pP3HzBKknlcbD FrlsggagT+yITTjGrVryqYHAxob5TVcWssBD9DbWIC2HkGo3HuAD4siV/150tOPxg/Ec foR6ao9Z5h0yJQXxzT9QzytHWOxl4bFJmN3beyOTnVV1n1KQA1Rj9i6ywAzR8KIJaqFt L6/thnfixDZiSwIBOA7ctJlvnyTP2WNVAFDDRedxtKaqF1A+Zdgdqs444ftZONbvlnWw NLS2/LUCUTllY1IsNuNSxE7HVBIWr3aP1K7RP/WLg1imKlaDQrZk97BgrOUiLw4JQoWc 0Iiw== X-Forwarded-Encrypted: i=1; AJvYcCVolU/On0qthDSHOrQ4w34AlfBNSGVPklAdLx8SFRYQNswyNkpLjtm5uaoKeG//iYdxlxI=@vger.kernel.org X-Gm-Message-State: AOJu0Ywhq/Og+vVji15Fc8gd2B4w8UfZvWEAIi9FrkghRdQzoU3icAbi rLLYf6AGIPXRotcj774/N5LJ68zsscB4Bj+NEAkMejLoZ0BSY1GY X-Google-Smtp-Source: AGHT+IER0bh65YbBfRLKX3Nw+t2aiySxHcptZstAUOkrzDbhYbRTkT51/5Vqa31Ao5bBqxetyaO9Tw== X-Received: by 2002:a17:903:190:b0:201:f5e3:e36d with SMTP id d9443c01a7336-2039e495133mr112789015ad.25.1724712515219; Mon, 26 Aug 2024 15:48:35 -0700 (PDT) Received: from saturn.. (c-67-188-127-15.hsd1.ca.comcast.net. [67.188.127.15]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-203855808a7sm72128895ad.72.2024.08.26.15.48.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2024 15:48:34 -0700 (PDT) From: JP Kobryn To: andrii@kernel.org, ast@kernel.org, eddyz87@gmail.com, bpf@vger.kernel.org Subject: [PATCH bpf-next v2 2/3] bpf: register additional prog types with cpumask kfuncs Date: Mon, 26 Aug 2024 15:48:13 -0700 Message-ID: <20240826224814.289034-3-inwardvessel@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240826224814.289034-1-inwardvessel@gmail.com> References: <20240826224814.289034-1-inwardvessel@gmail.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: bpf@iogearbox.net Allow the cpumask family of kfuncs to be called within tracepoint, kprobe, and perf event programs. Signed-off-by: JP Kobryn --- kernel/bpf/cpumask.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/bpf/cpumask.c b/kernel/bpf/cpumask.c index 33c473d676a5..30b0164a2212 100644 --- a/kernel/bpf/cpumask.c +++ b/kernel/bpf/cpumask.c @@ -475,6 +475,9 @@ static int __init cpumask_kfunc_init(void) ret = ret ?: register_btf_kfunc_id_set(BPF_PROG_TYPE_TRACING, &cpumask_kfunc_set); ret = ret ?: register_btf_kfunc_id_set(BPF_PROG_TYPE_STRUCT_OPS, &cpumask_kfunc_set); ret = ret ?: register_btf_kfunc_id_set(BPF_PROG_TYPE_SYSCALL, &cpumask_kfunc_set); + ret = ret ?: register_btf_kfunc_id_set(BPF_PROG_TYPE_TRACEPOINT, &cpumask_kfunc_set); + ret = ret ?: register_btf_kfunc_id_set(BPF_PROG_TYPE_KPROBE, &cpumask_kfunc_set); + ret = ret ?: register_btf_kfunc_id_set(BPF_PROG_TYPE_PERF_EVENT, &cpumask_kfunc_set); return ret ?: register_btf_id_dtor_kfuncs(cpumask_dtors, ARRAY_SIZE(cpumask_dtors), THIS_MODULE); From patchwork Mon Aug 26 22:48:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: JP Kobryn X-Patchwork-Id: 13778653 X-Patchwork-Delegate: bpf@iogearbox.net Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 9D9551A0733 for ; Mon, 26 Aug 2024 22:48:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724712518; cv=none; b=sVXi7oAeU03nMhdR9CBgaWoW7wWEssd3BhEh2fcXDCujHrfPtGC3mI6NO4imFVuwP6j4osEaIY+seLBatKO4lyQErUDedgeXgyDMen7mTY5TftLWxroH7Q+DRHdAWDy4MMZaeaCYxl3w4r7WZFgIroXzBWxC6TfxpBln99M3J4w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724712518; c=relaxed/simple; bh=Iqrm0uu6KgHxQSfngJdPV1SUojat8AD/k6UMo8sNDrk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I8wHAtq5LF4VtoAQ6+PBBU4thjfaOD+AnjYhIyTi8M9RidAuKrB/QeiJ+405di+2aNZDIftBCLIH6zt1CoLYHROffVxe/8BGch1YBup1iYYQsH5Pt5IYHdaM9GEoz0ulQUVNSebQRt4IU5L4Y2MXDLdoueS/ovhLxlyd/4Gu9d4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=f5nEttzd; arc=none smtp.client-ip=209.85.214.177 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="f5nEttzd" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-20203988f37so47513115ad.1 for ; Mon, 26 Aug 2024 15:48:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724712516; x=1725317316; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=qId7JwIYlwho2rIeJggzJa9WHgpahzkOg7PIyR7JZmY=; b=f5nEttzdHj1o4X4HmpnKgOL/eu6A4vycHRzsLWuXM1zQOj0mKVYi5D1+UPpaKnrD7L O8Hy5n/AlRlMi/0XmlD7ZgPgzcdr+TUwkXO4NHGUGIZydsND6031OSfBiD9OBCYi/79w lSvwJIKR+FclTiKISz/8Otl3ybUzFxGoTAFSV9I43OX0lLJ+Q71uLHqtm/nt8KQApzui kK3r4d7IbxFi4GBCeGis8fs4+r5IB/E4ujEj/Fkf8GHO/JwGfd50jW3pkNpCL8yaCMUy A5JLPJ1XQP7wGX3JHuqL2UPE1xV4YIUoG/avp8812rlWtzshY9FODYgxoylwVwTdsfje vhNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724712516; x=1725317316; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qId7JwIYlwho2rIeJggzJa9WHgpahzkOg7PIyR7JZmY=; b=T9orU8APMJm3lnAmusYT9f7zHc9ujtgL17TemlexnCcwJhE//p1/j5SLdoSlBCS2Fa fiQfzgSFvQp0q6wC0fPNCMue5QN6qux1+xFD0XJSUDoJtuAB8Gdyi1ymhyKaS1Z7ke1k YwOP+9xcW55NOwpg1/VbZ+rjZ3g2K7A/8VZJta8xdhoxqtnci+N2MG+Q36+jX+y4MMpM HsgJhwbjXOMIbFwTiaJ3q/BWbYLyfuP7eOd3YMjXzD+evJ5nAtnbazdams9RVVjEERBz Ld5CmgTkX+hqBtF3iMx6qVOJrY54+pyRnLFC8mrxLnSNvAJk6SWyU8I6N2ytXZG2U7ty 97dg== X-Forwarded-Encrypted: i=1; AJvYcCWilAzpyd8IrnrhafBMvxrGw1/UMJmk8raUy7RCRYcYHRBRXwxHAQXM/y5ymVco6dtqZRY=@vger.kernel.org X-Gm-Message-State: AOJu0YwV5b/1OYC6fz45NSuS+wk6pB9/fzPU6VEi8x133245HRFih+VB 3u/M+640O/qMNWk06JZoY3FznsfOAZ1mc1ofZt6Zp1YsqctmeH4F X-Google-Smtp-Source: AGHT+IEW14S/RSs7h1O/58DQgnod0rahag3Bz/6jjUrLR+///LB1gSTjFgCEctX5g9oL4hAILKM3/A== X-Received: by 2002:a17:903:32ca:b0:201:e7c2:bd03 with SMTP id d9443c01a7336-2039e544ebamr141514405ad.60.1724712516366; Mon, 26 Aug 2024 15:48:36 -0700 (PDT) Received: from saturn.. (c-67-188-127-15.hsd1.ca.comcast.net. [67.188.127.15]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-203855808a7sm72128895ad.72.2024.08.26.15.48.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2024 15:48:35 -0700 (PDT) From: JP Kobryn To: andrii@kernel.org, ast@kernel.org, eddyz87@gmail.com, bpf@vger.kernel.org Subject: [PATCH bpf-next v2 3/3] bpf/selftests: coverage for new program types using cpumask kfuncs Date: Mon, 26 Aug 2024 15:48:14 -0700 Message-ID: <20240826224814.289034-4-inwardvessel@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240826224814.289034-1-inwardvessel@gmail.com> References: <20240826224814.289034-1-inwardvessel@gmail.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: bpf@iogearbox.net This coverage ensures that the cpumask family of kfuncs are allowed within tracepoint, kprobe, and perf event programs. Signed-off-by: JP Kobryn --- .../bpf/progs/verifier_kfunc_prog_types.c | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tools/testing/selftests/bpf/progs/verifier_kfunc_prog_types.c b/tools/testing/selftests/bpf/progs/verifier_kfunc_prog_types.c index cb32b0cfc84b..ac1a64974187 100644 --- a/tools/testing/selftests/bpf/progs/verifier_kfunc_prog_types.c +++ b/tools/testing/selftests/bpf/progs/verifier_kfunc_prog_types.c @@ -120,3 +120,27 @@ int BPF_PROG(cpumask_kfunc_syscall) cpumask_kfunc_load_test(); return 0; } + +SEC("tracepoint") +__success +int BPF_PROG(cpumask_kfunc_tracepoint) +{ + cpumask_kfunc_load_test(); + return 0; +} + +SEC("kprobe") +__success +int BPF_PROG(cpumask_kfunc_kprobe) +{ + cpumask_kfunc_load_test(); + return 0; +} + +SEC("perf_event") +__success +int BPF_PROG(cpumask_kfunc_perf_event) +{ + cpumask_kfunc_load_test(); + return 0; +}