x86, intel, power: Correct the MSR_IA32_ENERGY_PERF_BIAS message
[linux-flexiantxendom0-natty.git] / arch / x86 / kernel / cpu / intel.c
index 3a683ea..24cba78 100644 (file)
@@ -39,6 +39,7 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
                        misc_enable &= ~MSR_IA32_MISC_ENABLE_LIMIT_CPUID;
                        wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
                        c->cpuid_level = cpuid_eax(0);
+                       get_cpu_cap(c);
                }
        }
 
@@ -283,9 +284,7 @@ static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c)
        /* Don't do the funky fallback heuristics the AMD version employs
           for now. */
        node = apicid_to_node[apicid];
-       if (node == NUMA_NO_NODE)
-               node = first_node(node_online_map);
-       else if (!node_online(node)) {
+       if (node == NUMA_NO_NODE || !node_online(node)) {
                /* reuse the value from init_cpu_to_node() */
                node = cpu_to_node(cpu);
        }
@@ -449,6 +448,24 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c)
 
        if (cpu_has(c, X86_FEATURE_VMX))
                detect_vmx_virtcap(c);
+
+       /*
+        * Initialize MSR_IA32_ENERGY_PERF_BIAS if BIOS did not.
+        * x86_energy_perf_policy(8) is available to change it at run-time
+        */
+       if (cpu_has(c, X86_FEATURE_EPB)) {
+               u64 epb;
+
+               rdmsrl(MSR_IA32_ENERGY_PERF_BIAS, epb);
+               if ((epb & 0xF) == ENERGY_PERF_BIAS_PERFORMANCE) {
+                       printk_once(KERN_WARNING "ENERGY_PERF_BIAS:"
+                               " Set to 'normal', was 'performance'\n"
+                               "ENERGY_PERF_BIAS: View and update with"
+                               " x86_energy_perf_policy(8)\n");
+                       epb = (epb & ~0xF) | ENERGY_PERF_BIAS_NORMAL;
+                       wrmsrl(MSR_IA32_ENERGY_PERF_BIAS, epb);
+               }
+       }
 }
 
 #ifdef CONFIG_X86_32