linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andy Lutomirski <luto@amacapital.net>,
	Brian Gerst <brgerst@gmail.com>, X86 ML <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 4/6] x86/alternatives: Add an auxilary section
Date: Sun, 24 Jan 2016 10:28:46 +0100	[thread overview]
Message-ID: <1453627728-27197-5-git-send-email-bp@alien8.de> (raw)
In-Reply-To: <1453627728-27197-1-git-send-email-bp@alien8.de>

From: Borislav Petkov <bp@suse.de>

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 <bp@suse.de>
---
 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 4f1994257a18..04afe9b7e52a 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) {
-- 
2.3.5

  parent reply	other threads:[~2016-01-24  9:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-24  9:28 [PATCH 0/6] x86/cpufeature: Cleanups and improvements v1 Borislav Petkov
2016-01-24  9:28 ` [PATCH 1/6] x86/cpufeature: Carve out X86_FEATURE_* Borislav Petkov
2016-01-24  9:28 ` [PATCH 2/6] x86/cpufeature: Replace the old static_cpu_has() with safe variant Borislav Petkov
2016-01-24  9:28 ` [PATCH 3/6] x86/cpufeature: Get rid of the non-asm goto variant Borislav Petkov
2016-01-24  9:28 ` Borislav Petkov [this message]
2016-01-24  9:28 ` [PATCH 5/6] x86/alternatives: Discard dynamic check after init Borislav Petkov
2016-01-24  9:28 ` [PATCH 6/6] x86/vdso: Use static_cpu_has() Borislav Petkov
2016-01-25 18:45   ` Andy Lutomirski
2016-01-25 18:58     ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453627728-27197-5-git-send-email-bp@alien8.de \
    --to=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).