qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hw/x86: add a couple of comments explaining how the kernel image is parsed
@ 2024-07-19 13:49 Ani Sinha
  2024-07-21 14:47 ` Zhao Liu
  0 siblings, 1 reply; 2+ messages in thread
From: Ani Sinha @ 2024-07-19 13:49 UTC (permalink / raw)
  To: Michael S. Tsirkin, Marcel Apfelbaum, Paolo Bonzini,
	Richard Henderson, Eduardo Habkost
  Cc: Ani Sinha, qemu-trivial, qemu-devel

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 <anisinha@redhat.com>
---
 hw/i386/x86-common.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

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 {
         /*
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] hw/x86: add a couple of comments explaining how the kernel image is parsed
  2024-07-19 13:49 [PATCH] hw/x86: add a couple of comments explaining how the kernel image is parsed Ani Sinha
@ 2024-07-21 14:47 ` Zhao Liu
  0 siblings, 0 replies; 2+ messages in thread
From: Zhao Liu @ 2024-07-21 14:47 UTC (permalink / raw)
  To: Ani Sinha
  Cc: Michael S. Tsirkin, Marcel Apfelbaum, Paolo Bonzini,
	Richard Henderson, Eduardo Habkost, qemu-trivial, qemu-devel

On Fri, Jul 19, 2024 at 07:19:37PM +0530, Ani Sinha wrote:
> Date: Fri, 19 Jul 2024 19:19:37 +0530
> From: Ani Sinha <anisinha@redhat.com>
> Subject: [PATCH] hw/x86: add a couple of comments explaining how the kernel
>  image is parsed
> X-Mailer: git-send-email 2.42.0
> 
> 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 <anisinha@redhat.com>
> ---
>  hw/i386/x86-common.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-07-21 14:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-19 13:49 [PATCH] hw/x86: add a couple of comments explaining how the kernel image is parsed Ani Sinha
2024-07-21 14:47 ` Zhao Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).