Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c0c52d28e05e8bdaa2126570c02ecb1a7358cecc
Commit:     c0c52d28e05e8bdaa2126570c02ecb1a7358cecc
Parent:     903675569e278af86aa08c2af238b0ab997065d1
Author:     Andreas Herrmann <[EMAIL PROTECTED]>
AuthorDate: Thu Nov 1 19:32:17 2007 +0100
Committer:  Thomas Gleixner <[EMAIL PROTECTED](none)>
CommitDate: Sat Nov 17 16:27:00 2007 +0100

    x86: show cpuinfo only for online CPUs
    
    Fix regressions introduced with 92cb7612aee39642d109b8d935ad265e602c0563.
    
    It can happen that cpuinfo is displayed for CPUs that are not online or
    even worse for CPUs not present at all. As an example, following was
    shown for a "second" CPU of a single core K8 variant:
    
        processor       : 0
        vendor_id       : unknown
        cpu family      : 0
        model           : 0
        model name      : unknown
        stepping        : 0
        cache size      : 0 KB
        fpu             : yes
        fpu_exception   : yes
        cpuid level     : 0
        wp              : yes
        flags           :
        bogomips        : 0.00
        clflush size    : 0
        cache_alignment : 0
        address sizes   : 0 bits physical, 0 bits virtual
        power management:
    
    Signed-off-by: Andreas Herrmann <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 arch/x86/kernel/cpu/proc.c |    8 +++-----
 arch/x86/kernel/setup_64.c |    8 +++-----
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
index 066f8c6..3900e46 100644
--- a/arch/x86/kernel/cpu/proc.c
+++ b/arch/x86/kernel/cpu/proc.c
@@ -89,8 +89,6 @@ static int show_cpuinfo(struct seq_file *m, void *v)
        int fpu_exception;
 
 #ifdef CONFIG_SMP
-       if (!cpu_online(n))
-               return 0;
        n = c->cpu_index;
 #endif
        seq_printf(m, "processor\t: %d\n"
@@ -177,14 +175,14 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 static void *c_start(struct seq_file *m, loff_t *pos)
 {
        if (*pos == 0)  /* just in case, cpu 0 is not the first */
-               *pos = first_cpu(cpu_possible_map);
-       if ((*pos) < NR_CPUS && cpu_possible(*pos))
+               *pos = first_cpu(cpu_online_map);
+       if ((*pos) < NR_CPUS && cpu_online(*pos))
                return &cpu_data(*pos);
        return NULL;
 }
 static void *c_next(struct seq_file *m, void *v, loff_t *pos)
 {
-       *pos = next_cpu(*pos, cpu_possible_map);
+       *pos = next_cpu(*pos, cpu_online_map);
        return c_start(m, pos);
 }
 static void c_stop(struct seq_file *m, void *v)
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index 238633d..3cb3874 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -1078,8 +1078,6 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 
 
 #ifdef CONFIG_SMP
-       if (!cpu_online(c->cpu_index))
-               return 0;
        cpu = c->cpu_index;
 #endif
 
@@ -1171,15 +1169,15 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 static void *c_start(struct seq_file *m, loff_t *pos)
 {
        if (*pos == 0)  /* just in case, cpu 0 is not the first */
-               *pos = first_cpu(cpu_possible_map);
-       if ((*pos) < NR_CPUS && cpu_possible(*pos))
+               *pos = first_cpu(cpu_online_map);
+       if ((*pos) < NR_CPUS && cpu_online(*pos))
                return &cpu_data(*pos);
        return NULL;
 }
 
 static void *c_next(struct seq_file *m, void *v, loff_t *pos)
 {
-       *pos = next_cpu(*pos, cpu_possible_map);
+       *pos = next_cpu(*pos, cpu_online_map);
        return c_start(m, pos);
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to