Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1121530lqt; Fri, 7 Jun 2024 08:33:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW4XJx+FYREque/EDdif2xJ7YbtNWU1X/POd85KGq6Xbx88AW4NpTXdfEV55UcVtn4+E6bWJba/G2MXRVGOvzQg3AhO73eZkQ37RZzTvw== X-Google-Smtp-Source: AGHT+IGmykvM04hfKOqvdB2Iwg9BgGPyFtgeaUcEAGOLCK7eD/0sPojMfx8daTi3LHaUsp6+eJOp X-Received: by 2002:a17:906:368d:b0:a68:a52b:7554 with SMTP id a640c23a62f3a-a6cdbef76a3mr191621166b.66.1717774389161; Fri, 07 Jun 2024 08:33:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717774389; cv=pass; d=google.com; s=arc-20160816; b=woIWOGGsCapAI6UpJdhhfyzy+/j6ZcEiBAhNAbbBWc4gBnK4VsMzlYFlaxUBYghkoB wNZKPLrodTPbVuDRlduC571oeHh3v3ZjV1brpyytTaYZ+gFkT3oaZoi/kiZSN5qkCl90 PINPty8d44M7QvTxTqpfDH+9YnMYXmKA20mon/1yzgcELg4siS1GQ7Ez/qJ2GzjOAcd6 PVON1G+lmylvJcFHqLr8YEMyl7FvdrtYExyJUI2KBxw41cAcAA0QSTesqoyzOhwOWtJh j3l6z9dE87Y/I/0IUOudqLZrRYFDoZ/h70B1/ctF/XUGJmgYv/KHMij+fhXuk4hPi/wN H/KA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=KfbvOiDjXd8r4YjGno98SvO2P/lS65dZe1lstl/QsI4=; fh=YpHnV/6uyiPbG6kMterX8knOBa279otQWiSdSsr99Bc=; b=fUUuQf1lxIAGzytENbGfV7BaqF+OIKMkU0MrQ93EwvAUGygFapJL6bDpzjbThaOG8A z9urNXm7aUfQ+P8RXh29VExyDPN+HPFwQL4q0Ah+j3SzZ9gRIf5WLWjuVzIPDWL3KRFw IGhqSjbZcWvY0bJqqcNp5owLWw4PoPqC/b6CZMyB7gtbS/z+G44jQBZSGtfow3gNJdlD Re1O/guy4ujtkD0lPWNg/Z9To2PO1InWzuEQ84ctPe6kqGVXoBQzXtA8FR2oSZ80gRY2 azmwZ5GHQbzE7cldhV9o3Kd0bkFRJ4rc8ulL7OX5lBKxL7fuTa/GADrKA8xc0ohMq6US pixA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pZMKOQKW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-206405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206405-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c8be29ebdsi128785066b.667.2024.06.07.08.33.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 08:33:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206405-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=@kernel.org header.s=k20201202 header.b=pZMKOQKW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-206405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206405-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 am.mirrors.kernel.org (Postfix) with ESMTPS id CE9731F2212E for ; Fri, 7 Jun 2024 15:33:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 980C319AD73; Fri, 7 Jun 2024 15:29:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pZMKOQKW" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B0DAB19EEDA; Fri, 7 Jun 2024 15:29:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717774145; cv=none; b=dCK/25Cf9JWqEo5wVVhwqyqVpyKDtlMEPZXugMOcn90UStRmKq1iqCM7Z1CC+oDFIx2Powrm+fYS+TUvvVEVI52pNCZFJMqCj7vW8HKEfkVRLq55RCcCtldm/NDedGLzAZN+jP0uMfOBucDYA4b3n0uvzLgaX8x7xOMvmc499iM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717774145; c=relaxed/simple; bh=V9BpG0glzaU293GPkowV2J/PIKCZJtxwMnj04QbVtz4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IVTlnYIXVJY6FSbI4maB0SPZbH3IFMSvPSwiH/sPN6JhaytLfIMkimQOlloRAmMptC1cA8uG83LF6QjvO3r/B4Qop2m5xdEEmpPiUnIdLNKr8MWhxuyOtLDRArcyyGDFUI17bSwFUvSf7ukPID3F8LXemhYjmFULajUHOJhxH8g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pZMKOQKW; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68993C4AF0C; Fri, 7 Jun 2024 15:29:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717774145; bh=V9BpG0glzaU293GPkowV2J/PIKCZJtxwMnj04QbVtz4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=pZMKOQKW5L2/3m0LPCihpfvMlsLIvEFolqJY5whVQllAdkpptHTCaaI8a391WPXrI ZIebgpXdPWlxb4mCJfxZeBOTGRLJr0lTRm912l6EzCjIK0PM8Vct6BzWidg3lqLiyA Rmi0CpjgJCYjEpxAp6PDn/6HNA9wetWhJX5lfSSd8Dp3VnJJlC2gzdR9lVME6LwT01 ASgUe7lBlx1Tuo4tpORxrugtve8w/S82TsdQ52ZlBSIu73JgNOX5AbGixSndhPPcwG JUKyhGCv63TEGLT5Qi+HzgQyTJGTu7g5rbOFVvTvGmuU5Fmn7QF8OlslFMqYejVkFB 3ZQdh/VnTRrAA== From: Benjamin Tissoires Date: Fri, 07 Jun 2024 17:28:34 +0200 Subject: [PATCH HID v2 14/16] bpf: allow bpf helpers to be used into HID-BPF struct_ops Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240607-hid_bpf_struct_ops-v2-14-3f95f4d02292@kernel.org> References: <20240607-hid_bpf_struct_ops-v2-0-3f95f4d02292@kernel.org> In-Reply-To: <20240607-hid_bpf_struct_ops-v2-0-3f95f4d02292@kernel.org> To: Shuah Khan , Jiri Kosina , Jonathan Corbet , Alexei Starovoitov Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-input@vger.kernel.org, linux-doc@vger.kernel.org, Benjamin Tissoires X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1717774109; l=845; i=bentiss@kernel.org; s=20230215; h=from:subject:message-id; bh=V9BpG0glzaU293GPkowV2J/PIKCZJtxwMnj04QbVtz4=; b=SUaxVZou+t3AUr6wxjcOx6XBdpkcx3mPr1lWPTdxDJniGoU03Vx24FCwLvjM3CzHj8uUETN8X 5BUAEJgedJpDQ10K2E5b8DAzCrbvG+ONOMWZKH45xKDFJMpHsVRD4eh X-Developer-Key: i=bentiss@kernel.org; a=ed25519; pk=7D1DyAVh6ajCkuUTudt/chMuXWIJHlv2qCsRkIizvFw= Without this helpers like bpf_printk() or bpf_map_update() are not available, making anything but change of bytes impossible to do. Signed-off-by: Benjamin Tissoires --- new in v2 --- drivers/hid/bpf/hid_bpf_struct_ops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hid/bpf/hid_bpf_struct_ops.c b/drivers/hid/bpf/hid_bpf_struct_ops.c index 9192c66cde20..056d05d96962 100644 --- a/drivers/hid/bpf/hid_bpf_struct_ops.c +++ b/drivers/hid/bpf/hid_bpf_struct_ops.c @@ -89,6 +89,7 @@ static int hid_bpf_ops_btf_struct_access(struct bpf_verifier_log *log, } static const struct bpf_verifier_ops hid_bpf_verifier_ops = { + .get_func_proto = bpf_base_func_proto, .is_valid_access = hid_bpf_ops_is_valid_access, .btf_struct_access = hid_bpf_ops_btf_struct_access, }; -- 2.44.0