From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCFB1C02194 for ; Thu, 6 Feb 2025 13:30:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 78F9228000D; Thu, 6 Feb 2025 08:30:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 73E06280005; Thu, 6 Feb 2025 08:30:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5B76C28000D; Thu, 6 Feb 2025 08:30:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 388AF280005 for ; Thu, 6 Feb 2025 08:30:21 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id EA3ACB0CDA for ; Thu, 6 Feb 2025 13:30:20 +0000 (UTC) X-FDA: 83089603800.27.AF5C62C Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf09.hostedemail.com (Postfix) with ESMTP id 4DD59140060 for ; Thu, 6 Feb 2025 13:30:19 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=JHyCveIB; spf=pass (imf09.hostedemail.com: domain of rppt@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1738848619; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=d2NqMw/5VR+un3i5cyW8rSGlyShyy5beN9EqcYd6H7I=; b=YAwtCZJvjWikx49PUpXDe2pgLhZc6hfhDj5NWegazrAAZQd69BuxcGDBecAmi/OWnN1dDm u4ggwR6QUq2P74DXYH+jk4ziVZAcb+Nhcs0Ofb4GzAC+q4C9iut8hZAlz/wQpLg5ke4cTY fdzAbruMoq52pUt2Ab8H+9R6gb0uZkM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1738848619; a=rsa-sha256; cv=none; b=cIWVHzDyobLpAJSEcKKb7D+uDeuhq62mqMrCtNXt+4GOSe12hUQ6iEzmnzH/CFjm7O7WKb Sr13TUMhVRYkZG2ZJt3n7En3pgxCDEN/AG2gnG6gW6Fr9ph4UCss8DEDbwuasIiB5WVo0N I3kKPm28fp3mUATdZjN5OWS3d00f4Hk= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=JHyCveIB; spf=pass (imf09.hostedemail.com: domain of rppt@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org 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 Content-Transfer-Encoding: 8bit X-Stat-Signature: 1htrzsijzf91bri44dteo8rmntk9uh1c X-Rspam-User: X-Rspamd-Queue-Id: 4DD59140060 X-Rspamd-Server: rspam03 X-HE-Tag: 1738848619-542190 X-HE-Meta: U2FsdGVkX1/kIkhX7ckeUjc0rjbUw8TwUpncfG/n+Q2pnJ7QP7Y4vEi6dv+6M2WgDAd33S132ZENsuOj5BS32qKTYIHQevBk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QALx2vUHgvkIpam3WQibLAsK+DoIBwvyCZryLHVBysUIDR4GA8m1yg9FtoDb/3Xi7yhK3zYN7N5Vo/gP7qFi7FAY8g+3W+cIHyJFQOFC1d7ecvrL+2+De24xdSS35Z/eWisgOot+mYStJqPu7h0K3vh/o0F6ttab2ok6q850LKyO2sahfgWR4fXnJDfwTSn X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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>; + }; + }; -- 2.47.2