[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200211173333.1722739-1-nivedita@alum.mit.edu>
Date: Tue, 11 Feb 2020 12:33:33 -0500
From: Arvind Sankar <nivedita@...m.mit.edu>
To: Borislav Petkov <bp@...en8.de>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
linux-kernel@...r.kernel.org, Michael Matz <matz@...e.de>
Subject: [PATCH v2] x86/boot: Use 32-bit (zero-extended) move for z_output_len
z_output_len is the size of the decompressed payload (i.e. vmlinux +
vmlinux.relocs) and is generated as an unsigned 32-bit quantity by
mkpiggy.c.
The current movq $z_output_len, %r9 instruction generates a
sign-extended move to %r9. Using movl $z_output_len, %r9d will instead
zero-extend into %r9, which is appropriate for an unsigned 32-bit
quantity. This is also what we already do for z_input_len, the size of
the compressed payload.
Signed-off-by: Arvind Sankar <nivedita@...m.mit.edu>
---
v2: Improve commit message
arch/x86/boot/compressed/head_64.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index 1f1f6c8139b3..03369246a4ff 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -484,7 +484,7 @@ SYM_FUNC_START_LOCAL_NOALIGN(.Lrelocated)
leaq input_data(%rip), %rdx /* input_data */
movl $z_input_len, %ecx /* input_len */
movq %rbp, %r8 /* output target address */
- movq $z_output_len, %r9 /* decompressed length, end of relocs */
+ movl $z_output_len, %r9d /* decompressed length, end of relocs */
call extract_kernel /* returns kernel location in %rax */
popq %rsi
--
2.24.1
Powered by blists - more mailing lists