Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1029339pxb; Tue, 29 Mar 2022 15:24:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLy+T+InTpPmjJ/VdJEtwpozrMRIhCbBmHmh7lvnjGXyQPXg6BZj7Y8q2vw6joPT9w/ZTY X-Received: by 2002:a17:907:72d0:b0:6db:4788:66a9 with SMTP id du16-20020a17090772d000b006db478866a9mr38237349ejc.516.1648592641977; Tue, 29 Mar 2022 15:24:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648592641; cv=none; d=google.com; s=arc-20160816; b=iSfbQ54NOO8CB/bmjUpRorhUku4bjRET6zuspJZEA4XOcHc+47Ax6vrLSDfLb4RMc8 ZsD3aC6RiCOyb3U+LzAT/zdNB5PX+YzodSlfRYPg7GItoEyQ0BQ1VAqJyZO9CLhEcUvh HQkxMLRix+oFmw54NtXi4JM1ghvLiLqUqlAKXAtWK4HX4Xf6osvE4jxN9+fOocAgW75x I31wsOctAIbBgqUxkvWfsZsQxQt7Wit7Irsb9cTmc7M9Kp3bCzs9z+isCfrZYX2jZ6yN BtyrvoV6VXSPIM8J6ftnCsXcK3Om6AtP+SuHOUuGNlzpWGE/7L3JYOl9f7V8r03+Kur5 lyqw== 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 :dkim-filter; bh=y4az3WkefbkCxNOR94uEneUMzG1hS7Ex1VtRu+4P1Bo=; b=J4KRiryk45lrzYgB0fZustOUQwLhrgwjQft5lW2kaGZ/3KPXyZl5ZEGWyNiL7q0IrT lun+L5YLbQjElR6sIBKW8+IRqv0H4kjmgKYkxPQpJEB0fmepgvnsrGPm1OdlngkjSjsY 1Ict7Rs/GyFkRXFb4+H3JGLrg5qvbpPWZaFV3kKkLE/HgfcUPvhbpcZ03eL8gDWGStHa z8TgPkYCVuHM9a+uz2AE/9PkgmSX7dWMsQsq6DgfQxfhrKJO06N8gJSuP9W2m3ErMlUh vxXDPmzhE14XrMnFLJTVZbOfiBZQn9ox7DqoxmHRGpqABfkWxrqF+5Skxe7W0M9sJSEH IfXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=IdcQGez5; 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=linux.microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a5-20020a1709064a4500b006df76385dfdsi19469880ejv.669.2022.03.29.15.23.36; Tue, 29 Mar 2022 15:24:01 -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=@linux.microsoft.com header.s=default header.b=IdcQGez5; 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=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239987AbiC2Q7J (ORCPT + 99 others); Tue, 29 Mar 2022 12:59:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231454AbiC2Q7I (ORCPT ); Tue, 29 Mar 2022 12:59:08 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 76BEAB0D13; Tue, 29 Mar 2022 09:57:25 -0700 (PDT) Received: from kbox (c-73-140-2-214.hsd1.wa.comcast.net [73.140.2.214]) by linux.microsoft.com (Postfix) with ESMTPSA id D622820DECF5; Tue, 29 Mar 2022 09:57:24 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com D622820DECF5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1648573045; bh=y4az3WkefbkCxNOR94uEneUMzG1hS7Ex1VtRu+4P1Bo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IdcQGez5VpXMC13T34f3NRA32xpcJEd4uifF7Z6OeMFNtGAKR0TqJDL1H9QEkvIOs U+6EQhI2kt56AE62BCRK3yTBQzi0laG/ssqeocAEr+SShu8W7KmUs9driHbH6y3jUh fVXZhAf2HG3/ivXbo6dGbtMKMQK14LavBKD9/4To= Date: Tue, 29 Mar 2022 09:57:18 -0700 From: Beau Belgrave To: Alexei Starovoitov Cc: Mathieu Desnoyers , Linus Torvalds , bpf , Network Development , Beau Belgrave , linux-arch , linux-kernel , linux-trace-devel , rostedt , Masami Hiramatsu , Alexei Starovoitov Subject: Re: Comments on new user events ABI Message-ID: <20220329165718.GA10381@kbox> References: <2059213643.196683.1648499088753.JavaMail.zimbra@efficios.com> <20220329002935.2869-1-beaub@linux.microsoft.com> <1014535694.197402.1648570634323.JavaMail.zimbra@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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 Tue, Mar 29, 2022 at 09:25:52AM -0700, Alexei Starovoitov wrote: > On Tue, Mar 29, 2022 at 9:17 AM Mathieu Desnoyers > wrote: > > > > > > > >> include/uapi/linux/user_events.h: > > >> > > >> struct user_bpf_iter { > > >> > > >> /* Offset of the data within the first iovec */ > > >> __u32 iov_offset; > > >> > > >> /* Number of iovec structures */ > > >> __u32 nr_segs; > > >> > > >> /* Pointer to iovec structures */ > > >> const struct iovec *iov; > > >> > > >> ^ a pointer in a uapi header is usually a no-go. This should be a u64. > > >> }; > > >> > > >> include/uapi/linux/user_events.h: > > >> > > >> struct user_bpf_context { > > >> > > >> /* Data type being passed (see union below) */ > > >> __u32 data_type; > > >> > > >> /* Length of the data */ > > >> __u32 data_len; > > >> > > >> /* Pointer to data, varies by data type */ > > >> union { > > >> /* Kernel data (data_type == USER_BPF_DATA_KERNEL) */ > > >> void *kdata; > > >> > > >> /* User data (data_type == USER_BPF_DATA_USER) */ > > >> void *udata; > > >> > > >> /* Direct iovec (data_type == USER_BPF_DATA_ITER) */ > > >> struct user_bpf_iter *iter; > > >> > > >> ^ likewise for the 3 pointers above. Should be u64 in uapi headers. > > >> }; > > >> }; > > >> > > > > > > The bpf structs are only used within a BPF program. At that point the pointer > > > sizes should all align, right? > > > > I must admit I do not know enough about the eBPF uapi practices to answer this. > > [CCing Alexei on this] > > Mathieu, > > Thanks for flagging. > > Whoever added this user_bpf* stuff please remove it immediately. > It was never reviewed by bpf maintainers. > > It's a hard Nack to add a bpf interface to user_events. Sorry about that, I'm sending a patch to remove this. I'll have another patch to add it back in out to bpf and trace-devel for review. Thanks, -Beau