Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754792AbbGFPjj (ORCPT ); Mon, 6 Jul 2015 11:39:39 -0400 Received: from terminus.zytor.com ([198.137.202.10]:49177 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751769AbbGFPjd (ORCPT ); Mon, 6 Jul 2015 11:39:33 -0400 Date: Mon, 6 Jul 2015 08:38:25 -0700 From: tip-bot for Denys Vlasenko Message-ID: Cc: oleg@redhat.com, keescook@chromium.org, hpa@zytor.com, wad@chromium.org, dvlasenk@redhat.com, ast@plumgrid.com, bp@alien8.de, tglx@linutronix.de, torvalds@linux-foundation.org, luto@amacapital.net, linux-kernel@vger.kernel.org, fweisbec@gmail.com, rostedt@goodmis.org, peterz@infradead.org, mingo@kernel.org Reply-To: tglx@linutronix.de, torvalds@linux-foundation.org, fweisbec@gmail.com, mingo@kernel.org, peterz@infradead.org, rostedt@goodmis.org, luto@amacapital.net, linux-kernel@vger.kernel.org, dvlasenk@redhat.com, wad@chromium.org, oleg@redhat.com, hpa@zytor.com, keescook@chromium.org, bp@alien8.de, ast@plumgrid.com In-Reply-To: <1435954742-2545-1-git-send-email-dvlasenk@redhat.com> References: <1435954742-2545-1-git-send-email-dvlasenk@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] x86/asm/entry/32: Replace RESTORE_RSI_RDI with open-coded 32-bit reads Git-Commit-ID: c73e36b775a777abd67a1e15481923fcbd2040e1 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3274 Lines: 90 Commit-ID: c73e36b775a777abd67a1e15481923fcbd2040e1 Gitweb: http://git.kernel.org/tip/c73e36b775a777abd67a1e15481923fcbd2040e1 Author: Denys Vlasenko AuthorDate: Fri, 3 Jul 2015 22:19:02 +0200 Committer: Ingo Molnar CommitDate: Mon, 6 Jul 2015 14:56:50 +0200 x86/asm/entry/32: Replace RESTORE_RSI_RDI with open-coded 32-bit reads This doesn't change much, but uses shorter 32-bit insns: -48 8b 74 24 68 mov 0x68(%rsp),%rsi -48 8b 7c 24 70 mov 0x70(%rsp),%rdi -48 8b 54 24 60 mov 0x60(%rsp),%rdx +8b 54 24 60 mov 0x60(%rsp),%edx +8b 74 24 68 mov 0x68(%rsp),%esi +8b 7c 24 70 mov 0x70(%rsp),%edi and does the loads in pt_regs order. Since these are the only uses of RESTORE_RSI_RDI[_RDX], drop these macros. Signed-off-by: Denys Vlasenko Cc: Alexei Starovoitov Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Frederic Weisbecker Cc: H. Peter Anvin Cc: Kees Cook Cc: Linus Torvalds Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Thomas Gleixner Cc: Will Drewry Link: http://lkml.kernel.org/r/1435954742-2545-1-git-send-email-dvlasenk@redhat.com Signed-off-by: Ingo Molnar --- arch/x86/entry/calling.h | 6 ------ arch/x86/entry/entry_64_compat.S | 7 +++++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/x86/entry/calling.h b/arch/x86/entry/calling.h index f4e6308..519207f 100644 --- a/arch/x86/entry/calling.h +++ b/arch/x86/entry/calling.h @@ -193,12 +193,6 @@ For 32-bit we have the following conventions - kernel is built with .macro RESTORE_C_REGS_EXCEPT_RCX_R11 RESTORE_C_REGS_HELPER 1,0,0,1,1 .endm - .macro RESTORE_RSI_RDI - RESTORE_C_REGS_HELPER 0,0,0,0,0 - .endm - .macro RESTORE_RSI_RDI_RDX - RESTORE_C_REGS_HELPER 0,0,0,0,1 - .endm .macro REMOVE_PT_GPREGS_FROM_STACK addskip=0 subq $-(15*8+\addskip), %rsp diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S index bb187a6..b868cfc 100644 --- a/arch/x86/entry/entry_64_compat.S +++ b/arch/x86/entry/entry_64_compat.S @@ -140,7 +140,8 @@ sysexit_from_sys_call: */ andl $~TS_COMPAT, ASM_THREAD_INFO(TI_status, %rsp, SIZEOF_PTREGS) movl RIP(%rsp), %ecx /* User %eip */ - RESTORE_RSI_RDI + movl RSI(%rsp), %esi + movl RDI(%rsp), %edi xorl %edx, %edx /* Do not leak kernel information */ xorq %r8, %r8 xorq %r9, %r9 @@ -366,7 +367,9 @@ cstar_dispatch: sysretl_from_sys_call: andl $~TS_COMPAT, ASM_THREAD_INFO(TI_status, %rsp, SIZEOF_PTREGS) - RESTORE_RSI_RDI_RDX + movl RDX(%rsp), %edx + movl RSI(%rsp), %esi + movl RDI(%rsp), %edi movl RIP(%rsp), %ecx movl EFLAGS(%rsp), %r11d xorq %r10, %r10 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/