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


Groups > linux.kernel > #1517395

Re: [PATCH 2/4] x86: Prepare vm86 tasks to handle User-Mode Instruction Prevention

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH 2/4] x86: Prepare vm86 tasks to handle User-Mode Instruction Prevention
Date 2016-11-08 18:10 +0100
Message-ID <sBi4i-3IU-31@gated-at.bofh.it> (permalink)
References <sB7Vg-5Hp-5@gated-at.bofh.it> <sB7Vg-5Hp-27@gated-at.bofh.it> <sBh8e-37L-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Nov 08, 2016 at 08:01:39AM -0800, Andy Lutomirski wrote:
> > diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
> > index 0888a87..32b7301 100644
> > --- a/arch/x86/kernel/process.c
> > +++ b/arch/x86/kernel/process.c
> > @@ -233,6 +233,16 @@ void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
> >                  */
> >                 memset(tss->io_bitmap, 0xff, prev->io_bitmap_max);
> >         }
> > +
> > +#if defined(CONFIG_VM86) && defined(CONFIG_X86_INTEL_UMIP)
> > +       if (next->vm86 && next->vm86->saved_sp0 && next->vm86->disable_x86_umip)
> > +               cr4_clear_bits(X86_CR4_UMIP);
> > +       else {
> > +               if (static_cpu_has(X86_FEATURE_UMIP))
> > +                       cr4_set_bits(X86_CR4_UMIP);
> > +       }
> > +#endif
> > +
> 
> NAK.  If this code is going to exist, it needs to be deeply buried in
> some unlikely if statement that already exists.  There's no good
> reason to penalize all context switches to support some nonsensical
> vm86 use case.

Agreed, now if instead vm86 get to emulate these instructions, this all
magically goes away..

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


Thread

[PATCH 0/4] x86: enable User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-11-08 07:20 +0100
  [PATCH 3/4] x86: Enable User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-11-08 07:20 +0100
  [PATCH 4/4] selftests/x86: Add tests for User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-11-08 07:20 +0100
  [PATCH 2/4] x86: Prepare vm86 tasks to handle User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-11-08 07:20 +0100
    Re: [PATCH 2/4] x86: Prepare vm86 tasks to handle User-Mode  Instruction Prevention Andy Lutomirski <luto@amacapital.net> - 2016-11-08 17:10 +0100
      Re: [PATCH 2/4] x86: Prepare vm86 tasks to handle User-Mode  Instruction Prevention Peter Zijlstra <peterz@infradead.org> - 2016-11-08 18:10 +0100
        Re: [PATCH 2/4] x86: Prepare vm86 tasks to handle User-Mode  Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-11-09 05:30 +0100
  Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Peter Zijlstra <peterz@infradead.org> - 2016-11-08 14:20 +0100
    Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Andy Lutomirski <luto@amacapital.net> - 2016-11-08 16:40 +0100
      Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Thomas Gleixner <tglx@linutronix.de> - 2016-11-08 18:00 +0100
        Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-11-09 05:30 +0100
      Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-11-09 05:40 +0100
        Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Andy Lutomirski <luto@amacapital.net> - 2016-11-09 12:40 +0100
          Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-11-10 07:50 +0100
            Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Stas Sergeev <stsp@list.ru> - 2016-11-10 10:00 +0100
              Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-11-11 05:20 +0100

csiph-web