|
32 | 32 | * / { |
33 | 33 | * compatible = "luo-v1"; |
34 | 34 | * liveupdate-number = <...>; |
| 35 | + * |
| 36 | + * luo-session { |
| 37 | + * compatible = "luo-session-v1"; |
| 38 | + * luo-session-header = <phys_addr_of_session_header_ser>; |
| 39 | + * }; |
35 | 40 | * }; |
36 | 41 | * |
37 | 42 | * Main LUO Node (/): |
|
40 | 45 | * Identifies the overall LUO ABI version. |
41 | 46 | * - liveupdate-number: u64 |
42 | 47 | * A counter tracking the number of successful live updates performed. |
| 48 | + * |
| 49 | + * Session Node (luo-session): |
| 50 | + * This node describes all preserved user-space sessions. |
| 51 | + * |
| 52 | + * - compatible: "luo-session-v1" |
| 53 | + * Identifies the session ABI version. |
| 54 | + * - luo-session-header: u64 |
| 55 | + * The physical address of a `struct luo_session_header_ser`. This structure |
| 56 | + * is the header for a contiguous block of memory containing an array of |
| 57 | + * `struct luo_session_ser`, one for each preserved session. |
| 58 | + * |
| 59 | + * Serialization Structures: |
| 60 | + * The FDT properties point to memory regions containing arrays of simple, |
| 61 | + * `__packed` structures. These structures contain the actual preserved state. |
| 62 | + * |
| 63 | + * - struct luo_session_header_ser: |
| 64 | + * Header for the session array. Contains the total page count of the |
| 65 | + * preserved memory block and the number of `struct luo_session_ser` |
| 66 | + * entries that follow. |
| 67 | + * |
| 68 | + * - struct luo_session_ser: |
| 69 | + * Metadata for a single session, including its name and a physical pointer |
| 70 | + * to another preserved memory block containing an array of |
| 71 | + * `struct luo_file_ser` for all files in that session. |
43 | 72 | */ |
44 | 73 |
|
45 | 74 | #ifndef _LINUX_KHO_ABI_LUO_H |
46 | 75 | #define _LINUX_KHO_ABI_LUO_H |
47 | 76 |
|
| 77 | +#include <uapi/linux/liveupdate.h> |
| 78 | + |
48 | 79 | /* |
49 | 80 | * The LUO FDT hooks all LUO state for sessions, fds, etc. |
50 | 81 | * In the root it also carries "liveupdate-number" 64-bit property that |
|
55 | 86 | #define LUO_FDT_COMPATIBLE "luo-v1" |
56 | 87 | #define LUO_FDT_LIVEUPDATE_NUM "liveupdate-number" |
57 | 88 |
|
| 89 | +/* |
| 90 | + * LUO FDT session node |
| 91 | + * LUO_FDT_SESSION_HEADER: is a u64 physical address of struct |
| 92 | + * luo_session_header_ser |
| 93 | + */ |
| 94 | +#define LUO_FDT_SESSION_NODE_NAME "luo-session" |
| 95 | +#define LUO_FDT_SESSION_COMPATIBLE "luo-session-v1" |
| 96 | +#define LUO_FDT_SESSION_HEADER "luo-session-header" |
| 97 | + |
| 98 | +/** |
| 99 | + * struct luo_session_header_ser - Header for the serialized session data block. |
| 100 | + * @count: The number of `struct luo_session_ser` entries that immediately |
| 101 | + * follow this header in the memory block. |
| 102 | + * |
| 103 | + * This structure is located at the beginning of a contiguous block of |
| 104 | + * physical memory preserved across the kexec. It provides the necessary |
| 105 | + * metadata to interpret the array of session entries that follow. |
| 106 | + * |
| 107 | + * If this structure is modified, `LUO_FDT_SESSION_COMPATIBLE` must be updated. |
| 108 | + */ |
| 109 | +struct luo_session_header_ser { |
| 110 | + u64 count; |
| 111 | +} __packed; |
| 112 | + |
| 113 | +/** |
| 114 | + * struct luo_session_ser - Represents the serialized metadata for a LUO session. |
| 115 | + * @name: The unique name of the session, provided by the userspace at |
| 116 | + * the time of session creation. |
| 117 | + * |
| 118 | + * This structure is used to package session-specific metadata for transfer |
| 119 | + * between kernels via Kexec Handover. An array of these structures (one per |
| 120 | + * session) is created and passed to the new kernel, allowing it to reconstruct |
| 121 | + * the session context. |
| 122 | + * |
| 123 | + * If this structure is modified, `LUO_FDT_SESSION_COMPATIBLE` must be updated. |
| 124 | + */ |
| 125 | +struct luo_session_ser { |
| 126 | + char name[LIVEUPDATE_SESSION_NAME_LENGTH]; |
| 127 | +} __packed; |
| 128 | + |
58 | 129 | #endif /* _LINUX_KHO_ABI_LUO_H */ |
0 commit comments