[tip:x86/pti] x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32-bit kernels

2018-03-14 Thread tip-bot for Andy Whitcroft
Commit-ID:  a14bff131108faf50cc0cf864589fd71ee216c96
Gitweb: https://git.kernel.org/tip/a14bff131108faf50cc0cf864589fd71ee216c96
Author: Andy Whitcroft 
AuthorDate: Wed, 14 Mar 2018 11:24:27 +
Committer:  Ingo Molnar 
CommitDate: Wed, 14 Mar 2018 13:24:31 +0100

x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32-bit 
kernels

In the following commit:

  9e0e3c5130e9 ("x86/speculation, objtool: Annotate indirect calls/jumps for 
objtool")

... we added annotations for CALL_NOSPEC/JMP_NOSPEC on 64-bit x86 kernels,
but we did not annotate the 32-bit path.

Annotate it similarly.

Signed-off-by: Andy Whitcroft 
Acked-by: Peter Zijlstra (Intel) 
Cc: Andy Lutomirski 
Cc: Arjan van de Ven 
Cc: Borislav Petkov 
Cc: Dan Williams 
Cc: Dave Hansen 
Cc: David Woodhouse 
Cc: David Woodhouse 
Cc: Greg Kroah-Hartman 
Cc: Josh Poimboeuf 
Cc: Linus Torvalds 
Cc: Peter Zijlstra 
Cc: Thomas Gleixner 
Link: http://lkml.kernel.org/r/20180314112427.22351-1-...@canonical.com
Signed-off-by: Ingo Molnar 
---
 arch/x86/include/asm/nospec-branch.h | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/nospec-branch.h 
b/arch/x86/include/asm/nospec-branch.h
index b7063cfa19f9..b3996d60f981 100644
--- a/arch/x86/include/asm/nospec-branch.h
+++ b/arch/x86/include/asm/nospec-branch.h
@@ -183,7 +183,10 @@
  * otherwise we'll run out of registers. We don't care about CET
  * here, anyway.
  */
-# define CALL_NOSPEC ALTERNATIVE("call *%[thunk_target]\n",\
+# define CALL_NOSPEC   \
+   ALTERNATIVE(\
+   ANNOTATE_RETPOLINE_SAFE \
+   "call *%[thunk_target]\n",  \
"   jmp904f;\n" \
"   .align 16\n"\
"901:   call   903f;\n" \


[tip:x86/pti] x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32-bit kernels

2018-03-14 Thread tip-bot for Andy Whitcroft
Commit-ID:  a14bff131108faf50cc0cf864589fd71ee216c96
Gitweb: https://git.kernel.org/tip/a14bff131108faf50cc0cf864589fd71ee216c96
Author: Andy Whitcroft 
AuthorDate: Wed, 14 Mar 2018 11:24:27 +
Committer:  Ingo Molnar 
CommitDate: Wed, 14 Mar 2018 13:24:31 +0100

x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32-bit 
kernels

In the following commit:

  9e0e3c5130e9 ("x86/speculation, objtool: Annotate indirect calls/jumps for 
objtool")

... we added annotations for CALL_NOSPEC/JMP_NOSPEC on 64-bit x86 kernels,
but we did not annotate the 32-bit path.

Annotate it similarly.

Signed-off-by: Andy Whitcroft 
Acked-by: Peter Zijlstra (Intel) 
Cc: Andy Lutomirski 
Cc: Arjan van de Ven 
Cc: Borislav Petkov 
Cc: Dan Williams 
Cc: Dave Hansen 
Cc: David Woodhouse 
Cc: David Woodhouse 
Cc: Greg Kroah-Hartman 
Cc: Josh Poimboeuf 
Cc: Linus Torvalds 
Cc: Peter Zijlstra 
Cc: Thomas Gleixner 
Link: http://lkml.kernel.org/r/20180314112427.22351-1-...@canonical.com
Signed-off-by: Ingo Molnar 
---
 arch/x86/include/asm/nospec-branch.h | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/nospec-branch.h 
b/arch/x86/include/asm/nospec-branch.h
index b7063cfa19f9..b3996d60f981 100644
--- a/arch/x86/include/asm/nospec-branch.h
+++ b/arch/x86/include/asm/nospec-branch.h
@@ -183,7 +183,10 @@
  * otherwise we'll run out of registers. We don't care about CET
  * here, anyway.
  */
-# define CALL_NOSPEC ALTERNATIVE("call *%[thunk_target]\n",\
+# define CALL_NOSPEC   \
+   ALTERNATIVE(\
+   ANNOTATE_RETPOLINE_SAFE \
+   "call *%[thunk_target]\n",  \
"   jmp904f;\n" \
"   .align 16\n"\
"901:   call   903f;\n" \