linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "tip-bot2 for Arvind Sankar" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Arvind Sankar <nivedita@alum.mit.edu>,
	Borislav Petkov <bp@suse.de>, x86 <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [tip: x86/asm] x86/boot: Simplify calculation of output address
Date: Thu, 23 Jan 2020 11:04:46 -0000	[thread overview]
Message-ID: <157977748674.396.4073029577161163163.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20200107194436.2166846-1-nivedita@alum.mit.edu>

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

Commit-ID:     183ef7adf4ed638ac0fb0c3c9a71fc00e8512b61
Gitweb:        https://git.kernel.org/tip/183ef7adf4ed638ac0fb0c3c9a71fc00e8512b61
Author:        Arvind Sankar <nivedita@alum.mit.edu>
AuthorDate:    Tue, 07 Jan 2020 14:44:34 -05:00
Committer:     Borislav Petkov <bp@suse.de>
CommitterDate: Thu, 23 Jan 2020 11:58:43 +01:00

x86/boot: Simplify calculation of output address

Condense the calculation of decompressed kernel start a little.

Committer notes:

before:

ebp = ebx - (init_size - _end)

after:

eax = (ebx + _end) - init_size

where in both ebx contains the temporary address the kernel is moved to
for in-place decompression.

The before and after difference in register state is %eax and %ebp
but that is immaterial because the compressed image is not built with
-mregparm, i.e., all arguments of the following extract_kernel() call
are passed on the stack.

Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20200107194436.2166846-1-nivedita@alum.mit.edu
---
 arch/x86/boot/compressed/head_32.S | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
index f2dfd6d..1cc55c7 100644
--- a/arch/x86/boot/compressed/head_32.S
+++ b/arch/x86/boot/compressed/head_32.S
@@ -240,11 +240,9 @@ SYM_FUNC_START_LOCAL_NOALIGN(.Lrelocated)
 				/* push arguments for extract_kernel: */
 	pushl	$z_output_len	/* decompressed length, end of relocs */
 
-	movl    BP_init_size(%esi), %eax
-	subl    $_end, %eax
-	movl    %ebx, %ebp
-	subl    %eax, %ebp
-	pushl	%ebp		/* output address */
+	leal	_end(%ebx), %eax
+	subl    BP_init_size(%esi), %eax
+	pushl	%eax		/* output address */
 
 	pushl	$z_input_len	/* input_len */
 	leal	input_data(%ebx), %eax

      parent reply	other threads:[~2020-01-23 11:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-07 19:44 [PATCH 1/3] x86/boot/compressed/32: Simplify calculation of output address Arvind Sankar
2020-01-07 19:44 ` [PATCH 2/3] x86/boot/compressed/64: Use leal to initialize boot stack pointer Arvind Sankar
2020-02-12 12:04   ` [tip: x86/boot] x86/boot/compressed/64: Use LEA " tip-bot2 for Arvind Sankar
2020-01-07 19:44 ` [PATCH 3/3] x86/boot/compressed/64: Use 32-bit move for z_output_len Arvind Sankar
2020-02-11 16:17   ` Borislav Petkov
2020-02-11 17:33     ` [PATCH v2] x86/boot: Use 32-bit (zero-extended) " Arvind Sankar
2020-02-11 18:15       ` Borislav Petkov
2020-02-11 19:27         ` Arvind Sankar
2020-02-12  9:47           ` Borislav Petkov
2020-02-12 12:04       ` [tip: x86/boot] x86/boot/compressed/64: Use 32-bit (zero-extended) MOV " tip-bot2 for Arvind Sankar
2020-01-23 11:04 ` tip-bot2 for Arvind Sankar [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=157977748674.396.4073029577161163163.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=bp@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=nivedita@alum.mit.edu \
    --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;
as well as URLs for NNTP newsgroup(s).