mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@amd.com>
To: Neal Frager <neal.frager@amd.com>, linux-kernel@vger.kernel.org
Cc: gopi@sankhya.com
Subject: Re: [PATCH v1 1/1] arch: microblaze: allocate stack space for register params
Date: Tue, 21 Apr 2026 10:47:54 +0200	[thread overview]
Message-ID: <7689d8f0-c386-4e3f-baa8-ac6a8bf1c618@amd.com> (raw)
In-Reply-To: <20260327085427.1869383-1-neal.frager@amd.com>



On 3/27/26 09:54, Neal Frager wrote:
> C functions are invoked with arguments without allocating stack space for
> register params (for potential register spills). As a result kernel built
> with gcc v15 boot hangs at the point of starting init -.

Remove -.

> 
> This patch adds necessary stack space for few C function calls from entry.S

Add necessary.

> (not all). After this patch, the kernel boots all the way to login prompt and
> root login works. Simple commands like ps work and show normal output.
> 
> Signed-off-by: Gopi Kumar Bulusu <gopi@sankhya.com>
> Tested-by: Neal Frager <neal.frager@amd.com>

If you are sending it you should have sob line here.

> ---
>   arch/microblaze/kernel/entry.S | 20 ++++++++++++++------
>   1 file changed, 14 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/microblaze/kernel/entry.S b/arch/microblaze/kernel/entry.S
> index 582d7256d815..2f9604640486 100644
> --- a/arch/microblaze/kernel/entry.S
> +++ b/arch/microblaze/kernel/entry.S
> @@ -339,6 +339,9 @@ C_ENTRY(mb_invalidate_icache):
>    * Trap entered via brki instruction, so BIP bit is set, and interrupts
>    * are masked. This is nice, means we don't have to CLI before state save
>    */
> +
> +#define SYSCALL_ARGS_SIZE 36
> +
>   C_ENTRY(_user_exception):
>   	swi	r1, r0, TOPHYS(PER_CPU(ENTRY_SP)) /* save stack */
>   	addi	r14, r14, 4	/* return address is 4 byte after call */
> @@ -422,16 +425,19 @@ C_ENTRY(_user_exception):
>   	lwi	r12, r12, sys_call_table
>   	/* where the trap should return need -8 to adjust for rtsd r15, 8 */
>   	addi	r15, r0, ret_from_trap-8
> +	addik 	r1, r1, -SYSCALL_ARGS_SIZE

Please check coding style here.

I will test it on real HW and will talk to you directly about results.

Thanks,
Michal

  reply	other threads:[~2026-04-21  8:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-27  8:54 Neal Frager
2026-04-21  8:47 ` Michal Simek [this message]
2026-04-21 10:17   ` Frager, Neal
     [not found]     ` <CAL1P33weRJ4GBhrNUxWZ63Tv_2+VcL_WLU7vPk=FFHKHMiF3XQ@mail.gmail.com>
2026-04-21 10:46       ` Frager, Neal
2026-04-21 11:33         ` Gopi Kumar Bulusu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7689d8f0-c386-4e3f-baa8-ac6a8bf1c618@amd.com \
    --to=michal.simek@amd.com \
    --cc=gopi@sankhya.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neal.frager@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®