[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <96EC3B78-0E65-4464-B7F7-B0F9D2CCEF19@zytor.com>
Date: Wed, 20 Jan 2016 02:55:24 -0800
From: "H. Peter Anvin" <hpa@...or.com>
To: Borislav Petkov <bp@...e.de>
CC: Brian Gerst <brgerst@...il.com>,
the arch/x86 maintainers <x86@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Denys Vlasenko <dvlasenk@...hat.com>,
Andy Lutomirski <luto@...capital.net>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init
On January 20, 2016 2:50:18 AM PST, Borislav Petkov <bp@...e.de> 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 <bp@...e.de>
>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 <bp@...e.de>
>---
> 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.
Powered by blists - more mailing lists