From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751670AbeAPKWt (ORCPT + 1 other); Tue, 16 Jan 2018 05:22:49 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:45366 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751118AbeAPKWr (ORCPT ); Tue, 16 Jan 2018 05:22:47 -0500 X-Google-Smtp-Source: ACJfBotvtLJofLtMTVl3qDU+AyylpWYHidWAG65C6Ff8iNxBSZ+0nF6lljSyxzLIPt4c52RN3PEGCg== Subject: Re: [PATCH 4.9 85/96] x86/retpoline: Add initial retpoline support To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, David Woodhouse , Thomas Gleixner , Arjan van de Ven , Ingo Molnar , gnomes@lxorguk.ukuu.org.uk, Rik van Riel , Andi Kleen , Josh Poimboeuf , thomas.lendacky@amd.com, Peter Zijlstra , Linus Torvalds , Jiri Kosina , Andy Lutomirski , Dave Hansen , Kees Cook , Tim Chen , Paul Turner , Greg Kroah-Hartman References: <20180115123404.270241256@linuxfoundation.org> <20180115123411.215283265@linuxfoundation.org> From: Jiri Slaby Message-ID: Date: Tue, 16 Jan 2018 11:22:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180115123411.215283265@linuxfoundation.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 01/15/2018, 01:35 PM, Greg Kroah-Hartman wrote: > 4.9-stable review patch. If anyone has any objections, please let me know. May I ask if somebody has started the 4.4 port yet? > ------------------ > > From: David Woodhouse > > commit 76b043848fd22dbf7f8bf3a1452f8c70d557b860 upstream. > > Enable the use of -mindirect-branch=thunk-extern in newer GCC, and provide > the corresponding thunks. Provide assembler macros for invoking the thunks > in the same way that GCC does, from native and inline assembler. > > This adds X86_FEATURE_RETPOLINE and sets it by default on all CPUs. In > some circumstances, IBRS microcode features may be used instead, and the > retpoline can be disabled. > > On AMD CPUs if lfence is serialising, the retpoline can be dramatically > simplified to a simple "lfence; jmp *\reg". A future patch, after it has > been verified that lfence really is serialising in all circumstances, can > enable this by setting the X86_FEATURE_RETPOLINE_AMD feature bit in addition > to X86_FEATURE_RETPOLINE. > > Do not align the retpoline in the altinstr section, because there is no > guarantee that it stays aligned when it's copied over the oldinstr during > alternative patching. > > [ Andi Kleen: Rename the macros, add CONFIG_RETPOLINE option, export thunks] > [ tglx: Put actual function CALL/JMP in front of the macros, convert to > symbolic labels ] > [ dwmw2: Convert back to numeric labels, merge objtool fixes ] > > Signed-off-by: David Woodhouse > Signed-off-by: Thomas Gleixner > Acked-by: Arjan van de Ven > Acked-by: Ingo Molnar > Cc: gnomes@lxorguk.ukuu.org.uk > Cc: Rik van Riel > Cc: Andi Kleen > Cc: Josh Poimboeuf > Cc: thomas.lendacky@amd.com > Cc: Peter Zijlstra > Cc: Linus Torvalds > Cc: Jiri Kosina > Cc: Andy Lutomirski > Cc: Dave Hansen > Cc: Kees Cook > Cc: Tim Chen > Cc: Greg Kroah-Hartman > Cc: Paul Turner > Link: https://lkml.kernel.org/r/1515707194-20531-4-git-send-email-dwmw@amazon.co.uk > Signed-off-by: David Woodhouse > Signed-off-by: Greg Kroah-Hartman thanks, -- js suse labs