aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot
diff options
context:
space:
mode:
authorArvind Sankar <nivedita@alum.mit.edu>2020-01-07 14:44:34 -0500
committerBorislav Petkov <bp@suse.de>2020-01-23 11:58:43 +0100
commit183ef7adf4ed638ac0fb0c3c9a71fc00e8512b61 (patch)
tree2d58db55eedf738b53bfefafa5bfd64757c41ae8 /arch/x86/boot
parentx86/entry/64: Add instruction suffix to SYSRET (diff)
downloadlinux-dev-183ef7adf4ed638ac0fb0c3c9a71fc00e8512b61.tar.xz
linux-dev-183ef7adf4ed638ac0fb0c3c9a71fc00e8512b61.zip
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
Diffstat (limited to 'arch/x86/boot')
-rw-r--r--arch/x86/boot/compressed/head_32.S8
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
index f2dfd6d083ef..1cc55c79d1d0 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