mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Uros Bizjak" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Uros Bizjak <ubizjak@gmail.com>, Ingo Molnar <mingo@kernel.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/boot] x86/boot: Use current_stack_pointer to avoid asm() in init_heap()
Date: Tue, 21 May 2024 11:57:00 -0000	[thread overview]
Message-ID: <171629262087.10875.8849677586858232819.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20240520083011.135342-1-ubizjak@gmail.com>

The following commit has been merged into the x86/boot branch of tip:

Commit-ID:     b855cc58fc93c175fd5bb868d5e3a45cb3e1a42b
Gitweb:        https://git.kernel.org/tip/b855cc58fc93c175fd5bb868d5e3a45cb3e1a42b
Author:        Uros Bizjak <ubizjak@gmail.com>
AuthorDate:    Mon, 20 May 2024 10:29:55 +02:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Tue, 21 May 2024 13:36:36 +02:00

x86/boot: Use current_stack_pointer to avoid asm() in init_heap()

Use current_stack_pointer to avoid asm() in the calculation of
stack_end in init_heap(). The new code is more readable and
results in exactly the same object file.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20240520083011.135342-1-ubizjak@gmail.com
---
 arch/x86/boot/main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/x86/boot/main.c b/arch/x86/boot/main.c
index 9049f39..ac78f8c 100644
--- a/arch/x86/boot/main.c
+++ b/arch/x86/boot/main.c
@@ -119,9 +119,8 @@ static void init_heap(void)
 	char *stack_end;
 
 	if (boot_params.hdr.loadflags & CAN_USE_HEAP) {
-		asm("leal %n1(%%esp),%0"
-		    : "=r" (stack_end) : "i" (STACK_SIZE));
-
+		stack_end = (char *)
+			(current_stack_pointer - STACK_SIZE);
 		heap_end = (char *)
 			((size_t)boot_params.hdr.heap_end_ptr + 0x200);
 		if (heap_end > stack_end)

      reply	other threads:[~2024-05-21 11:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-20  8:29 [PATCH] " Uros Bizjak
2024-05-21 11:57 ` tip-bot2 for Uros Bizjak [this message]

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=171629262087.10875.8849677586858232819.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=ubizjak@gmail.com \
    --cc=x86@kernel.org \
    /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®