From patchwork Wed Nov 30 10:10:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 630032 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B9D4C47088 for ; Wed, 30 Nov 2022 10:12:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234624AbiK3KMA (ORCPT ); Wed, 30 Nov 2022 05:12:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235674AbiK3KL6 (ORCPT ); Wed, 30 Nov 2022 05:11:58 -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 A72713D901 for ; Wed, 30 Nov 2022 02:10:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669803055; 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: in-reply-to:in-reply-to:references:references; bh=vcX4h7B4Cn2uY8DsNhXZd0MIAMkHSmKLkxFeut2xdUs=; b=bo1QeYRmFl8wjGWCL4ReZe95FtPshmJ4lekS3XeQCVcAiJLfl99wB71wofLPiiiNd6jlNT E36Ai2YqFozufibn/jZm1mgu2SpS9IA98BS+q7poCls4yZZhcMOqJRAAikhmhWEDDBZHqC bKzKMi+B55or4VCQxZ9YDpuqFDjPFAQ= 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-14-al01h2BcNG2dZSPCXBRCdQ-1; Wed, 30 Nov 2022 05:10:52 -0500 X-MC-Unique: al01h2BcNG2dZSPCXBRCdQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 72A063804066; Wed, 30 Nov 2022 10:10:51 +0000 (UTC) Received: from plouf.redhat.com (unknown [10.39.195.154]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D45540E978E; Wed, 30 Nov 2022 10:10:33 +0000 (UTC) From: Benjamin Tissoires To: Jiri Kosina , Florent Revest , Jon Hunter Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH 1/2] HID: bpf: enforce HID_BPF dependencies Date: Wed, 30 Nov 2022 11:10:20 +0100 Message-Id: <20221130101021.1868764-2-benjamin.tissoires@redhat.com> In-Reply-To: <20221130101021.1868764-1-benjamin.tissoires@redhat.com> References: <20221130101021.1868764-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org As mentioned in the link below, having JIT and BPF is not enough to have fmod_ret and error injection APIs. This resolves the error that happens on a system without tracing enabled when hid-bpf tries to load itself. Link: https://lore.kernel.org/r/CABRcYmKyRchQhabi1Vd9RcMQFCcb=EtWyEbFDFRTc-L-U8WhgA@mail.gmail.com Fixes: f5c27da4e3c8 ("HID: initial BPF implementation") Signed-off-by: Benjamin Tissoires --- drivers/hid/bpf/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/hid/bpf/Kconfig b/drivers/hid/bpf/Kconfig index 298634fc3335..498232f9faa9 100644 --- a/drivers/hid/bpf/Kconfig +++ b/drivers/hid/bpf/Kconfig @@ -4,7 +4,9 @@ menu "HID-BPF support" config HID_BPF bool "HID-BPF support" default HID_SUPPORT - depends on BPF && BPF_SYSCALL + depends on BPF && BPF_SYSCALL && \ + DYNAMIC_FTRACE_WITH_DIRECT_CALLS && \ + FUNCTION_ERROR_INJECTION help This option allows to support eBPF programs on the HID subsystem. eBPF programs can fix HID devices in a lighter way than a full From patchwork Wed Nov 30 10:10:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 629738 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C140C352A1 for ; Wed, 30 Nov 2022 10:12:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235635AbiK3KMD (ORCPT ); Wed, 30 Nov 2022 05:12:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235587AbiK3KMB (ORCPT ); Wed, 30 Nov 2022 05:12:01 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9A1741998 for ; Wed, 30 Nov 2022 02:10:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669803058; 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: in-reply-to:in-reply-to:references:references; bh=NAPWN76bkmlkit0jp4yV1GQFH8+HLa/sfheRK684iiA=; b=M/fmJ/I0q/aZ6FGKkQxk5C4NyKP2Vpu7Y97ZmMtZK9JD2N3tjPRvNPXiwecYE1YN7TNkDu NKy19zUGK51Wd9mYaFaNqhXUIcTr0FOZgEH4KmlFHghzK9VcoHfGuHP1oztI14eNimyGoi Jx2mZX076IPhQ+gTfJbr1KznHPz7pkE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-659--dUu3qT7Mw2hrcemaTcW8g-1; Wed, 30 Nov 2022 05:10:52 -0500 X-MC-Unique: -dUu3qT7Mw2hrcemaTcW8g-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B31DB101A52A; Wed, 30 Nov 2022 10:10:51 +0000 (UTC) Received: from plouf.redhat.com (unknown [10.39.195.154]) by smtp.corp.redhat.com (Postfix) with ESMTP id A39B840E9790; Wed, 30 Nov 2022 10:10:39 +0000 (UTC) From: Benjamin Tissoires To: Jiri Kosina , Florent Revest , Jon Hunter Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH 2/2] selftests: hid: ensures we have the proper requirements in config Date: Wed, 30 Nov 2022 11:10:21 +0100 Message-Id: <20221130101021.1868764-3-benjamin.tissoires@redhat.com> In-Reply-To: <20221130101021.1868764-1-benjamin.tissoires@redhat.com> References: <20221130101021.1868764-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org They are implicit right now but might get defaulted to N in the future, so force them in the config so we don't get any surprises. Signed-off-by: Benjamin Tissoires --- tools/testing/selftests/hid/config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/hid/config b/tools/testing/selftests/hid/config index d4130489c1b1..e3595b4a3708 100644 --- a/tools/testing/selftests/hid/config +++ b/tools/testing/selftests/hid/config @@ -11,8 +11,10 @@ CONFIG_BPF_SYSCALL=y CONFIG_BPF=y CONFIG_CGROUP_BPF=y CONFIG_DEBUG_INFO_BTF=y +CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y CONFIG_FPROBE=y CONFIG_FTRACE_SYSCALLS=y +CONFIG_FUNCTION_ERROR_INJECTION=y CONFIG_FUNCTION_TRACER=y CONFIG_HIDRAW=y CONFIG_HID=y