Skip to content

Commit 183ef7a

Browse files
nivedita76suryasaimadhu
authored andcommitted
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 <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent b2b1d94 commit 183ef7a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

arch/x86/boot/compressed/head_32.S

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,9 @@ SYM_FUNC_START_LOCAL_NOALIGN(.Lrelocated)
240240
/* push arguments for extract_kernel: */
241241
pushl $z_output_len /* decompressed length, end of relocs */
242242

243-
movl BP_init_size(%esi), %eax
244-
subl $_end, %eax
245-
movl %ebx, %ebp
246-
subl %eax, %ebp
247-
pushl %ebp /* output address */
243+
leal _end(%ebx), %eax
244+
subl BP_init_size(%esi), %eax
245+
pushl %eax /* output address */
248246

249247
pushl $z_input_len /* input_len */
250248
leal input_data(%ebx), %eax

0 commit comments

Comments
 (0)