This is a note to let you know that I've just added the patch titled tools/nolibc: x86-64: Use `mov $60,%eax` instead of `mov $60,%rax` to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: tools-nolibc-x86-64-use-mov-60-eax-instead-of-mov-60.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit d74510b4743015fc50c3cda41dc632340f1905d7 Author: Ammar Faizi <ammar.faizi@xxxxxxxxxxxxxxxxxxxxx> Date: Sun Oct 24 19:43:22 2021 +0200 tools/nolibc: x86-64: Use `mov $60,%eax` instead of `mov $60,%rax` [ Upstream commit 7bdc0e7a390511cd3df8194003b908f15a6170a5 ] Note that mov to 32-bit register will zero extend to 64-bit register. Thus `mov $60,%eax` has the same effect with `mov $60,%rax`. Use the shorter opcode to achieve the same thing. ``` b8 3c 00 00 00 mov $60,%eax (5 bytes) [1] 48 c7 c0 3c 00 00 00 mov $60,%rax (7 bytes) [2] ``` Currently, we use [2]. Change it to [1] for shorter code. Signed-off-by: Ammar Faizi <ammar.faizi@xxxxxxxxxxxxxxxxxxxxx> Signed-off-by: Willy Tarreau <w@xxxxxx> Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx> Stable-dep-of: 184177c3d6e0 ("tools/nolibc: restore mips branch ordering in the _start block") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/tools/include/nolibc/nolibc.h b/tools/include/nolibc/nolibc.h index ece7a70d8b39..676fe5d92875 100644 --- a/tools/include/nolibc/nolibc.h +++ b/tools/include/nolibc/nolibc.h @@ -420,7 +420,7 @@ asm(".section .text\n" "and $-16, %rsp\n" // x86 ABI : esp must be 16-byte aligned before call "call main\n" // main() returns the status code, we'll exit with it. "mov %eax, %edi\n" // retrieve exit code (32 bit) - "mov $60, %rax\n" // NR_exit == 60 + "mov $60, %eax\n" // NR_exit == 60 "syscall\n" // really exit "hlt\n" // ensure it does not return "");