From patchwork Tue Jul 26 23:44:00 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: 12929925 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 B5C8AC3F6B0 for ; Tue, 26 Jul 2022 23:44:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240022AbiGZXoI (ORCPT ); Tue, 26 Jul 2022 19:44:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239904AbiGZXoH (ORCPT ); Tue, 26 Jul 2022 19:44:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A159220F4; Tue, 26 Jul 2022 16:44:05 -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 4937AB81EF9; Tue, 26 Jul 2022 23:44:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5BC6C433C1; Tue, 26 Jul 2022 23:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658879043; bh=D+x8CqdaXbsmhEFhqyxFXaNoVxZF5fkQARi2WHcJmQM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y9EsrFidVTHX3mXXL+nFaGsFpVhTLpamPzuJMkHWSGIn6d4e9NCMeLSHk5OfyV03R rhI0tGt0ZJ3cE0cfb+QB/1yVzDMZuxuYlShPMbiib03tmAPWNKtbKQ6cjrRMRFN5VK WJg/VqCokNMNjw3f+Z1OneBOPSGdIYitKegbrqalA2yObAsU9TX5XefzT/0oRcyGCt unnzoAjDhpyHtXrXPmPve6P8Q/RJf+YLx33QboNHKwD0OMRFswn8XnOR8wB+W6oPFo tvltXU9e4EeCWjpWstIHcdJJs8ZxuFvlK/Qs/JVWV54mnblCrynjCOixAvsbNfVET2 RcCbiYJnzxQxA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 9DCED5C02F9; Tue, 26 Jul 2022 16:44:02 -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 v2 bpf 1/2] bpf: Update bpf_design_QA.rst to clarify that kprobes is not ABI Date: Tue, 26 Jul 2022 16:44:00 -0700 Message-Id: <20220726234401.3425557-1-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220722212346.GD2860372@paulmck-ThinkPad-P17-Gen-1> References: <20220722212346.GD2860372@paulmck-ThinkPad-P17-Gen-1> 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 Jul 26 23:44:01 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: 12929926 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 A6C63C19F2B for ; Tue, 26 Jul 2022 23:44:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240026AbiGZXoJ (ORCPT ); Tue, 26 Jul 2022 19:44:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239920AbiGZXoH (ORCPT ); Tue, 26 Jul 2022 19:44:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C97DF22511; Tue, 26 Jul 2022 16:44:05 -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 6FBF4B81F0C; Tue, 26 Jul 2022 23:44:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EAFC2C433D7; Tue, 26 Jul 2022 23:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658879043; bh=FoyrG1ZSgKJnTOrE1VYOwsrWEx1RrK04H5tFHcdUZVQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qnw7D0K/2S3xHB8E1XlQo3MsWKrlc/yb5JfpC2qYfn3tIfZLCcDpy8jnyi2XqkdFx oPH/26ZSHQsdMjH0WPzWVAwtzVHg5nvJlLAV2b9RWzLA9hlugZr3eEBOaqQJbLyv92 cHFU0zDCJToId772FpQJW+tZ6BiJRC8zCkJYdojPAkhSQNEgKFJMhHACmcVOX1mbYZ 0J6kWmZbx7t+OTHQZk5drOvbg+5pYxIyxk9g8FYPr4TPjc5fJXZcxc6DRXUoMiMcfo 0NtkuBYoNcMTU+v2M2wf84pQM9rzVOXUc48tecqeKZ7ejvCck0c/f8UQnQscDPUSAb xEmsALrM7JIQw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id A02575C0369; Tue, 26 Jul 2022 16:44:02 -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 v2 bpf 2/2] bpf: Update bpf_design_QA.rst to clarify that attaching to functions is not ABI Date: Tue, 26 Jul 2022 16:44:01 -0700 Message-Id: <20220726234401.3425557-2-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220726234401.3425557-1-paulmck@kernel.org> References: <20220722212346.GD2860372@paulmck-ThinkPad-P17-Gen-1> <20220726234401.3425557-1-paulmck@kernel.org> 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.