Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp340361pxm; Fri, 25 Feb 2022 09:00:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyspqjCf7wMvmYbwrBpLuR8FSBlwG0YaxAxOtGGteV50aNECCGbTefaVV/BVFbJoN9Ttkta X-Received: by 2002:a17:903:22c9:b0:151:3e16:48f6 with SMTP id y9-20020a17090322c900b001513e1648f6mr1774190plg.114.1645808427635; Fri, 25 Feb 2022 09:00:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645808427; cv=none; d=google.com; s=arc-20160816; b=JDzSkgEXDUHurQ7tp9OvlKSxYpUeMkEveyF6Q1DfwEmWJ9muP1RKblyoVcmhxpVGCC FlOYOv1URTxtm/lRJ0t0dhEfeuAP/LuFB+I06+1guKZGZocqCZ/2wAw7dd5JS/EA6e/c 4cdU9MVZM9Qvm1izSblh+quv6M96mClQ6H2Jo4Ogifr5AZaNIwKCIuw7zAin2ooutgK2 Y/EXxkvxmnqTPdgZ2XXh0MceJVWjXAtDMp1qr37d4AH2PI1T/T8oPrKdQ4gH8VEEkckz M22CPuvgwEp1JhrS9j/AEQYzEFaEwB7LBEwNCcz0MIZ6pyHjS7rSl/d2svpIp5nlMKXI 0jFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=z6FVg17hGe9meo4ug4nhDQN+eqsJqOYr6C5nXf6YJ2k=; b=Kyo1xJ5t/+q/k7FHlmaGdVTwULA9E0f+gLBqzydNXYVGHp11XLC9JfIC2Q0T8AnjtH JGiVuzQL86wC6kp8Q2tq/I/ieCp0TNEisPIgGVmx6r0dFP0GenFdtnEzDpqKG/twXKXz DQkX2AZVzf7M4GXWASYKDaw/zbER073TVtWKh/2UQ/N9QLhWV/Xx9FJtudX9clObt3Pu i6NtYYFbLcSV+YG+Gr9jnMAfZcmyb6HROh+syv8Oh0TsNa5bKjcuLHsoztacFBh0yVsh aOXtRJHHuKxfcILOaBbhHZVk8ZQvD09t8nbQ3ZbagItLx7NqSKXKpOcclO8MXU7BL66c IDrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pwM1Xt6g; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s139-20020a632c91000000b00374982a37f0si2244607pgs.541.2022.02.25.09.00.10; Fri, 25 Feb 2022 09:00:27 -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=@linuxfoundation.org header.s=korg header.b=pwM1Xt6g; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240314AbiBYQWY (ORCPT + 99 others); Fri, 25 Feb 2022 11:22:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239145AbiBYQWX (ORCPT ); Fri, 25 Feb 2022 11:22:23 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B7C3186442; Fri, 25 Feb 2022 08:21:51 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B9D60B83281; Fri, 25 Feb 2022 16:21:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74395C340E7; Fri, 25 Feb 2022 16:21:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645806108; bh=5qCpPhBzCG6EzwR24kqTZdJuF47gyfzZc+1BXmKEf6M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pwM1Xt6gJz0gy6cniVfgiIJmJRbym2PDFc7fvMhX7O78a9KimPFkL1OlSiMRznl2v 43t+J1tF1dp6drJ9uHzOSFsQwjcLNrvxCTTpAp3RdEkoCeRZAG09vk+ilKDGahSdav 1dR6n4cxuaKBLu+rDv0brby5moN8WaD1cLgadAZw= Date: Fri, 25 Feb 2022 17:19:53 +0100 From: Greg KH To: Benjamin Tissoires Cc: Yonghong Song , Jiri Kosina , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , John Fastabend , KP Singh , Shuah Khan , Dave Marchevsky , Joe Stringer , Tero Kristo , lkml , "open list:HID CORE LAYER" , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, Peter Hutterer Subject: Re: [PATCH bpf-next v1 0/6] Introduce eBPF support for HID devices Message-ID: References: <20220224110828.2168231-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 25, 2022 at 05:06:32PM +0100, Benjamin Tissoires wrote: > On Thu, Feb 24, 2022 at 6:21 PM Yonghong Song wrote: > > > > > > > > On 2/24/22 5:49 AM, Benjamin Tissoires wrote: > > > Hi Greg, > > > > > > Thanks for the quick answer :) > > > > > > On Thu, Feb 24, 2022 at 12:31 PM Greg KH wrote: > > >> > > >> On Thu, Feb 24, 2022 at 12:08:22PM +0100, Benjamin Tissoires wrote: > > >>> Hi there, > > >>> > > >>> This series introduces support of eBPF for HID devices. > > >>> > > >>> I have several use cases where eBPF could be interesting for those > > >>> input devices: > > >>> > > >>> - simple fixup of report descriptor: > > >>> > > >>> In the HID tree, we have half of the drivers that are "simple" and > > >>> that just fix one key or one byte in the report descriptor. > > >>> Currently, for users of such devices, the process of fixing them > > >>> is long and painful. > > >>> With eBPF, we could externalize those fixups in one external repo, > > >>> ship various CoRe bpf programs and have those programs loaded at boot > > >>> time without having to install a new kernel (and wait 6 months for the > > >>> fix to land in the distro kernel) > > >> > > >> Why would a distro update such an external repo faster than they update > > >> the kernel? Many sane distros update their kernel faster than other > > >> packages already, how about fixing your distro? :) > > > > > > Heh, I'm going to try to dodge the incoming rhel bullet :) > > > > > > It's true that thanks to the work of the stable folks we don't have to > > > wait 6 months for a fix to come in. However, I think having a single > > > file to drop in a directory would be easier for development/testing > > > (and distribution of that file between developers/testers) than > > > requiring people to recompile their kernel. > > > > > > Brain fart: is there any chance we could keep the validated bpf > > > programs in the kernel tree? > > > > Yes, see kernel/bpf/preload/iterators/iterators.bpf.c. > > Thanks. This is indeed interesting. > I am not sure the exact usage of it though :) > > One thing I wonder too while we are on this topic, is it possible to > load a bpf program from the kernel directly, in the same way we can > request firmwares? We used to be able to do that, putting bpf programs inside a module. But that might have gotten removed because no one actually used it. I thought it was a nice idea. > Because if we can do that, in my HID use case we could replace simple > drivers with bpf programs entirely and reduce the development cycle to > a bare minimum. How would the development cycle change? You could get rid of many in-kernel hid drivers and replace them with bpf code perhaps? Maybe that's a good use case :) thanks, greg k-h