From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756825AbcA3NU6 (ORCPT ); Sat, 30 Jan 2016 08:20:58 -0500 Received: from terminus.zytor.com ([198.137.202.10]:38966 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752885AbcA3NUz (ORCPT ); Sat, 30 Jan 2016 08:20:55 -0500 Date: Sat, 30 Jan 2016 05:19:49 -0800 From: tip-bot for Borislav Petkov Message-ID: Cc: dvlasenk@redhat.com, linux-kernel@vger.kernel.org, mingo@kernel.org, brgerst@gmail.com, tglx@linutronix.de, hpa@zytor.com, bp@suse.de, bp@alien8.de, luto@amacapital.net, peterz@infradead.org, torvalds@linux-foundation.org Reply-To: torvalds@linux-foundation.org, peterz@infradead.org, luto@amacapital.net, bp@alien8.de, hpa@zytor.com, bp@suse.de, dvlasenk@redhat.com, mingo@kernel.org, linux-kernel@vger.kernel.org, brgerst@gmail.com, tglx@linutronix.de In-Reply-To: <1453842730-28463-8-git-send-email-bp@alien8.de> References: <1453842730-28463-8-git-send-email-bp@alien8.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] x86/alternatives: Add an auxilary section Git-Commit-ID: 337e4cc84021212a87b04b77b65cccc49304909e X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 337e4cc84021212a87b04b77b65cccc49304909e Gitweb: http://git.kernel.org/tip/337e4cc84021212a87b04b77b65cccc49304909e Author: Borislav Petkov AuthorDate: Tue, 26 Jan 2016 22:12:07 +0100 Committer: Ingo Molnar CommitDate: Sat, 30 Jan 2016 11:22:20 +0100 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 Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1453842730-28463-8-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar --- arch/x86/kernel/vmlinux.lds.S | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index 74e4bf1..92dc211 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -195,6 +195,17 @@ SECTIONS :init #endif + /* + * Section for code used exclusively before alternatives are run. All + * references to such code must be patched out by alternatives, normally + * by using X86_FEATURE_ALWAYS CPU feature bit. + * + * See static_cpu_has() for an example. + */ + .altinstr_aux : AT(ADDR(.altinstr_aux) - LOAD_OFFSET) { + *(.altinstr_aux) + } + INIT_DATA_SECTION(16) .x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) {