lkml.org 
[lkml]   [2010]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH 02/11] x86: Merge fpu_init()
    From
    On Sat, Aug 28, 2010 at 7:04 PM, Brian Gerst <brgerst@gmail.com> wrote:
    > @@ -80,7 +80,6 @@ static void __cpuinit init_thread_xstate(void)
    >  #endif
    >  }
    >
    > -#ifdef CONFIG_X86_64
    >  /*
    >  * Called at bootup to set up the initial FPU state that is later cloned
    >  * into all processes.
    > @@ -88,12 +87,20 @@ static void __cpuinit init_thread_xstate(void)
    >
    >  void __cpuinit fpu_init(void)
    >  {
    > -       unsigned long oldcr0 = read_cr0();
    > +       unsigned long cr0;
    > +       unsigned long cr4_mask = 0;
    >
    > -       set_in_cr4(X86_CR4_OSFXSR);
    > -       set_in_cr4(X86_CR4_OSXMMEXCPT);
    > +       if (cpu_has_fxsr)
    > +               cr4_mask |= X86_CR4_OSFXSR;
    > +       if (cpu_has_xmm)
    > +               cr4_mask |= X86_CR4_OSXMMEXCPT;
    > +       set_in_cr4(cr4_mask);

    Is calling set_in_cr4() unconditionally safe for 32-bit CPUs that
    don't have cr4? AFAICT, no, because it uses read_cr4().
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2010-08-29 20:33    [W:4.039 / U:0.036 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site