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: <171629262087.10875.8849677586858232819.tip-bot2@tip-bot2>
Date: Tue, 21 May 2024 11:57:00 -0000
From: "tip-bot2 for Uros Bizjak" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Uros Bizjak <ubizjak@...il.com>, Ingo Molnar <mingo@...nel.org>,
 x86@...nel.org, linux-kernel@...r.kernel.org
Subject: [tip: x86/boot] x86/boot: Use current_stack_pointer to avoid asm() in
 init_heap()

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@...il.com>
AuthorDate:    Mon, 20 May 2024 10:29:55 +02:00
Committer:     Ingo Molnar <mingo@...nel.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@...il.com>
Signed-off-by: Ingo Molnar <mingo@...nel.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)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ