From: Ani Sinha Date: Fri, 19 Jul 2024 13:49:37 +0000 (+0530) Subject: hw/x86: add a couple of comments explaining how the kernel image is parsed X-Git-Tag: qemu-xen-4.20.0~6^2~2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=80e3541282af347538a37ee0673bcc04c622ad1c;p=qemu-xen.git hw/x86: add a couple of comments explaining how the kernel image is parsed Cosmetic: add comments in x86_load_linux() pointing to the kernel documentation so that users can better understand the code. CC: qemu-trivial@nongnu.org Signed-off-by: Ani Sinha Reviewed-by: Zhao Liu Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c index c0c66a0eb5..992ea1f25e 100644 --- a/hw/i386/x86-common.c +++ b/hw/i386/x86-common.c @@ -665,8 +665,11 @@ void x86_load_linux(X86MachineState *x86ms, exit(1); } - /* kernel protocol version */ - if (ldl_p(header + 0x202) == 0x53726448) { + /* + * kernel protocol version. + * Please see https://www.kernel.org/doc/Documentation/x86/boot.txt + */ + if (ldl_p(header + 0x202) == 0x53726448) /* Magic signature "HdrS" */ { protocol = lduw_p(header + 0x206); } else { /*