Re: [PATCH v2 1/3] x86/boot: Introduce the kernel_info
From: H. Peter Anvin
Date: Mon Sep 30 2019 - 16:46:27 EST
On 2019-09-30 08:01, Daniel Kiper wrote:
>
> OK.
>
>> field for the entire .kernel_info section, thus ensuring it is a
>> single self-contained blob.
>
> .rodata.kernel_info contains its total size immediately behind the
> "InfO" header. Do you suggest that we should add the size of
> .rodata.kernel_info into setup_header too?
>
No, what I want is a chunked architecture for kernel_info.
That is:
/* Common chunk header */
struct kernel_info_header {
uint32_t magic;
uint32_t len;
};
/* Top-level chunk, always first */
#define KERNEL_INFO_MAGIC 0x45fdbe4f
struct kernel_info {
struct kernel_info_header hdr;
uint32_t total_size; /* Total size of all chunks */
/* Various fixed-sized data objects, OR offsets to other chunks */
};
Also "InfO" is a pretty hideous magic. In general, all-ASCII magics have much
higher risk of collision than *RANDOM* binary numbers. However, for a chunked
architecture they do have the advantage that they can be used also as a human
name or file name for the chunk, e.,g. in sysfs, so maybe something like
"LnuX" or even "LToP" for the top-level chunk might make sense.
How does that sound?
-hpa