[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171027201105.GC12039@nazgul.tnic>
Date: Fri, 27 Oct 2017 22:11:05 +0200
From: Borislav Petkov <bp@...e.de>
To: Andy Lutomirski <luto@...nel.org>
Cc: X86 ML <x86@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Brian Gerst <brgerst@...il.com>,
Dave Hansen <dave.hansen@...el.com>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH 06/18] x86/asm/64: Use pop instead of movq in
syscall_return_via_sysret
On Thu, Oct 26, 2017 at 01:26:38AM -0700, Andy Lutomirski wrote:
> Saves 64 bytes.
>
> Signed-off-by: Andy Lutomirski <luto@...nel.org>
> ---
> arch/x86/entry/entry_64.S | 14 +++++++++++---
> 1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
> index d6404a613df4..9dafafa3e0ec 100644
> --- a/arch/x86/entry/entry_64.S
> +++ b/arch/x86/entry/entry_64.S
> @@ -313,10 +313,18 @@ return_from_SYSCALL_64:
> */
> syscall_return_via_sysret:
> /* rcx and r11 are already restored (see code above) */
> - RESTORE_EXTRA_REGS
> - RESTORE_C_REGS_EXCEPT_RCX_R11
> - movq RSP(%rsp), %rsp
> UNWIND_HINT_EMPTY
> + POP_EXTRA_REGS
> + popq %rsi /* skip r11 */
> + popq %r10
> + popq %r9
> + popq %r8
> + popq %rax
> + popq %rsi /* skip rcx */
> + popq %rdx
> + popq %rsi
> + popq %rdi
> + movq RSP-ORIG_RAX(%rsp), %rsp
> USERGS_SYSRET64
> END(entry_SYSCALL_64)
>
> --
Reviewed-by: Borislav Petkov <bp@...e.de>
--
Regards/Gruss,
Boris.
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
--
Powered by blists - more mailing lists