[HID,for-next,v3,0/5] HID: bpf: remove the need for ALLOW_ERROR_INJECTION and Kconfig fixes
Message ID | 20221206145936.922196-1-benjamin.tissoires@redhat.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2875600wrr; Tue, 6 Dec 2022 07:09:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf4BwV3KO+0rNrT6grjuD1z5AytNZ8Mx4XdvvhXXad5djgrTnVzokzG/6ku6QB77Ev2KG3zp X-Received: by 2002:a05:6402:78e:b0:46c:6f53:bf19 with SMTP id d14-20020a056402078e00b0046c6f53bf19mr12289528edy.299.1670339352788; Tue, 06 Dec 2022 07:09:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670339352; cv=none; d=google.com; s=arc-20160816; b=tjSddDVpsRhYHWH1t2fJ/+lNV8bUMNRAL9K/2vHfAYQpXCnEhPtvMz1AR0mNczTjXL pvsl27k6K205pw78TG58ZBlz8wqx7B6Y/TG0eu82RKVNFXtnM6dA0XqQR2qQKMqOqDXD s3ixL+12sl/Vf0Ug6fCo+MyHpjruz074xS57sEDGV2s5yb9Imq0VBTNtlIf6AeFg7+Jo 23ZeqLKGl5jC0Se6vtTtXILczeygPu+WIkxUUmhqZ07lFiN9I5BFoWOqdbFP+/zAdPXT iJBhjZoPEInrJacX3VY9KaXB+cWwZo305pwxOzzkXYlbBpGOUb3M4rT1UA7ODBrpk474 rQ9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=cc4Vy7WMYhGoahXShwfLWL6RdpHCDWpUvTljVdwasiw=; b=z730qh1Vu7lBp7Tezjdb4ovZMdrN88qHp2/j6doW7eA/sCjhjzsyXcTYnZZHP5rkzN 4xa1qbiPv0Jl6p1+/uaPqnmVaZYmE/S8KHnAta76BJmx6lKzOsMLT2Gu17PLcE+4OkJc 4c9nTCXG5awDPbVPm8Q8TsE0EL/loetlh1nOSeHEm7+46A/poKP7SzkrPA/yAzIK5005 wRiM/Yi3P2wtTdui59esx/fwzewHT7fKSP5+ItUe4aSv6na1UIsOVT1B6q4AZXpok86p iJ+cUp7sJyuQhKvM7KlxAYZdjHK7ZIXwzKZJtLrrTPz9qXucxU03AY28YTwwkiBFDq0Y U0wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OTL6VUHe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qk32-20020a1709077fa000b007877b1c7f27si14750467ejc.829.2022.12.06.07.08.37; Tue, 06 Dec 2022 07:09:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OTL6VUHe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234982AbiLFPGv (ORCPT <rfc822;jaysivo@gmail.com> + 99 others); Tue, 6 Dec 2022 10:06:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234167AbiLFPGW (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 6 Dec 2022 10:06:22 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F82232BB7 for <linux-kernel@vger.kernel.org>; Tue, 6 Dec 2022 06:59:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670338786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=cc4Vy7WMYhGoahXShwfLWL6RdpHCDWpUvTljVdwasiw=; b=OTL6VUHeieeyEZ45+Kp/e1qORtl1V8P80P8nnQK0XpaMgcFdfGN1d6r8S4ndhwUcgBOuHT oE/mNMYEsx/Jg1PoZQTni9bt6k5mwmKxtdMskkgCJIZuTAHwObNucbZTzk73/bcjJHGXLh iHQfgCzTPu/tGZUbDD121Y8Jmytsrrs= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-292-S2Syx4JLPVm-UdqJSo8ciQ-1; Tue, 06 Dec 2022 09:59:43 -0500 X-MC-Unique: S2Syx4JLPVm-UdqJSo8ciQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8AD3A2833B13; Tue, 6 Dec 2022 14:59:42 +0000 (UTC) Received: from plouf.redhat.com (unknown [10.39.193.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9C5684A9254; Tue, 6 Dec 2022 14:59:40 +0000 (UTC) From: Benjamin Tissoires <benjamin.tissoires@redhat.com> To: Jiri Kosina <jikos@kernel.org>, Florent Revest <revest@chromium.org>, Jon Hunter <jonathanh@nvidia.com>, Alexei Starovoitov <alexei.starovoitov@gmail.com>, Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org> Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires <benjamin.tissoires@redhat.com> Subject: [PATCH HID for-next v3 0/5] HID: bpf: remove the need for ALLOW_ERROR_INJECTION and Kconfig fixes Date: Tue, 6 Dec 2022 15:59:31 +0100 Message-Id: <20221206145936.922196-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751477757381324680?= X-GMAIL-MSGID: =?utf-8?q?1751477757381324680?= |
Series |
HID: bpf: remove the need for ALLOW_ERROR_INJECTION and Kconfig fixes
|
|
Message
Benjamin Tissoires
Dec. 6, 2022, 2:59 p.m. UTC
Hi, This is a new version of the ALLOW_ERROR_INJECTION hack removal. Compared to v2, I followed the review from Alexei which cleaned up the code a little bit. I also got a kbuild test bot complaining[3] so add a fix for that too. For reference, here is the previous cover letter: So this patch series aims at solving both [0] and [1]. The first one is bpf related and concerns the ALLOW_ERROR_INJECTION API. It is considered as a hack to begin with, so introduce a proper kernel API to declare when a BPF hook can have its return value changed. The second one is related to the fact that DYNAMIC_FTRACE_WITH_DIRECT_CALLS is currently not enabled on arm64, and that means that the current HID-BPF implementation doesn't work there for now. The first patch actually touches the bpf core code, but it would be easier if we could merge it through the hid tree in the for-6.2/hid-bpf branch once we get the proper acks. Cheers, Benjamin [0] https://lore.kernel.org/all/20221121104403.1545f9b5@gandalf.local.home/ [1] https://lore.kernel.org/r/CABRcYmKyRchQhabi1Vd9RcMQFCcb=EtWyEbFDFRTc-L-U8WhgA@mail.gmail.com [3] https://lore.kernel.org/all/202212060216.a6X8Py5H-lkp@intel.com/ Benjamin Tissoires (5): bpf: do not rely on ALLOW_ERROR_INJECTION for fmod_ret HID: bpf: do not rely on ALLOW_ERROR_INJECTION HID: bpf: enforce HID_BPF dependencies selftests: hid: ensures we have the proper requirements in config kselftests: hid: fix missing headers_install step drivers/hid/bpf/Kconfig | 3 ++- drivers/hid/bpf/hid_bpf_dispatch.c | 20 +++++++++++++++++-- drivers/hid/bpf/hid_bpf_jmp_table.c | 1 - include/linux/btf.h | 2 ++ kernel/bpf/btf.c | 30 +++++++++++++++++++++++----- kernel/bpf/verifier.c | 17 ++++++++++++++-- net/bpf/test_run.c | 14 ++++++++++--- tools/testing/selftests/hid/Makefile | 26 +++++++++++------------- tools/testing/selftests/hid/config | 1 + 9 files changed, 86 insertions(+), 28 deletions(-)
Comments
Hello: This series was applied to bpf/bpf-next.git (master) by Benjamin Tissoires <benjamin.tissoires@redhat.com>: On Tue, 6 Dec 2022 15:59:31 +0100 you wrote: > Hi, > > This is a new version of the ALLOW_ERROR_INJECTION hack removal. > > Compared to v2, I followed the review from Alexei which cleaned up the > code a little bit. > > [...] Here is the summary with links: - [HID,for-next,v3,1/5] bpf: do not rely on ALLOW_ERROR_INJECTION for fmod_ret https://git.kernel.org/bpf/bpf-next/c/5b481acab4ce - [HID,for-next,v3,2/5] HID: bpf: do not rely on ALLOW_ERROR_INJECTION (no matching commit) - [HID,for-next,v3,3/5] HID: bpf: enforce HID_BPF dependencies (no matching commit) - [HID,for-next,v3,4/5] selftests: hid: ensures we have the proper requirements in config (no matching commit) - [HID,for-next,v3,5/5] kselftests: hid: fix missing headers_install step (no matching commit) You are awesome, thank you!
On Tue, 6 Dec 2022, Benjamin Tissoires wrote: > Compared to v2, I followed the review from Alexei which cleaned up the > code a little bit. > > I also got a kbuild test bot complaining[3] so add a fix for that too. > > For reference, here is the previous cover letter: > > So this patch series aims at solving both [0] and [1]. > > The first one is bpf related and concerns the ALLOW_ERROR_INJECTION API. > It is considered as a hack to begin with, so introduce a proper kernel > API to declare when a BPF hook can have its return value changed. > > The second one is related to the fact that > DYNAMIC_FTRACE_WITH_DIRECT_CALLS is currently not enabled on arm64, and > that means that the current HID-BPF implementation doesn't work there > for now. > > The first patch actually touches the bpf core code, but it would be > easier if we could merge it through the hid tree in the for-6.2/hid-bpf > branch once we get the proper acks. For the series: Reviewed-by: Jiri Kosina <jkosina@suse.cz> Thanks,
On Sat, Dec 10, 2022 at 10:07 AM Jiri Kosina <jikos@kernel.org> wrote: > > On Tue, 6 Dec 2022, Benjamin Tissoires wrote: > > > Compared to v2, I followed the review from Alexei which cleaned up the > > code a little bit. > > > > I also got a kbuild test bot complaining[3] so add a fix for that too. > > > > For reference, here is the previous cover letter: > > > > So this patch series aims at solving both [0] and [1]. > > > > The first one is bpf related and concerns the ALLOW_ERROR_INJECTION API. > > It is considered as a hack to begin with, so introduce a proper kernel > > API to declare when a BPF hook can have its return value changed. > > > > The second one is related to the fact that > > DYNAMIC_FTRACE_WITH_DIRECT_CALLS is currently not enabled on arm64, and > > that means that the current HID-BPF implementation doesn't work there > > for now. > > > > The first patch actually touches the bpf core code, but it would be > > easier if we could merge it through the hid tree in the for-6.2/hid-bpf > > branch once we get the proper acks. > > For the series: > > Reviewed-by: Jiri Kosina <jkosina@suse.cz> Thanks. I have applied the rest of the series to for-6.2/hid-bpf. Cheers, Benjamin > > Thanks, > > -- > Jiri Kosina > SUSE Labs >