diff options
author | Borislav Petkov <bp@alien8.de> | 2015-10-09 13:08:59 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-10-11 05:06:40 -0400 |
commit | 374a3a3916a70fc6236bc2b8f8ac02548a128a54 (patch) | |
tree | 09a05036d7ed4d73112ce779d01a74bac4dab0f5 | |
parent | f5e6a9753ac2965564a14e6285a06f44043ed9c8 (diff) |
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 <bp@suse.de>
Acked-by: Andy Lutomirski <luto@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20151009170859.GA24266@pd.tnic
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/entry/entry_64_compat.S | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S index cf9641cd4796..92b0b27b43c6 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) | |||
102 | * NT was set instead of doing an unconditional popfq. | 102 | * NT was set instead of doing an unconditional popfq. |
103 | * This needs to happen before enabling interrupts so that | 103 | * This needs to happen before enabling interrupts so that |
104 | * we don't get preempted with NT set. | 104 | * we don't get preempted with NT set. |
105 | * | ||
106 | * NB.: sysenter_fix_flags is a label with the code under it moved | ||
107 | * out-of-line as an optimization: NT is unlikely to be set in the | ||
108 | * majority of the cases and instead of polluting the I$ unnecessarily, | ||
109 | * we're keeping that code behind a branch which will predict as | ||
110 | * not-taken and therefore its instructions won't be fetched. | ||
105 | */ | 111 | */ |
106 | testl $X86_EFLAGS_NT, EFLAGS(%rsp) | 112 | testl $X86_EFLAGS_NT, EFLAGS(%rsp) |
107 | jnz sysenter_fix_flags | 113 | jnz sysenter_fix_flags |