From patchwork Thu Feb 6 13:27:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13963132 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9EB91C02194 for ; Thu, 6 Feb 2025 13:54:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=d2NqMw/5VR+un3i5cyW8rSGlyShyy5beN9EqcYd6H7I=; b=hPQYoRuNjSH45YHmZeKbCrNqpN Di+g8gOmPUQq2FK/V/tBKHYduRY0ySma5KlHRsRLpncDc8BcG0j4MVixUHyzFIk7aHf15HqsWCBtw MZy+NTq88UyI6XmGSJ4+hCZ0L4JP0MyhhouUGzIe1zg7Vda+TD+F0rJnh11rL4U+qqM88gDB2/yze ZMQttTt4sXMeWXGTNQAGnreu4Yt/XrhwCTsFaqc9I/bBeH07N169SN+ZH5K/yhhtWsasrlnItcNKY QmUBV07y3JHMNeg5/0vIlfJrjaSlr6012z5yCF+1uG1XR9QoroqbxC3bi2+5s0nyuNkrkaHuY2fTQ d3OPT8GQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tg2L9-00000006UmP-1Vzt; Thu, 06 Feb 2025 13:54:47 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tg1xT-00000006RFn-1WUK; Thu, 06 Feb 2025 13:30:20 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 955A5A43E68; Thu, 6 Feb 2025 13:28:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBB81C4CEE8; Thu, 6 Feb 2025 13:30:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738848618; bh=DEPWTj2lMxZNBMBbVuId7YwohjOTilwE4mRuWlbJrXA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JHyCveIB+H+hP369+oAVupUsNOhw1rXCFbz/HMMrekGHYAW5g4PNpWIwrA8MwexgL 4yMDEsor1brMgVYnrKTNOKQMYqerjM3u2rtawVm++rzJDLZojHWhKDBkq33U5MfHSV NQtV2EFA/lMKTVnsQP2JZSAaMs3oEfA7VLfyV889coTXhhEVxMdqkij+tqxaqUj2Tc +ihizHttzw+XGMKcXveRsjk85ki9HH1SFWo0iThELJ22q8Xi9jHv9Q91sHpsMVossU ZgFgJe+G3yxv9QmNthG7QhvnBHAriJsMyUex426XIiM46CWpwr37AZ05MfQc08FbZ1 R1sab0YI6csgw== From: Mike Rapoport To: linux-kernel@vger.kernel.org Cc: Alexander Graf , Andrew Morton , Andy Lutomirski , Anthony Yznaga , Arnd Bergmann , Ashish Kalra , Benjamin Herrenschmidt , Borislav Petkov , Catalin Marinas , Dave Hansen , David Woodhouse , Eric Biederman , Ingo Molnar , James Gowans , Jonathan Corbet , Krzysztof Kozlowski , Mark Rutland , Mike Rapoport , Paolo Bonzini , Pasha Tatashin , "H. Peter Anvin" , Peter Zijlstra , Pratyush Yadav , Rob Herring , Rob Herring , Saravana Kannan , Stanislav Kinsburskii , Steven Rostedt , Thomas Gleixner , Tom Lendacky , Usama Arif , Will Deacon , devicetree@vger.kernel.org, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org Subject: [PATCH v4 14/14] Documentation: KHO: Add memblock bindings Date: Thu, 6 Feb 2025 15:27:54 +0200 Message-ID: <20250206132754.2596694-15-rppt@kernel.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250206132754.2596694-1-rppt@kernel.org> References: <20250206132754.2596694-1-rppt@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250206_053019_526183_2A3A46E1 X-CRM114-Status: GOOD ( 19.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Mike Rapoport (Microsoft)" We introduced KHO into Linux: A framework that allows Linux to pass metadata and memory across kexec from Linux to Linux. KHO reuses fdt as file format and shares a lot of the same properties of firmware-to- Linux boot formats: It needs a stable, documented ABI that allows for forward and backward compatibility as well as versioning. As first user of KHO, we introduced memblock which can now preserve memory ranges reserved with reserve_mem command line options contents across kexec, so you can use the post-kexec kernel to read traces from the pre-kexec kernel. This patch adds memblock schemas similar to "device" device tree ones to a new kho bindings directory. This allows us to force contributors to document the data that moves across KHO kexecs and catch breaking change during review. Co-developed-by: Alexander Graf Signed-off-by: Alexander Graf Signed-off-by: Mike Rapoport (Microsoft) --- .../kho/bindings/memblock/reserve_mem.yaml | 41 ++++++++++++++++++ .../bindings/memblock/reserve_mem_map.yaml | 42 +++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 Documentation/kho/bindings/memblock/reserve_mem.yaml create mode 100644 Documentation/kho/bindings/memblock/reserve_mem_map.yaml diff --git a/Documentation/kho/bindings/memblock/reserve_mem.yaml b/Documentation/kho/bindings/memblock/reserve_mem.yaml new file mode 100644 index 000000000000..7b01791b10b3 --- /dev/null +++ b/Documentation/kho/bindings/memblock/reserve_mem.yaml @@ -0,0 +1,41 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/memblock/reserve_mem.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Memblock reserved memory + +maintainers: + - Mike Rapoport + +description: | + Memblock can serialize its current memory reservations created with + reserve_mem command line option across kexec through KHO. + The post-KHO kernel can then consume these reservations and they are + guaranteed to have the same physical address. + +properties: + compatible: + enum: + - reserve_mem-v1 + +patternProperties: + "$[0-9a-f_]+^": + $ref: reserve_mem_map.yaml# + description: reserved memory regions + +required: + - compatible + +additionalProperties: false + +examples: + - | + reserve_mem { + compatible = "reserve_mem-v1"; + r1 { + compatible = "reserve_mem_map-v1"; + mem = <0xc07c 0x2000000 0x01 0x00>; + }; + }; diff --git a/Documentation/kho/bindings/memblock/reserve_mem_map.yaml b/Documentation/kho/bindings/memblock/reserve_mem_map.yaml new file mode 100644 index 000000000000..09001c5f2124 --- /dev/null +++ b/Documentation/kho/bindings/memblock/reserve_mem_map.yaml @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/memblock/reserve_mem_map.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Memblock reserved memory regions + +maintainers: + - Mike Rapoport + +description: | + Memblock can serialize its current memory reservations created with + reserve_mem command line option across kexec through KHO. + This object describes each such region. + +properties: + compatible: + enum: + - reserve_mem_map-v1 + + mem: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: | + Array of { u64 phys_addr, u64 len } elements that describe a list of + memory ranges. + +required: + - compatible + - mem + +additionalProperties: false + +examples: + - | + reserve_mem { + compatible = "reserve_mem-v1"; + r1 { + compatible = "reserve_mem_map-v1"; + mem = <0xc07c 0x2000000 0x01 0x00>; + }; + };