Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1349538iob; Thu, 19 May 2022 04:58:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRrU09L8nVqAxQGkPnX71sQnoRrzYRT+sGBAsyqST400BMvGz/Y9+TDpYhrlWMpNrsAzQ3 X-Received: by 2002:a17:906:6a0d:b0:6fe:180b:7935 with SMTP id qw13-20020a1709066a0d00b006fe180b7935mr3967560ejc.717.1652961526932; Thu, 19 May 2022 04:58:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652961526; cv=none; d=google.com; s=arc-20160816; b=cv6ji1dkSji472WBqE4L4elwmpHA0s6IyKONylPqSQqUsFsJIACmiktZMJL4tIF1b6 Z6K3ubfjRpAT4Rpya/SkLkZmGkjJ7SfS9H/TSenI1IGeM34caP4eI3A6+R/Y+Zu0/Sju mT5RjpzvEx5ybtzm68ECCk5bHu7+D2m31I/07Y5OVLIBSIEIKnXj6rLJXBf9PWv1NcAE DJnJW9UXY4fv2M7aBAbqgwe1xVqH6samh1GuxRVVpEQ44Y8h6ygwIr7TG1wRFcunYJoU AnyNhKEetTXSs4yOBLoPVF2aRPlWSj0ufQYf/nXU0RApOJojcfP4BI6cA3ffry6uiM0Z HDuA== 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=fwL/oAER7nbSk9uOjwgAvzy5aiwX4uVWmPBaz2ofF3M=; b=XifXpwmkm3D47D6zjGTaY8qBhEpR8jOuD7wGoCGb3tTYKQOhWCQpSWBwXiIXlnCSF9 bXK/T3OE1AxccT81mjel2GveJTnGSbCemVeUzpviLMHz1B6jO5Ph0BRvqhnNko55EIko oJXK17VVPLkMHNWdftNPgf8STVSJsyg57nhLewh1x4FwEN39vxLLcEbgaTmqgfMhO1+L iy0z0wbEqPhm8nCPaCUwTgWqLLq4fAUffhkNuB/D30jVP0N9rn2tEgl3tUQuaPqSSKyW DCnlcjDDxKvxk3v/YLZppoSrkD5ch0f3OZf2BPcs2dxrXRYB9Ly6sIPtZZLiGiExvmL+ KYIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h0+7Lt7r; 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 hp20-20020a1709073e1400b006e88cc5c374si5672015ejc.179.2022.05.19.04.58.19; Thu, 19 May 2022 04:58:46 -0700 (PDT) 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=h0+7Lt7r; 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 S231635AbiESIVS (ORCPT + 99 others); Thu, 19 May 2022 04:21:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235677AbiESIVC (ORCPT ); Thu, 19 May 2022 04:21:02 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94242AE264; Thu, 19 May 2022 01:20:40 -0700 (PDT) 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 4DD68B8237F; Thu, 19 May 2022 08:20:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76A14C385AA; Thu, 19 May 2022 08:20:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652948438; bh=p5BYeBj/v9QmnZ2DUiNgA11xOl2jDT6ZwzbYzb4aCWc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=h0+7Lt7r1FFykWgBMkBazf6jcV7p6/lzvHzsZkHW+Faj7/4TgqaB8QYE9MEpuicdj t/LiVq6QeT7xbfSIeC7Gb0hbjYq1DP9ZBGhXIdVCDfhQgjMp+3qGqCBZI7jTopZ3hI xYrlrHCAGRwQqvezCqnnJHEKR9eqQ+KTc/uvozJc= Date: Thu, 19 May 2022 10:20:35 +0200 From: Greg KH To: Christoph Hellwig Cc: Benjamin Tissoires , Jiri Kosina , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Shuah Khan , Dave Marchevsky , Joe Stringer , Jonathan Corbet , Tero Kristo , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH bpf-next v5 00/17] Introduce eBPF support for HID devices Message-ID: References: <20220518205924.399291-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.6 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 Thu, May 19, 2022 at 01:10:48AM -0700, Christoph Hellwig wrote: > > The logic is the following (see also the last patch for some more > > documentation): > > - hid-bpf first preloads a BPF program in the kernel that does a few > > things: > > * find out which attach_btf_id are associated with our trace points > > * adds a bpf_tail_call() BPF program that I can use to "call" any > > other BPF program stored into a jump table > > * monitors the releases of struct bpf_prog, and when there are no > > other users than us, detach the bpf progs from the HID devices > > - users then declare their tracepoints and then call > > hid_bpf_attach_prog() in a SEC("syscall") program > > - hid-bpf then calls multiple time the bpf_tail_call() program with a > > different index in the jump table whenever there is an event coming > > from a matching HID device > > So driver abstractions like UDI are now perfectly fine as long as they > are written using a hip new VM? Ugh, don't mention UDI, that's a bad flashback... > This whole idea seems like a bad idea, against the Linux spirit and > now actually useful - it is totally trivial to write a new HID > driver alreay, and if it isn't in some cases we need to fix that. > > So a big fat NAK to the idea of using eBPF for actual driver logic. I thought the goal here was to move a lot of the quirk handling and "fixup the broken HID decriptors in this device" out of kernel .c code and into BPF code instead, which this patchset would allow. So that would just be exception handling. I don't think you can write a real HID driver here at all, but I could be wrong as I have not read the new patchset (older versions of this series could not do that.) thanks, greg k-h