From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760031AbcAUSfU (ORCPT ); Thu, 21 Jan 2016 13:35:20 -0500 Received: from mail.skyhub.de ([78.46.96.112]:43420 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759657AbcAUSfQ (ORCPT ); Thu, 21 Jan 2016 13:35:16 -0500 From: Borislav Petkov To: "H. Peter Anvin" Cc: Andy Lutomirski , Brian Gerst , X86 ML , LKML Subject: [PATCH 4/5] x86/alternatives: Add an auxilary section Date: Thu, 21 Jan 2016 19:34:45 +0100 Message-Id: <1453401286-26966-5-git-send-email-bp@alien8.de> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1453401286-26966-1-git-send-email-bp@alien8.de> References: <1453401286-26966-1-git-send-email-bp@alien8.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) } /* -- 2.3.5