linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw@amazon.co.uk>
To: Andi Kleen <ak@linux.intel.com>
Cc: Paul Turner <pjt@google.com>, LKML <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Greg Kroah-Hartman <gregkh@linux-foundation.org>,
	Tim Chen <tim.c.chen@linux.intel.com>,
	Dave Hansen <dave.hansen@intel.com>,
	tglx@linutronix.de, Kees Cook <keescook@google.com>,
	Rik van Riel <riel@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andy Lutomirski <luto@amacapital.net>,
	Jiri Kosina <jikos@kernel.org>,
	gnomes@lxorguk.ukuu.org.uk, x86@kernel.org, bp@alien8.de,
	rga@amazon.de
Subject: [PATCH] x86/retpoline: Remove alignment directives from retpoline core
Date: Wed, 10 Jan 2018 12:00:24 +0000	[thread overview]
Message-ID: <1515585624-21665-1-git-send-email-dwmw@amazon.co.uk> (raw)

Now that the retpoline is emitted in the altinstr section, there's not a
lot of point in attempting to align it. It might be aligned there, but it
could still end up misaligned when copied into place over oldinstr.

It is also actively harmful, because the alternatives code will helpfully
spot that the first instruction of the alternative is a NOP and thus turn
*all* the rest of it into NOPs too. (A fix for which is already available,
but we just don't need to do it, so stop.)

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/include/asm/nospec-branch.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
index 6bda2c0..16329f1 100644
--- a/arch/x86/include/asm/nospec-branch.h
+++ b/arch/x86/include/asm/nospec-branch.h
@@ -15,12 +15,10 @@
  * invocation below less ugly.
  */
 .macro RETPOLINE_JMP reg:req
-	.align	16
 	call	.Ldo_rop_\@
 .Lspec_trap_\@:
 	pause
 	jmp	.Lspec_trap_\@
-	.align	16
 .Ldo_rop_\@:
 	mov	\reg, (%_ASM_SP)
 	ret
@@ -34,7 +32,6 @@
 	jmp	.Ldo_call_\@
 .Ldo_retpoline_jmp_\@:
 	RETPOLINE_JMP \reg
-	.align	16
 .Ldo_call_\@:
 	call	.Ldo_retpoline_jmp_\@
 .endm
-- 
2.7.4

                 reply	other threads:[~2018-01-10 12:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1515585624-21665-1-git-send-email-dwmw@amazon.co.uk \
    --to=dwmw@amazon.co.uk \
    --cc=ak@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gregkh@linux-foundation.org \
    --cc=jikos@kernel.org \
    --cc=keescook@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=rga@amazon.de \
    --cc=riel@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tim.c.chen@linux.intel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).