From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935137AbcATKzr (ORCPT ); Wed, 20 Jan 2016 05:55:47 -0500 Received: from terminus.zytor.com ([198.137.202.10]:60465 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932979AbcATKzp (ORCPT ); Wed, 20 Jan 2016 05:55:45 -0500 User-Agent: K-9 Mail for Android In-Reply-To: <20160120105018.GB23350@pd.tnic> References: <20160117103337.GC8549@pd.tnic> <20160118181457.GG12651@pd.tnic> <20160118185107.GI12651@pd.tnic> <20160119011026.GA12911@pd.tnic> <20160119092213.GA15071@pd.tnic> <569F06B9.4060903@zytor.com> <569F1022.6040709@zytor.com> <20160120105018.GB23350@pd.tnic> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init From: "H. Peter Anvin" Date: Wed, 20 Jan 2016 02:55:24 -0800 To: Borislav Petkov CC: Brian Gerst , the arch/x86 maintainers , Linux Kernel Mailing List , Ingo Molnar , Denys Vlasenko , Andy Lutomirski , Linus Torvalds Message-ID: <96EC3B78-0E65-4464-B7F7-B0F9D2CCEF19@zytor.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On January 20, 2016 2:50:18 AM PST, Borislav Petkov wrote: >On Tue, Jan 19, 2016 at 08:42:10PM -0800, H. Peter Anvin wrote: >> Right. I wish we could tag reference call sites as clean, not >sources >> or targets. Sigh. > >I was thinking about something like this: > >From: Borislav Petkov >Date: Wed, 20 Jan 2016 11:45:36 +0100 >Subject: [PATCH] x86/alternatives: Add an auxilary section > >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 | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/arch/x86/kernel/vmlinux.lds.S >b/arch/x86/kernel/vmlinux.lds.S >index 74e4bf11f562..35868bf529b9 100644 >--- a/arch/x86/kernel/vmlinux.lds.S >+++ b/arch/x86/kernel/vmlinux.lds.S >@@ -244,6 +244,11 @@ SECTIONS > */ > .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) >{ > *(.altinstr_replacement) >+ /* >+ * Auxiliary section for misc instruction patching tasks. See >+ * static_cpu_has(), for an example. >+ */ >+ *(.altinstr_aux) > } > > /* How about: 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. -- Sent from my Android device with K-9 Mail. Please excuse brevity and formatting.