From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753234AbbCaMhv (ORCPT ); Tue, 31 Mar 2015 08:37:51 -0400 Received: from terminus.zytor.com ([198.137.202.10]:57278 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753057AbbCaMhs (ORCPT ); Tue, 31 Mar 2015 08:37:48 -0400 Date: Tue, 31 Mar 2015 05:37:18 -0700 From: tip-bot for Denys Vlasenko Message-ID: Cc: ast@plumgrid.com, wad@chromium.org, dvlasenk@redhat.com, torvalds@linux-foundation.org, hpa@zytor.com, keescook@chromium.org, bp@alien8.de, fweisbec@gmail.com, luto@amacapital.net, tglx@linutronix.de, linux-kernel@vger.kernel.org, rostedt@goodmis.org, oleg@redhat.com, mingo@kernel.org Reply-To: hpa@zytor.com, keescook@chromium.org, bp@alien8.de, fweisbec@gmail.com, luto@amacapital.net, rostedt@goodmis.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, oleg@redhat.com, mingo@kernel.org, ast@plumgrid.com, wad@chromium.org, dvlasenk@redhat.com, torvalds@linux-foundation.org In-Reply-To: <1427738975-7391-5-git-send-email-dvlasenk@redhat.com> References: <1427738975-7391-5-git-send-email-dvlasenk@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] x86/asm/entry/64: Do not GET_THREAD_INFO() too early Git-Commit-ID: a3675b32aac81c2c4733568844f8276527a37423 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 Commit-ID: a3675b32aac81c2c4733568844f8276527a37423 Gitweb: http://git.kernel.org/tip/a3675b32aac81c2c4733568844f8276527a37423 Author: Denys Vlasenko AuthorDate: Mon, 30 Mar 2015 20:09:34 +0200 Committer: Ingo Molnar CommitDate: Tue, 31 Mar 2015 09:31:11 +0200 x86/asm/entry/64: Do not GET_THREAD_INFO() too early At exit_intr, we GET_THREAD_INFO(%rcx) and then jump to retint_kernel if saved CS was from kernel. But the code at retint_kernel doesn't need %rcx. Move GET_THREAD_INFO(%rcx) down, after CS check and branch. While at it, remove "has a correct top of stack" comment. After recent changes which eliminated FIXUP_TOP_OF_STACK, we always have a correct pt_regs layout. 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: Steven Rostedt Cc: Will Drewry Link: http://lkml.kernel.org/r/1427738975-7391-5-git-send-email-dvlasenk@redhat.com Signed-off-by: Ingo Molnar --- arch/x86/kernel/entry_64.S | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 34d60c3..6f251a5 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S @@ -658,13 +658,12 @@ ret_from_intr: CFI_ADJUST_CFA_OFFSET RBP exit_intr: - GET_THREAD_INFO(%rcx) testl $3,CS(%rsp) je retint_kernel - /* Interrupt came from user space */ + + GET_THREAD_INFO(%rcx) /* - * Has a correct top of stack. * %rcx: thread info. Interrupts off. */ retint_with_reschedule: