From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760060AbcAUTAf (ORCPT ); Thu, 21 Jan 2016 14:00:35 -0500 Received: from terminus.zytor.com ([198.137.202.10]:57436 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759653AbcAUTAc (ORCPT ); Thu, 21 Jan 2016 14:00:32 -0500 Subject: Re: [PATCH 4/5] x86/alternatives: Add an auxilary section To: Borislav Petkov References: <1453401286-26966-1-git-send-email-bp@alien8.de> <1453401286-26966-5-git-send-email-bp@alien8.de> Cc: Andy Lutomirski , Brian Gerst , X86 ML , LKML From: "H. Peter Anvin" Message-ID: <56A12AB3.90607@zytor.com> Date: Thu, 21 Jan 2016 11:00:03 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <1453401286-26966-5-git-send-email-bp@alien8.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/21/16 10:34, Borislav Petkov wrote: > From: Borislav Petkov > > Add .altinstr_aux for additional instructions which will be used before > and/or during patching. All stuff which needs more sophisticated > patching should go there. See next patch. > > Signed-off-by: Borislav Petkov > --- > arch/x86/kernel/vmlinux.lds.S | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S > index 74e4bf11f562..1335ff4854ae 100644 > --- a/arch/x86/kernel/vmlinux.lds.S > +++ b/arch/x86/kernel/vmlinux.lds.S > @@ -244,6 +244,15 @@ SECTIONS > */ > .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) { > *(.altinstr_replacement) > + /* > + * Section for code used exclusively before alternatives are > + * run. All references to such code must be patched out by > + * alternatives, normally by using a patch with > + * X86_FEATURE_ALWAYS. > + * > + * See static_cpu_has() for an example. > + */ > + *(.altinstr_aux) > } NAK on this being part of .altinstr_replacement (if anything it ought to simply be part of .text.init). Otherwise fine. -hpa