Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kho/abi: add memblock ABI header

Introduce KHO ABI header describing preservation ABI for memblock's
reserve_mem regions and link the relevant documentation to KHO docs.

[lukas.bulwahn@redhat.com: MAINTAINERS: adjust file entry in MEMBLOCK AND MEMORY MANAGEMENT INITIALIZATION]
Link: https://lkml.kernel.org/r/20260107090438.22901-1-lukas.bulwahn@redhat.com
[rppt@kernel.org: update reserved_mem node description, per Pratyush]
Link: https://lkml.kernel.org/r/aW_M-HYZzx5SkbnZ@kernel.org
Link: https://lkml.kernel.org/r/20260105165839.285270-7-rppt@kernel.org
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Cc: Alexander Graf <graf@amazon.com>
Cc: Jason Miu <jasonmiu@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Mike Rapoport (Microsoft) and committed by
Andrew Morton
dd1e79ef ac2d8102

+81 -83
+6
Documentation/core-api/kho/abi.rst
··· 16 16 .. kernel-doc:: include/linux/kho/abi/kexec_handover.h 17 17 :doc: Kexec Handover ABI for vmalloc Preservation 18 18 19 + memblock preservation ABI 20 + ========================= 21 + 22 + .. kernel-doc:: include/linux/kho/abi/memblock.h 23 + :doc: memblock kexec handover ABI 24 + 19 25 See Also 20 26 ======== 21 27
-39
Documentation/core-api/kho/bindings/memblock/memblock.yaml
··· 1 - # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 - %YAML 1.2 3 - --- 4 - title: Memblock reserved memory 5 - 6 - maintainers: 7 - - Mike Rapoport <rppt@kernel.org> 8 - 9 - description: | 10 - Memblock can serialize its current memory reservations created with 11 - reserve_mem command line option across kexec through KHO. 12 - The post-KHO kernel can then consume these reservations and they are 13 - guaranteed to have the same physical address. 14 - 15 - properties: 16 - compatible: 17 - enum: 18 - - reserve-mem-v1 19 - 20 - patternProperties: 21 - "$[0-9a-f_]+^": 22 - $ref: reserve-mem.yaml# 23 - description: reserved memory regions 24 - 25 - required: 26 - - compatible 27 - 28 - additionalProperties: false 29 - 30 - examples: 31 - - | 32 - memblock { 33 - compatible = "memblock-v1"; 34 - n1 { 35 - compatible = "reserve-mem-v1"; 36 - start = <0xc06b 0x4000000>; 37 - size = <0x04 0x00>; 38 - }; 39 - };
-40
Documentation/core-api/kho/bindings/memblock/reserve-mem.yaml
··· 1 - # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 - %YAML 1.2 3 - --- 4 - title: Memblock reserved memory regions 5 - 6 - maintainers: 7 - - Mike Rapoport <rppt@kernel.org> 8 - 9 - description: | 10 - Memblock can serialize its current memory reservations created with 11 - reserve_mem command line option across kexec through KHO. 12 - This object describes each such region. 13 - 14 - properties: 15 - compatible: 16 - enum: 17 - - reserve-mem-v1 18 - 19 - start: 20 - description: | 21 - physical address (u64) of the reserved memory region. 22 - 23 - size: 24 - description: | 25 - size (u64) of the reserved memory region. 26 - 27 - required: 28 - - compatible 29 - - start 30 - - size 31 - 32 - additionalProperties: false 33 - 34 - examples: 35 - - | 36 - n1 { 37 - compatible = "reserve-mem-v1"; 38 - start = <0xc06b 0x4000000>; 39 - size = <0x04 0x00>; 40 - };
+1 -1
MAINTAINERS
··· 16396 16396 T: git git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock.git for-next 16397 16397 T: git git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock.git fixes 16398 16398 F: Documentation/core-api/boot-time-mm.rst 16399 - F: Documentation/core-api/kho/bindings/memblock/* 16399 + F: include/linux/kho/abi/memblock.h 16400 16400 F: include/linux/memblock.h 16401 16401 F: mm/bootmem_info.c 16402 16402 F: mm/memblock.c
+73
include/linux/kho/abi/memblock.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + 3 + #ifndef _LINUX_KHO_ABI_MEMBLOCK_H 4 + #define _LINUX_KHO_ABI_MEMBLOCK_H 5 + 6 + /** 7 + * DOC: memblock kexec handover ABI 8 + * 9 + * Memblock can serialize its current memory reservations created with 10 + * reserve_mem command line option across kexec through KHO. 11 + * The post-KHO kernel can then consume these reservations and they are 12 + * guaranteed to have the same physical address. 13 + * 14 + * The state is serialized using Flattened Device Tree (FDT) format. Any 15 + * modification to the FDT structure, node properties, or the compatible 16 + * strings constitutes a breaking change. Such changes require incrementing the 17 + * version number in the relevant `_COMPATIBLE` string to prevent a new kernel 18 + * from misinterpreting data from an old kernel. 19 + * 20 + * Changes are allowed provided the compatibility version is incremented. 21 + * However, backward/forward compatibility is only guaranteed for kernels 22 + * supporting the same ABI version. 23 + * 24 + * FDT Structure Overview: 25 + * The entire memblock state is encapsulated within a single KHO entry named 26 + * "memblock". 27 + * This entry contains an FDT with the following layout: 28 + * 29 + * .. code-block:: none 30 + * 31 + * / { 32 + * compatible = "memblock-v1"; 33 + * 34 + * n1 { 35 + * compatible = "reserve-mem-v1"; 36 + * start = <0xc06b 0x4000000>; 37 + * size = <0x04 0x00>; 38 + * }; 39 + * }; 40 + * 41 + * Main memblock node (/): 42 + * 43 + * - compatible: "memblock-v1" 44 + 45 + * Identifies the overall memblock ABI version. 46 + * 47 + * reserved_mem node: 48 + * These nodes describe all reserve_mem regions. The node name is the name 49 + * defined by the user for a reserve_mem region. 50 + * 51 + * - compatible: "reserve-mem-v1" 52 + * 53 + * Identifies the ABI version of reserve_mem descriptions 54 + * 55 + * - start: u64 56 + * 57 + * Physical address of the reserved memory region. 58 + * 59 + * - size: u64 60 + * 61 + * size in bytes of the reserved memory region. 62 + */ 63 + 64 + /* Top level memblock FDT node name. */ 65 + #define MEMBLOCK_KHO_FDT "memblock" 66 + 67 + /* The compatible string for the memblock FDT root node. */ 68 + #define MEMBLOCK_KHO_NODE_COMPATIBLE "memblock-v1" 69 + 70 + /* The compatible string for the reserve_mem FDT nodes. */ 71 + #define RESERVE_MEM_KHO_NODE_COMPATIBLE "reserve-mem-v1" 72 + 73 + #endif /* _LINUX_KHO_ABI_MEMBLOCK_H */
+1 -3
mm/memblock.c
··· 21 21 #ifdef CONFIG_KEXEC_HANDOVER 22 22 #include <linux/libfdt.h> 23 23 #include <linux/kexec_handover.h> 24 + #include <linux/kho/abi/memblock.h> 24 25 #endif /* CONFIG_KEXEC_HANDOVER */ 25 26 26 27 #include <asm/sections.h> ··· 2443 2442 } 2444 2443 2445 2444 #ifdef CONFIG_KEXEC_HANDOVER 2446 - #define MEMBLOCK_KHO_FDT "memblock" 2447 - #define MEMBLOCK_KHO_NODE_COMPATIBLE "memblock-v1" 2448 - #define RESERVE_MEM_KHO_NODE_COMPATIBLE "reserve-mem-v1" 2449 2445 2450 2446 static int __init reserved_mem_preserve(void) 2451 2447 {