All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32bit
@ 2018-03-14 11:24 Andy Whitcroft
  2018-03-14 11:51 ` Peter Zijlstra
  2018-03-14 12:28 ` [tip:x86/pti] x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32-bit kernels tip-bot for Andy Whitcroft
  0 siblings, 2 replies; 7+ messages in thread
From: Andy Whitcroft @ 2018-03-14 11:24 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, David Woodhouse, Peter Zijlstra
  Cc: Andy Whitcroft, H. Peter Anvin, x86, linux-kernel

In 9e0e3c5130e9 ("x86/speculation, objtool: Annotate indirect calls/jumps
for objtool") we added annotations for CALL_NOSPEC/JMP_NOSPEC on x86 64bit.
We did not annotate the 32bit path.  Annotate it similarly.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 arch/x86/include/asm/nospec-branch.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

    While reviewing indirect calls in our builds I noted that the
    i386 retpoline CALL_NOSPEC is not annotated safe even though
    its amd64 equivalent is.  I cannot see any reason this is not
    also inherantly safe.  Peter was there a reason that you did
    not annotate this one too?  Anyhow, on the assumption this was
    just missed, this patch annotates it.

    -apw

diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
index d0dabeae0505..07886162bdf8 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",				\
 	"       jmp    904f;\n"					\
 	"       .align 16\n"					\
 	"901:	call   903f;\n"					\
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-03-14 13:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-14 11:24 [PATCH 1/1] x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32bit Andy Whitcroft
2018-03-14 11:51 ` Peter Zijlstra
2018-03-14 12:24   ` Ingo Molnar
2018-03-14 12:28 ` [tip:x86/pti] x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32-bit kernels tip-bot for Andy Whitcroft
2018-03-14 13:03   ` Josh Poimboeuf
2018-03-14 13:39     ` Ingo Molnar
2018-03-14 13:51       ` Josh Poimboeuf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.