lkml.org 
[lkml]   [2008]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH] [11/20] x86: Use the correct cpuid method to detect MWAIT support for C states
    Date
    On Thursday 03 January 2008 11:45:26 Ingo Molnar wrote:
    >
    > * Andi Kleen <ak@suse.de> wrote:
    >
    > > +static int mwait_usable(const struct cpuinfo_x86 *c)
    > > +{
    > > + if (force_mwait)
    > > + return 1;
    > > + /* Any C1 states supported? */
    > > + return c->cpuid_level >= 5 && ((cpuid_edx(5) >> 4) & 0xf) > 0;
    > > +}
    > > +
    > > void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
    > > {
    > > - if (cpu_has(c, X86_FEATURE_MWAIT)) {
    > > + if (cpu_has(c, X86_FEATURE_MWAIT) && mwait_usable(c)) {
    > > printk("monitor/mwait feature present.\n");
    >
    > hm, why not clear FEATURE_MWAIT if it's "not usable"? That's the
    > standard approach we do for CPU features that do not work.

    Well it works, just in a unexpected way not useful to the kernel.

    At least on AMD there is a bit to enable it for ring 3 too, so
    in theory someone could use it anyways.

    -Andi



    \
     
     \ /
      Last update: 2008-01-03 14:09    [W:3.092 / U:0.744 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site