lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMzpN2j+nz60C7irRvXF4Ni94Wj9mcLGoPe6BF7Y6FPbeV2xqg@mail.gmail.com>
Date: Mon, 23 Jun 2025 13:58:15 -0400
From: Brian Gerst <brgerst@...il.com>
To: Khalid Ali <khaliidcaliy@...il.com>
Cc: hpa@...or.com, tglx@...utronix.de, mingo@...hat.com, bp@...en8.de, 
	dave.hansen@...ux.intel.com, ubizjak@...il.com, x86@...nel.org, 
	linux-efi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 1/3] Recieve boot_param from RDI Instead of RSI

On Mon, Jun 23, 2025 at 12:27 PM Khalid Ali <khaliidcaliy@...il.com> wrote:
>
> > On June 23, 2025 1:15:23 AM PDT, Khalid Ali <khaliidcaliy@...il.com> wrote:
> > >From: Khalid Ali <khaliidcaliy@...il.com>
> > >
> > >Adjust the kernel entry point to recieve arguments from RDI instead of
> > >RSI.
> > >
> > >Signed-off-by: Khalid Ali <khaliidcaliy@...il.com>
> > >---
> > > arch/x86/kernel/head_64.S | 4 ++--
> > > 1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > >diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
> > >index dfb5390e5c9a..d24fea15b6a6 100644
> > >--- a/arch/x86/kernel/head_64.S
> > >+++ b/arch/x86/kernel/head_64.S
> > >@@ -43,7 +43,7 @@ SYM_CODE_START_NOALIGN(startup_64)
> > >        * for us.  These identity mapped page tables map all of the
> > >        * kernel pages and possibly all of memory.
> > >        *
> > >-       * %RSI holds the physical address of the boot_params structure
> > >+       * %RDI holds the physical address of the boot_params structure
> > >        * provided by the bootloader. Preserve it in %R15 so C function calls
> > >        * will not clobber it.
> > >        *
> > >@@ -56,7 +56,7 @@ SYM_CODE_START_NOALIGN(startup_64)
> > >        * compiled to run at we first fixup the physical addresses in our page
> > >        * tables and then reload them.
> > >        */
> > >-      mov     %rsi, %r15
> > >+      mov     %rdi, %r15
> > >
> > >       /* Set up the stack for verify_cpu() */
> > >       leaq    __top_init_kernel_stack(%rip), %rsp
>
> > This is an ABI.
> >
> > Nacked-by: H. Peter Anvin <hpa@...or.com>
>
> Peter, thanks for the response but if i ask you:
> What is specific reason that this patch is wrong?
> Why used RSI instead of RDI at the first place?

It is defined in Documentation/arch/x86/boot.rst

IIRC some hypervisors can boot the uncompressed image directly.


Brian Gerst

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ