Re: [PATCH 1/5] x86/boot: Initialize boot_params in startup code

Arvind Sankar
2020-10-08T13:45:03Z

On Thu, Oct 08, 2020 at 11:04:20AM +0200, Joerg Roedel wrote:
> On Wed, Oct 07, 2020 at 03:53:47PM -0400, Arvind Sankar wrote:
> > Save the boot_params pointer passed in by the bootloader in
> > startup_32/64. This avoids having to initialize it in two different
> > places in C code, and having to preserve SI through the early assembly
> > code.
> >
> > Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
>
> Nice cleanup!
>
> > /*
> > * Jump to the extracted kernel.
> > */
> > - xorl %ebx, %ebx
> > + movl boot_params@GOTOFF(%ebx), %esi
> > jmp *%eax
> > SYM_FUNC_END(.Lrelocated)
> >
> > @@ -209,6 +208,8 @@ SYM_DATA_START_LOCAL(gdt)
> > .quad 0x00cf92000000ffff /* __KERNEL_DS */
> > SYM_DATA_END_LABEL(gdt, SYM_L_LOCAL, gdt_end)
> >
> > +SYM_DATA(boot_params, .long 0)
> > +
>
> You should add a comment here that boot_params needs to be in the .data
> section because in .bss it would get zeroed out again later. Same
> applies to the 64bit version of this.
>
> With that changed:
>
> Reviewed-by: Joerg Roedel <jroedel@suse.de>
>

Ok.