Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1544050iob; Thu, 19 May 2022 08:45:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzX7/fzQFQQrk/zbmnZLnYhWhryvBNPHxE3a065BhC/Oj4+DSCdNRUdsXbWVA2RfGwN1RPC X-Received: by 2002:a05:6402:1e93:b0:427:d610:5b47 with SMTP id f19-20020a0564021e9300b00427d6105b47mr6099251edf.206.1652975115515; Thu, 19 May 2022 08:45:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652975115; cv=none; d=google.com; s=arc-20160816; b=RBcZG5oRhTXzbg1Au20HJ7WkKHayJ04TIpSxN94IYidvqMa2qxyKcA5pmycTF5v37Y 5djw7QdGtuPbw2p1IqWTqmrM94nLqn76T23gdygFNKWsRoGKy8dXUIppYri1jA3Av+bC 0AYqlGikKtgrbXfg6r/JtNgBcXAoHnVv3uQQHZ2E2Ltoo4jyiAEP/u15pp0Ld0PqfWhy XVJs6OydagfXHtsHO0en5OCBAKmyBys/hbgIOrO1YDI2p/GodDbAuRk44+ID+qJEXOBw 3PPNC9PgZcM2/+68WfWZNCR6geQnssGLWvDoOjflvMzV3mK7GPhSFYWhTs68CFnJuzOC D8Pg== 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=P7hBfgfR5V/lg9pLTdIBC/hWy6eM9dq7h/FVFtkFAq8=; b=UOv3XzoUaLFWc9gJ/k6oQM1eF0Lydq0MRnkM8bfYiseiyfh1vjQgu4LwNn7hNVf/wp iUkZ0w4aznqeTjbzkjzyzABA07LfuUAU5u9XiZNUpdo/nSYdVBsVBrnVNAt31Xu++S/z lXPxtm3K5YnETCVGzqBqubBTA4xA5aPGQzUmc6lxDDUi86iEQ0rlug4StnR6/M3Ggb6N gIeMihPBedgS7q00KKk4KjX9DpVh5A7wB4dYI0ivHi8Fc78aohnQWKWHy6UJwvLjK9+D rMdJb7G1CNrTXeAmjUfnrwxKpTXxocZbzP8NbaQck+49EB7tTVWhyz8a573knVtvfHeO cUlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=rdosXHdo; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m26-20020aa7c2da000000b00425ff2bcb8csi5271395edp.527.2022.05.19.08.44.47; Thu, 19 May 2022 08:45:15 -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=@infradead.org header.s=bombadil.20210309 header.b=rdosXHdo; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235242AbiESILK (ORCPT + 99 others); Thu, 19 May 2022 04:11:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235207AbiESILF (ORCPT ); Thu, 19 May 2022 04:11:05 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F2FA32ED4; Thu, 19 May 2022 01:11:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=P7hBfgfR5V/lg9pLTdIBC/hWy6eM9dq7h/FVFtkFAq8=; b=rdosXHdo2i8UPLrk/NfgCsQQXa NceHcHgDpc15rlXcvlJlOrvKZ07wttU2W4xYEEJ6/rwixNTeoFQGrtYIfP88p3Ebs08aAqDTCIgNz pLdQx96nbRVquBG/2pxsNXQCMYj08yyvHjs1NkoW9tWhq0aCFNmUPZVm0RT+FxOycqrOLtkimO1gU qVdbj5lP7g6hJLzWrzaga1BFb3fwvsbBm6/6U5xAB3UEw/VdGyTJZ6qYAs7dAErfDL0kHi1ZTR5jm OpDM/iSINt2WRl+K0pmS1DIg6BnDkcGe3O+dUNeHJrXrDUtyifs6d74AsrJbhyhbCDXwNL+hCKQCR CXtb89mQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrbFA-005iMY-O2; Thu, 19 May 2022 08:10:48 +0000 Date: Thu, 19 May 2022 01:10:48 -0700 From: Christoph Hellwig To: Benjamin Tissoires Cc: Greg KH , 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: <20220518205924.399291-1-benjamin.tissoires@redhat.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 > 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? 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.