From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751674AbbJKJKt (ORCPT ); Sun, 11 Oct 2015 05:10:49 -0400 Received: from terminus.zytor.com ([198.137.202.10]:53072 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751213AbbJKJKq (ORCPT ); Sun, 11 Oct 2015 05:10:46 -0400 Date: Sun, 11 Oct 2015 02:09:34 -0700 From: tip-bot for Borislav Petkov Message-ID: Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, peterz@infradead.org, mingo@kernel.org, luto@amacapital.net, brgerst@gmail.com, luto@kernel.org, bp@alien8.de, dvlasenk@redhat.com, hpa@zytor.com, torvalds@linux-foundation.org, bp@suse.de Reply-To: bp@suse.de, torvalds@linux-foundation.org, luto@amacapital.net, mingo@kernel.org, hpa@zytor.com, dvlasenk@redhat.com, bp@alien8.de, brgerst@gmail.com, luto@kernel.org, peterz@infradead.org, linux-kernel@vger.kernel.org, tglx@linutronix.de In-Reply-To: <20151009170859.GA24266@pd.tnic> References: <20151009170859.GA24266@pd.tnic> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] x86/entry/64/compat: Document sysenter_fix_flags' s reason for existence Git-Commit-ID: 374a3a3916a70fc6236bc2b8f8ac02548a128a54 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: 374a3a3916a70fc6236bc2b8f8ac02548a128a54 Gitweb: http://git.kernel.org/tip/374a3a3916a70fc6236bc2b8f8ac02548a128a54 Author: Borislav Petkov AuthorDate: Fri, 9 Oct 2015 19:08:59 +0200 Committer: Ingo Molnar CommitDate: Sun, 11 Oct 2015 11:06:40 +0200 x86/entry/64/compat: Document sysenter_fix_flags's reason for existence The code under the label can normally be inline, without the jumping back and forth but the latter is an optimization. Document that. Signed-off-by: Borislav Petkov Acked-by: Andy Lutomirski Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20151009170859.GA24266@pd.tnic Signed-off-by: Ingo Molnar --- arch/x86/entry/entry_64_compat.S | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S index cf9641c..92b0b27 100644 --- a/arch/x86/entry/entry_64_compat.S +++ b/arch/x86/entry/entry_64_compat.S @@ -102,6 +102,12 @@ ENTRY(entry_SYSENTER_compat) * NT was set instead of doing an unconditional popfq. * This needs to happen before enabling interrupts so that * we don't get preempted with NT set. + * + * NB.: sysenter_fix_flags is a label with the code under it moved + * out-of-line as an optimization: NT is unlikely to be set in the + * majority of the cases and instead of polluting the I$ unnecessarily, + * we're keeping that code behind a branch which will predict as + * not-taken and therefore its instructions won't be fetched. */ testl $X86_EFLAGS_NT, EFLAGS(%rsp) jnz sysenter_fix_flags