Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934364AbeAJMBQ (ORCPT + 1 other); Wed, 10 Jan 2018 07:01:16 -0500 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:29993 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932218AbeAJMBO (ORCPT ); Wed, 10 Jan 2018 07:01:14 -0500 X-IronPort-AV: E=Sophos;i="5.46,339,1511827200"; d="scan'208";a="585364022" From: David Woodhouse To: Andi Kleen Cc: Paul Turner , LKML , Linus Torvalds , Greg Kroah-Hartman , Tim Chen , Dave Hansen , tglx@linutronix.de, Kees Cook , Rik van Riel , Peter Zijlstra , Andy Lutomirski , Jiri Kosina , 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 Message-Id: <1515585624-21665-1-git-send-email-dwmw@amazon.co.uk> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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 --- 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