[PATCH] x86: fix missing cpu_index initialisation - Kernel

This is a discussion on [PATCH] x86: fix missing cpu_index initialisation - Kernel ; >From f49bbb826d8ec87609a63fb014af6aacb16aac38 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Wed, 29 Oct 2008 15:13:09 -0500 Subject: [VOYAGER] x86: fix missing cpu_index initialisation Ever since commit 92cb7612aee39642d109b8d935ad265e602c0563 Author: Mike Travis Date: Fri Oct 19 20:35:04 2007 +0200 x86: convert ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: [PATCH] x86: fix missing cpu_index initialisation

  1. [PATCH] x86: fix missing cpu_index initialisation

    >From f49bbb826d8ec87609a63fb014af6aacb16aac38 Mon Sep 17 00:00:00 2001
    From: James Bottomley
    Date: Wed, 29 Oct 2008 15:13:09 -0500
    Subject: [VOYAGER] x86: fix missing cpu_index initialisation

    Ever since

    commit 92cb7612aee39642d109b8d935ad265e602c0563
    Author: Mike Travis
    Date: Fri Oct 19 20:35:04 2007 +0200

    x86: convert cpuinfo_x86 array to a per_cpu array

    We've had an extra field in cpuinfo_x86 which is cpu_index.
    Unfortunately, voyager has never initialised this, although the only
    noticeable impact seems to be that /proc/cpuinfo shows all zeros for
    the processor ids.

    Anyway, fix this by initialising the boot CPU properly and setting the
    index when the secondaries update.

    Signed-off-by: James Bottomley
    ---

    Depends on [VOYAGER] x86: add ability to test for boot CPU

    arch/x86/kernel/cpu/common.c | 2 ++
    arch/x86/mach-voyager/voyager_smp.c | 1 +
    2 files changed, 3 insertions(+), 0 deletions(-)

    diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
    index 93e9393..da8f15a 100644
    --- a/arch/x86/kernel/cpu/common.c
    +++ b/arch/x86/kernel/cpu/common.c
    @@ -549,6 +549,8 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
    this_cpu->c_early_init(c);

    validate_pat_support(c);
    +
    + c->cpu_index = boot_cpu_id;
    }

    void __init early_cpu_init(void)
    diff --git a/arch/x86/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c
    index 63ed72b..761d491 100644
    --- a/arch/x86/mach-voyager/voyager_smp.c
    +++ b/arch/x86/mach-voyager/voyager_smp.c
    @@ -415,6 +415,7 @@ void __init smp_store_cpu_info(int id)
    struct cpuinfo_x86 *c = &cpu_data(id);

    *c = boot_cpu_data;
    + c->cpu_index = id;

    identify_secondary_cpu(c);
    }
    --
    1.5.6.5



    --
    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/

  2. Re: [PATCH] x86: fix missing cpu_index initialisation

    On Thu, 2008-10-30 at 22:23 +0100, Ingo Molnar wrote:
    > * Yinghai Lu wrote:
    >
    > > CC arch/x86/kernel/cpu/common.o
    > > arch/x86/kernel/cpu/common.c: In function 'early_identify_cpu':
    > > arch/x86/kernel/cpu/common.c:553: error: 'boot_cpu_id' undeclared
    > > (first use in this function)
    > > arch/x86/kernel/cpu/common.c:553: error: (Each undeclared identifier
    > > is reported only once
    > > arch/x86/kernel/cpu/common.c:553: error: for each function it appears in.)
    > > make[2]: *** [arch/x86/kernel/cpu/common.o] Error 1
    > > make[1]: *** [arch/x86/kernel/cpu] Error 2
    > > make: *** [arch/x86/kernel] Error 2

    >
    > depends on this patch perhaps:
    >
    > Subject: [PATCH] fix compile breakage caused by dc1e35c6e95e8923cf1d3510438b63c600fee1e2


    Yes, sorry, that's what the line:


    > Signed-off-by: James Bottomley
    > ---
    >
    > Depends on [VOYAGER] x86: add ability to test for boot CPU
    >
    > arch/x86/kernel/cpu/common.c | 2 ++


    Was supposed to convey

    James


    --
    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/

  3. Re: [PATCH] x86: fix missing cpu_index initialisation


    * Yinghai Lu wrote:

    > CC arch/x86/kernel/cpu/common.o
    > arch/x86/kernel/cpu/common.c: In function 'early_identify_cpu':
    > arch/x86/kernel/cpu/common.c:553: error: 'boot_cpu_id' undeclared
    > (first use in this function)
    > arch/x86/kernel/cpu/common.c:553: error: (Each undeclared identifier
    > is reported only once
    > arch/x86/kernel/cpu/common.c:553: error: for each function it appears in.)
    > make[2]: *** [arch/x86/kernel/cpu/common.o] Error 1
    > make[1]: *** [arch/x86/kernel/cpu] Error 2
    > make: *** [arch/x86/kernel] Error 2


    depends on this patch perhaps:

    Subject: [PATCH] fix compile breakage caused by dc1e35c6e95e8923cf1d3510438b63c600fee1e2

    ?

    Ingo
    --
    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/

  4. Re: [PATCH] x86: fix missing cpu_index initialisation

    On Thu, Oct 30, 2008 at 2:13 PM, James Bottomley
    wrote:
    > >From f49bbb826d8ec87609a63fb014af6aacb16aac38 Mon Sep 17 00:00:00 2001

    > From: James Bottomley
    > Date: Wed, 29 Oct 2008 15:13:09 -0500
    > Subject: [VOYAGER] x86: fix missing cpu_index initialisation
    >
    > Ever since
    >
    > commit 92cb7612aee39642d109b8d935ad265e602c0563
    > Author: Mike Travis
    > Date: Fri Oct 19 20:35:04 2007 +0200
    >
    > x86: convert cpuinfo_x86 array to a per_cpu array
    >
    > We've had an extra field in cpuinfo_x86 which is cpu_index.
    > Unfortunately, voyager has never initialised this, although the only
    > noticeable impact seems to be that /proc/cpuinfo shows all zeros for
    > the processor ids.
    >
    > Anyway, fix this by initialising the boot CPU properly and setting the
    > index when the secondaries update.
    >
    > Signed-off-by: James Bottomley
    > ---
    >
    > Depends on [VOYAGER] x86: add ability to test for boot CPU
    >
    > arch/x86/kernel/cpu/common.c | 2 ++
    > arch/x86/mach-voyager/voyager_smp.c | 1 +
    > 2 files changed, 3 insertions(+), 0 deletions(-)
    >
    > diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
    > index 93e9393..da8f15a 100644
    > --- a/arch/x86/kernel/cpu/common.c
    > +++ b/arch/x86/kernel/cpu/common.c
    > @@ -549,6 +549,8 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
    > this_cpu->c_early_init(c);
    >
    > validate_pat_support(c);
    > +
    > + c->cpu_index = boot_cpu_id;
    > }

    ....
    CC arch/x86/kernel/cpu/common.o
    arch/x86/kernel/cpu/common.c: In function 'early_identify_cpu':
    arch/x86/kernel/cpu/common.c:553: error: 'boot_cpu_id' undeclared
    (first use in this function)
    arch/x86/kernel/cpu/common.c:553: error: (Each undeclared identifier
    is reported only once
    arch/x86/kernel/cpu/common.c:553: error: for each function it appears in.)
    make[2]: *** [arch/x86/kernel/cpu/common.o] Error 1
    make[1]: *** [arch/x86/kernel/cpu] Error 2
    make: *** [arch/x86/kernel] Error 2

    YH
    --
    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/

  5. Re: [PATCH] x86: fix missing cpu_index initialisation


    * James Bottomley wrote:

    > >From f49bbb826d8ec87609a63fb014af6aacb16aac38 Mon Sep 17 00:00:00 2001

    > From: James Bottomley
    > Date: Wed, 29 Oct 2008 15:13:09 -0500
    > Subject: [VOYAGER] x86: fix missing cpu_index initialisation
    >
    > Ever since
    >
    > commit 92cb7612aee39642d109b8d935ad265e602c0563
    > Author: Mike Travis
    > Date: Fri Oct 19 20:35:04 2007 +0200
    >
    > x86: convert cpuinfo_x86 array to a per_cpu array
    >
    > We've had an extra field in cpuinfo_x86 which is cpu_index.
    > Unfortunately, voyager has never initialised this, although the only
    > noticeable impact seems to be that /proc/cpuinfo shows all zeros for
    > the processor ids.
    >
    > Anyway, fix this by initialising the boot CPU properly and setting the
    > index when the secondaries update.
    >
    > Signed-off-by: James Bottomley
    > ---
    >
    > Depends on [VOYAGER] x86: add ability to test for boot CPU


    applied both to tip/x86/urgent:

    6b5496e: x86/voyager: fix missing cpu_index initialisation
    3b25aec: x86/voyager: fix compile breakage caused by dc1e35c6e95e8923cf1d35104

    thanks James,

    Ingo
    --
    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/

  6. Re: [PATCH] x86: fix missing cpu_index initialisation


    * Ingo Molnar wrote:

    > > Depends on [VOYAGER] x86: add ability to test for boot CPU

    >
    > applied both to tip/x86/urgent:
    >
    > 6b5496e: x86/voyager: fix missing cpu_index initialisation
    > 3b25aec: x86/voyager: fix compile breakage caused by dc1e35c6e95e8923cf1d35104


    this broke the x86 build:

    arch/x86/kernel/cpu/common.c: In function 'early_identify_cpu':
    arch/x86/kernel/cpu/common.c:553: error: 'struct cpuinfo_x86' has no member named 'cpu_index'

    fixed via the patch below.

    Ingo

    ---------->
    From 1c4acdb467f8a6704855a5670ff3d82e3c18eb0b Mon Sep 17 00:00:00 2001
    From: Ingo Molnar
    Date: Fri, 31 Oct 2008 00:43:03 +0100
    Subject: [PATCH] x86: cpu_index build fix

    fix:

    arch/x86/kernel/cpu/common.c: In function 'early_identify_cpu':
    arch/x86/kernel/cpu/common.c:553: error: 'struct cpuinfo_x86' has no member named 'cpu_index'

    as cpu_index is only available on SMP.

    Signed-off-by: Ingo Molnar
    ---
    arch/x86/kernel/cpu/common.c | 2 ++
    1 files changed, 2 insertions(+), 0 deletions(-)

    diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
    index da8f15a..003a653 100644
    --- a/arch/x86/kernel/cpu/common.c
    +++ b/arch/x86/kernel/cpu/common.c
    @@ -550,7 +550,9 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)

    validate_pat_support(c);

    +#ifdef CONFIG_SMP
    c->cpu_index = boot_cpu_id;
    +#endif
    }

    void __init early_cpu_init(void)
    --
    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/

  7. Re: [PATCH] x86: fix missing cpu_index initialisation


    * Ingo Molnar wrote:

    >
    > * Ingo Molnar wrote:
    >
    > > > Depends on [VOYAGER] x86: add ability to test for boot CPU

    > >
    > > applied both to tip/x86/urgent:
    > >
    > > 6b5496e: x86/voyager: fix missing cpu_index initialisation
    > > 3b25aec: x86/voyager: fix compile breakage caused by dc1e35c6e95e8923cf1d35104

    >
    > this broke the x86 build:
    >
    > arch/x86/kernel/cpu/common.c: In function 'early_identify_cpu':
    > arch/x86/kernel/cpu/common.c:553: error: 'struct cpuinfo_x86' has no member named 'cpu_index'
    >
    > fixed via the patch below.


    i just found a third build failure as well, caused by the voyager
    fixes:

    arch/x86/kernel/cpu/common.c: In function 'cpu_init':
    arch/x86/kernel/cpu/common.c:1141: error: 'boot_cpu_id' undeclared (first use in this function)
    arch/x86/kernel/cpu/common.c:1141: error: (Each undeclared identifier is reported only once
    arch/x86/kernel/cpu/common.c:1141: error: for each function it appears in.)

    (see the fix below)

    this raises the urgency the conversion of x86/Voyager to normal x86
    platform APIs.

    Ingo

    ---------------->
    From b342797c1e5116a130841527b47dfaa462ed0968 Mon Sep 17 00:00:00 2001
    From: Ingo Molnar
    Date: Fri, 31 Oct 2008 09:31:38 +0100
    Subject: [PATCH] x86: build fix

    Impact: build fix on certain UP configs

    fix:

    arch/x86/kernel/cpu/common.c: In function 'cpu_init':
    arch/x86/kernel/cpu/common.c:1141: error: 'boot_cpu_id' undeclared (first use in this function)
    arch/x86/kernel/cpu/common.c:1141: error: (Each undeclared identifier is reported only once
    arch/x86/kernel/cpu/common.c:1141: error: for each function it appears in.)

    Pull in asm/smp.h on UP, so that we get the definition of
    boot_cpu_id.

    Signed-off-by: Ingo Molnar
    ---
    arch/x86/kernel/cpu/common.c | 1 +
    1 files changed, 1 insertions(+), 0 deletions(-)

    diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
    index 003a653..b9c9ea0 100644
    --- a/arch/x86/kernel/cpu/common.c
    +++ b/arch/x86/kernel/cpu/common.c
    @@ -20,6 +20,7 @@
    #include
    #include
    #include
    +#include
    #ifdef CONFIG_X86_LOCAL_APIC
    #include
    #include
    --
    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/

+ Reply to Thread