Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / arch / i386 / kernel / cpu / proc.c
index f6da999..f94cdb7 100644 (file)
@@ -3,6 +3,7 @@
 #include <linux/string.h>
 #include <asm/semaphore.h>
 #include <linux/seq_file.h>
+#include <linux/cpufreq.h>
 
 /*
  *     Get CPU information for use by the procfs.
@@ -28,7 +29,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL,
                NULL, NULL, NULL, "mp", "nx", NULL, "mmxext", NULL,
-               NULL, "fxsr_opt", NULL, NULL, NULL, "lm", "3dnowext", "3dnow",
+               NULL, "fxsr_opt", "rdtscp", NULL, NULL, "lm", "3dnowext", "3dnow",
 
                /* Transmeta-defined */
                "recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL,
@@ -39,12 +40,12 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                /* Other (Linux-defined) */
                "cxmmx", "k6_mtrr", "cyrix_arr", "centaur_mcr",
                NULL, NULL, NULL, NULL,
-               NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+               "constant_tsc", "up", NULL, NULL, NULL, NULL, NULL, NULL,
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 
                /* Intel-defined (#2) */
-               "pni", NULL, NULL, "monitor", "ds_cpl", NULL, NULL, "est",
+               "pni", NULL, NULL, "monitor", "ds_cpl", "vmx", "smx", "est",
                "tm2", NULL, "cid", NULL, NULL, "cx16", "xtpr", NULL,
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -56,11 +57,21 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 
                /* AMD-defined (#2) */
-               "lahf_lm", "cmp_legacy", NULL, NULL, NULL, NULL, NULL, NULL,
+               "lahf_lm", "cmp_legacy", "svm", NULL, "cr8legacy", NULL, NULL, NULL,
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
        };
+       static char *x86_power_flags[] = {
+               "ts",   /* temperature sensor */
+               "fid",  /* frequency id control */
+               "vid",  /* voltage id control */
+               "ttp",  /* thermal trip */
+               "tm",
+               "stc",
+               NULL,
+               /* nothing */   /* constant_tsc - moved to flags */
+       };
        struct cpuinfo_x86 *c = v;
        int i, n = c - cpu_data;
        int fpu_exception;
@@ -86,20 +97,22 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                seq_printf(m, "stepping\t: unknown\n");
 
        if ( cpu_has(c, X86_FEATURE_TSC) ) {
-               seq_printf(m, "cpu MHz\t\t: %lu.%03lu\n",
-                       cpu_khz / 1000, (cpu_khz % 1000));
+               unsigned int freq = cpufreq_quick_get(n);
+               if (!freq)
+                       freq = cpu_khz;
+               seq_printf(m, "cpu MHz\t\t: %u.%03u\n",
+                       freq / 1000, (freq % 1000));
        }
 
        /* Cache size */
        if (c->x86_cache_size >= 0)
                seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size);
 #ifdef CONFIG_X86_HT
-       if (c->x86_num_cores * smp_num_siblings > 1) {
+       if (c->x86_max_cores * smp_num_siblings > 1) {
                seq_printf(m, "physical id\t: %d\n", phys_proc_id[n]);
-               seq_printf(m, "siblings\t: %d\n",
-                               c->x86_num_cores * smp_num_siblings);
+               seq_printf(m, "siblings\t: %d\n", cpus_weight(cpu_core_map[n]));
                seq_printf(m, "core id\t\t: %d\n", cpu_core_id[n]);
-               seq_printf(m, "cpu cores\t: %d\n", c->x86_num_cores);
+               seq_printf(m, "cpu cores\t: %d\n", c->booted_cores);
        }
 #endif
        
@@ -128,9 +141,20 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                     x86_cap_flags[i] != NULL )
                        seq_printf(m, " %s", x86_cap_flags[i]);
 
+       for (i = 0; i < 32; i++)
+               if (c->x86_power & (1 << i)) {
+                       if (i < ARRAY_SIZE(x86_power_flags) &&
+                           x86_power_flags[i])
+                               seq_printf(m, "%s%s",
+                                          x86_power_flags[i][0]?" ":"",
+                                          x86_power_flags[i]);
+                       else
+                               seq_printf(m, " [%d]", i);
+               }
+
        seq_printf(m, "\nbogomips\t: %lu.%02lu\n\n",
-                    HZ*(c->loops_per_jiffy >> 3)/62500,
-                    (HZ*(c->loops_per_jiffy >> 3)/625) % 100);
+                    c->loops_per_jiffy/(500000/HZ),
+                    (c->loops_per_jiffy/(5000/HZ)) % 100);
 
        return 0;
 }