Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1313116

Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init

From "H. Peter Anvin" <hpa@zytor.com>
Newsgroups linux.kernel
Subject Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init
Date 2016-01-20 12:00 +0100
Message-ID <qSYEz-5ea-13@gated-at.bofh.it> (permalink)
References (6 earlier) <qSALU-5Mg-9@gated-at.bofh.it> <qSSfM-16M-41@gated-at.bofh.it> <qSSIO-1jE-65@gated-at.bofh.it> <qSSSu-1pe-35@gated-at.bofh.it> <qSYEz-5ea-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On January 20, 2016 2:50:18 AM PST, Borislav Petkov <bp@suse.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@suse.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@suse.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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] x86: static_cpu_has_safe: discard dynamic check after init Brian Gerst <brgerst@gmail.com> - 2016-01-16 20:30 +0100
  Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init Borislav Petkov <bp@suse.de> - 2016-01-16 20:40 +0100
    Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init Brian Gerst <brgerst@gmail.com> - 2016-01-16 21:00 +0100
      Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init Borislav Petkov <bp@suse.de> - 2016-01-17 11:40 +0100
        Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init Brian Gerst <brgerst@gmail.com> - 2016-01-18 18:00 +0100
          Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init Andy Lutomirski <luto@amacapital.net> - 2016-01-18 18:50 +0100
          Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init Borislav Petkov <bp@suse.de> - 2016-01-18 19:20 +0100
            Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init Andy Lutomirski <luto@amacapital.net> - 2016-01-18 19:30 +0100
              Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init Borislav Petkov <bp@suse.de> - 2016-01-18 19:40 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init "H. Peter Anvin" <hpa@zytor.com> - 2016-01-18 20:50 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init Borislav Petkov <bp@suse.de> - 2016-01-19 00:10 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init "H. Peter Anvin" <hpa@zytor.com> - 2016-01-19 00:20 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init Borislav Petkov <bp@suse.de> - 2016-01-19 00:30 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init Borislav Petkov <bp@suse.de> - 2016-01-19 15:00 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init Borislav Petkov <bp@suse.de> - 2016-01-19 17:30 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init Borislav Petkov <bp@suse.de> - 2016-01-20 00:20 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init Andy Lutomirski <luto@amacapital.net> - 2016-01-20 00:30 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init Boris Petkov <bp@suse.de> - 2016-01-20 01:00 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init "H. Peter Anvin" <hpa@zytor.com> - 2016-01-20 05:10 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init Borislav Petkov <bp@suse.de> - 2016-01-20 11:40 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init "H. Peter Anvin" <hpa@zytor.com> - 2016-01-20 11:50 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init Borislav Petkov <bp@suse.de> - 2016-01-21 23:20 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init "H. Peter Anvin" <hpa@zytor.com> - 2016-01-21 23:30 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init Borislav Petkov <bp@suse.de> - 2016-01-22 00:00 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init "H. Peter Anvin" <hpa@zytor.com> - 2016-01-22 00:40 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init "H. Peter Anvin" <hpa@zytor.com> - 2016-01-22 00:40 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init Borislav Petkov <bp@suse.de> - 2016-01-22 11:40 +0100
            Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init Borislav Petkov <bp@suse.de> - 2016-01-18 20:00 +0100
              Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init Borislav Petkov <bp@suse.de> - 2016-01-19 02:20 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init "H. Peter Anvin" <hpa@zytor.com> - 2016-01-19 02:40 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init Borislav Petkov <bp@suse.de> - 2016-01-19 10:30 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init "H. Peter Anvin" <hpa@zytor.com> - 2016-01-20 05:10 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init Brian Gerst <brgerst@gmail.com> - 2016-01-20 05:40 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init "H. Peter Anvin" <hpa@zytor.com> - 2016-01-20 05:50 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init "H. Peter Anvin" <hpa@zytor.com> - 2016-01-20 12:00 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init Borislav Petkov <bp@suse.de> - 2016-01-20 12:10 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init "H. Peter Anvin" <hpa@zytor.com> - 2016-01-20 15:50 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init Borislav Petkov <bp@suse.de> - 2016-01-20 12:00 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init Borislav Petkov <bp@suse.de> - 2016-01-20 16:10 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init "H. Peter Anvin" <hpa@zytor.com> - 2016-01-20 16:20 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init Borislav Petkov <bp@suse.de> - 2016-01-20 17:10 +0100
                Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after  init "H. Peter Anvin" <hpa@zytor.com> - 2016-01-20 17:20 +0100

csiph-web