From patchwork Tue Aug 2 17:39:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 12934925 X-Patchwork-Delegate: bpf@iogearbox.net 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 293D2C25B06 for ; Tue, 2 Aug 2022 17:39:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232882AbiHBRjW (ORCPT ); Tue, 2 Aug 2022 13:39:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232109AbiHBRjS (ORCPT ); Tue, 2 Aug 2022 13:39:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3FD64B0F4; Tue, 2 Aug 2022 10:39:17 -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 7C55BB81FE5; Tue, 2 Aug 2022 17:39:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 123B2C433B5; Tue, 2 Aug 2022 17:39:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659461955; bh=D+x8CqdaXbsmhEFhqyxFXaNoVxZF5fkQARi2WHcJmQM=; h=From:To:Cc:Subject:Date:From; b=CaQZluMzk/FwdJj1MolEVOBu/Rep66UaOgD3Casl7Xx0IdzE4yO9ln/B1NjI9AIME R9Napl9UmEvg0AdIQeQdsf7m28/sUSpx+uztV6hUD+oYQYoEPes43yPzbyd5Y6CDQc 0peYZG7TyoRfudw+MKGLgs8mfW+x0AA9OFOCwvCpRAAwTswZ4Rp4CTWONaV8mgRk/z ckLQ+bhCf2LWKV6LUpQOzSYYIGUP/H2Hb6+lHygbVyNpgyB6/2hqX3rNdPcaDSGzB8 nkGuHZjux34Sl75F++zlGRZR13FEEixVWN9suSvMUvitY/Vj2JKg2hpm+Tia9zzEAm qikbvp073D8Aw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id B33F05C0369; Tue, 2 Aug 2022 10:39:14 -0700 (PDT) From: "Paul E. McKenney" To: bpf@vger.kernel.org, netdev@vger.kernel.org, linux-doc@vger.kernel.org Cc: corbet@lwn.net, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, kernel-team@fb.com, "Paul E. McKenney" Subject: [PATCH v3 bpf 1/3] bpf: Update bpf_design_QA.rst to clarify that kprobes is not ABI Date: Tue, 2 Aug 2022 10:39:11 -0700 Message-Id: <20220802173913.4170192-1-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net This patch updates bpf_design_QA.rst to clarify that the ability to attach a BPF program to a given point in the kernel code via kprobes does not make that attachment point be part of the Linux kernel's ABI. Signed-off-by: Paul E. McKenney --- Documentation/bpf/bpf_design_QA.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/bpf/bpf_design_QA.rst b/Documentation/bpf/bpf_design_QA.rst index 437de2a7a5de7..2ed9128cfbec8 100644 --- a/Documentation/bpf/bpf_design_QA.rst +++ b/Documentation/bpf/bpf_design_QA.rst @@ -214,6 +214,12 @@ A: NO. Tracepoints are tied to internal implementation details hence they are subject to change and can break with newer kernels. BPF programs need to change accordingly when this happens. +Q: Are places where kprobes can attach part of the stable ABI? +-------------------------------------------------------------- +A: NO. The places to which kprobes can attach are internal implementation +details, which means that they are subject to change and can break with +newer kernels. BPF programs need to change accordingly when this happens. + Q: How much stack space a BPF program uses? ------------------------------------------- A: Currently all program types are limited to 512 bytes of stack From patchwork Tue Aug 2 17:39:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 12934923 X-Patchwork-Delegate: bpf@iogearbox.net 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 DA350C19F28 for ; Tue, 2 Aug 2022 17:39:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231928AbiHBRjS (ORCPT ); Tue, 2 Aug 2022 13:39:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229690AbiHBRjQ (ORCPT ); Tue, 2 Aug 2022 13:39:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D7ED4B0D8; Tue, 2 Aug 2022 10:39:16 -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 dfw.source.kernel.org (Postfix) with ESMTPS id B610561237; Tue, 2 Aug 2022 17:39:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F530C433D7; Tue, 2 Aug 2022 17:39:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659461955; bh=FoyrG1ZSgKJnTOrE1VYOwsrWEx1RrK04H5tFHcdUZVQ=; h=From:To:Cc:Subject:Date:From; b=TUu4iDrz3DrUo8FNNO8C4m/cOmNQjCSLfHHDce2HS8xmXDvyJ0cnuqkYwXmfQUWS/ tZSBxAwGWPvOGIZzqYajSRjmwILqxtCfegWY0V7JwkNLxrwpw3xmDQdQujnfZnal7e Vo7y8JaxgvRQ/J74Jgku27zQtrGL0nVQvlZNpIpPuei8U5dC4gjy7b62OIDCJ+q9lJ TcaAsO6hEmNDHgZ/RKpsmX/FQTOU66UJfNkZdsQa1mmtALo+6ccDhPUwwbJGa//jnt cCl+moQlsJe187WTXds2JG9vBJeN75DmFjP1fmCepjDcQ4B0/TtxeyYZZcP/zj7548 PEJedS7AJdWyg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id B52515C0155; Tue, 2 Aug 2022 10:39:14 -0700 (PDT) From: "Paul E. McKenney" To: bpf@vger.kernel.org, netdev@vger.kernel.org, linux-doc@vger.kernel.org Cc: corbet@lwn.net, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, kernel-team@fb.com, "Paul E. McKenney" Subject: [PATCH v3 bpf 2/3] bpf: Update bpf_design_QA.rst to clarify that attaching to functions is not ABI Date: Tue, 2 Aug 2022 10:39:12 -0700 Message-Id: <20220802173913.4170192-2-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net This patch updates bpf_design_QA.rst to clarify that the ability to attach a BPF program to an arbitrary function in the kernel does not make that function become part of the Linux kernel's ABI. [ paulmck: Apply Daniel Borkmann feedback. ] Signed-off-by: Paul E. McKenney --- Documentation/bpf/bpf_design_QA.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Documentation/bpf/bpf_design_QA.rst b/Documentation/bpf/bpf_design_QA.rst index 2ed9128cfbec8..a06ae8a828e3d 100644 --- a/Documentation/bpf/bpf_design_QA.rst +++ b/Documentation/bpf/bpf_design_QA.rst @@ -279,3 +279,15 @@ cc (congestion-control) implementations. If any of these kernel functions has changed, both the in-tree and out-of-tree kernel tcp cc implementations have to be changed. The same goes for the bpf programs and they have to be adjusted accordingly. + +Q: Attaching to arbitrary kernel functions is an ABI? +----------------------------------------------------- +Q: BPF programs can be attached to many kernel functions. Do these +kernel functions become part of the ABI? + +A: NO. + +The kernel function prototypes will change, and BPF programs attaching to +them will need to change. The BPF compile-once-run-everywhere (CO-RE) +should be used in order to make it easier to adapt your BPF programs to +different versions of the kernel. From patchwork Tue Aug 2 17:39:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 12934924 X-Patchwork-Delegate: bpf@iogearbox.net 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 BF30EC19F29 for ; Tue, 2 Aug 2022 17:39:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232693AbiHBRjV (ORCPT ); Tue, 2 Aug 2022 13:39:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229690AbiHBRjS (ORCPT ); Tue, 2 Aug 2022 13:39:18 -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 C36474B0D8; Tue, 2 Aug 2022 10:39:17 -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 6ED02B81FE4; Tue, 2 Aug 2022 17:39:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D039C433C1; Tue, 2 Aug 2022 17:39:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659461955; bh=MuBLArNMizvUksBhjYtQXr2Fl8QtF7ViTn25ne4X8Jk=; h=From:To:Cc:Subject:Date:From; b=Owrpy1b6JGbxAj+OZKkLPxy84SMEQ1r8CFVtqfWGqJIHRI8+hUaYD2kSOFnJJ3xNf T10k4SF4f3znZHwaWVNdYX9ireXQREz2j4fwh2HXa19OlQJXzjXQg2mG1OU3g647zC jzlhR6iUy/M6xcx1tA+EpYVyfYQqAVs8A0AI85MvXrRA+ogYcJbubMsaBCBXybKPOU 2iQ9CRiH5q64t1R3b4TMM3E+viFyp3iTs3GnjQ2F/Lc14GHScqIxnuFF60DrA49S0u ZlQlbCR/xHkWMsQzKXCjJt/YyhFTFP/s8mz35Q7B7Lzf5iQTH8pvTQMadpcyQz5i4O 0x8YV4/Dc0z3g== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id B6AF55C0830; Tue, 2 Aug 2022 10:39:14 -0700 (PDT) From: "Paul E. McKenney" To: bpf@vger.kernel.org, netdev@vger.kernel.org, linux-doc@vger.kernel.org Cc: corbet@lwn.net, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, kernel-team@fb.com, "Paul E. McKenney" , Alexei Starovoitov Subject: [PATCH v3 bpf 3/3] bpf: Update bpf_design_QA.rst to clarify that BTF_ID does not ABIify a function Date: Tue, 2 Aug 2022 10:39:13 -0700 Message-Id: <20220802173913.4170192-3-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net This patch updates bpf_design_QA.rst to clarify that mentioning a function to the BTF_ID macro does not make that function become part of the Linux kernel's ABI. Suggested-by: Alexei Starovoitov Signed-off-by: Paul E. McKenney --- Documentation/bpf/bpf_design_QA.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/bpf/bpf_design_QA.rst b/Documentation/bpf/bpf_design_QA.rst index a06ae8a828e3d..a210b8a4df005 100644 --- a/Documentation/bpf/bpf_design_QA.rst +++ b/Documentation/bpf/bpf_design_QA.rst @@ -291,3 +291,10 @@ The kernel function prototypes will change, and BPF programs attaching to them will need to change. The BPF compile-once-run-everywhere (CO-RE) should be used in order to make it easier to adapt your BPF programs to different versions of the kernel. + +Q: Marking a function with BTF_ID makes that function an ABI? +------------------------------------------------------------- +A: NO. + +The BTF_ID macro does not cause a function to become part of the ABI +any more than does the EXPORT_SYMBOL_GPL macro.