* [PATCH] x86: fix missing cpu_index initialisation
@ 2008-10-30 21:13 James Bottomley
2008-10-30 21:21 ` Yinghai Lu
2008-10-30 23:17 ` Ingo Molnar
0 siblings, 2 replies; 7+ messages in thread
From: James Bottomley @ 2008-10-30 21:13 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner; +Cc: linux-kernel
>From f49bbb826d8ec87609a63fb014af6aacb16aac38 Mon Sep 17 00:00:00 2001
From: James Bottomley <James.Bottomley@HansenPartnership.com>
Date: Wed, 29 Oct 2008 15:13:09 -0500
Subject: [VOYAGER] x86: fix missing cpu_index initialisation
Ever since
commit 92cb7612aee39642d109b8d935ad265e602c0563
Author: Mike Travis <travis@sgi.com>
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 <James.Bottomley@HansenPartnership.com>
---
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] x86: fix missing cpu_index initialisation
2008-10-30 21:13 [PATCH] x86: fix missing cpu_index initialisation James Bottomley
@ 2008-10-30 21:21 ` Yinghai Lu
2008-10-30 21:23 ` Ingo Molnar
2008-10-30 23:17 ` Ingo Molnar
1 sibling, 1 reply; 7+ messages in thread
From: Yinghai Lu @ 2008-10-30 21:21 UTC (permalink / raw)
To: James Bottomley; +Cc: Ingo Molnar, Thomas Gleixner, linux-kernel
On Thu, Oct 30, 2008 at 2:13 PM, James Bottomley
<James.Bottomley@hansenpartnership.com> wrote:
> >From f49bbb826d8ec87609a63fb014af6aacb16aac38 Mon Sep 17 00:00:00 2001
> From: James Bottomley <James.Bottomley@HansenPartnership.com>
> Date: Wed, 29 Oct 2008 15:13:09 -0500
> Subject: [VOYAGER] x86: fix missing cpu_index initialisation
>
> Ever since
>
> commit 92cb7612aee39642d109b8d935ad265e602c0563
> Author: Mike Travis <travis@sgi.com>
> 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 <James.Bottomley@HansenPartnership.com>
> ---
>
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] x86: fix missing cpu_index initialisation
2008-10-30 21:21 ` Yinghai Lu
@ 2008-10-30 21:23 ` Ingo Molnar
2008-10-30 21:27 ` James Bottomley
0 siblings, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2008-10-30 21:23 UTC (permalink / raw)
To: Yinghai Lu; +Cc: James Bottomley, Thomas Gleixner, linux-kernel
* Yinghai Lu <yinghai@kernel.org> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] x86: fix missing cpu_index initialisation
2008-10-30 21:23 ` Ingo Molnar
@ 2008-10-30 21:27 ` James Bottomley
0 siblings, 0 replies; 7+ messages in thread
From: James Bottomley @ 2008-10-30 21:27 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Yinghai Lu, Thomas Gleixner, linux-kernel
On Thu, 2008-10-30 at 22:23 +0100, Ingo Molnar wrote:
> * Yinghai Lu <yinghai@kernel.org> 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 <James.Bottomley@HansenPartnership.com>
> ---
>
> Depends on [VOYAGER] x86: add ability to test for boot CPU
>
> arch/x86/kernel/cpu/common.c | 2 ++
Was supposed to convey
James
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] x86: fix missing cpu_index initialisation
2008-10-30 21:13 [PATCH] x86: fix missing cpu_index initialisation James Bottomley
2008-10-30 21:21 ` Yinghai Lu
@ 2008-10-30 23:17 ` Ingo Molnar
2008-10-30 23:45 ` Ingo Molnar
1 sibling, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2008-10-30 23:17 UTC (permalink / raw)
To: James Bottomley; +Cc: Thomas Gleixner, linux-kernel, Yinghai Lu, H. Peter Anvin
* James Bottomley <James.Bottomley@HansenPartnership.com> wrote:
> >From f49bbb826d8ec87609a63fb014af6aacb16aac38 Mon Sep 17 00:00:00 2001
> From: James Bottomley <James.Bottomley@HansenPartnership.com>
> Date: Wed, 29 Oct 2008 15:13:09 -0500
> Subject: [VOYAGER] x86: fix missing cpu_index initialisation
>
> Ever since
>
> commit 92cb7612aee39642d109b8d935ad265e602c0563
> Author: Mike Travis <travis@sgi.com>
> 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 <James.Bottomley@HansenPartnership.com>
> ---
>
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] x86: fix missing cpu_index initialisation
2008-10-30 23:17 ` Ingo Molnar
@ 2008-10-30 23:45 ` Ingo Molnar
2008-10-31 8:44 ` Ingo Molnar
0 siblings, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2008-10-30 23:45 UTC (permalink / raw)
To: James Bottomley; +Cc: Thomas Gleixner, linux-kernel, Yinghai Lu, H. Peter Anvin
* Ingo Molnar <mingo@elte.hu> 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 <mingo@elte.hu>
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 <mingo@elte.hu>
---
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)
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] x86: fix missing cpu_index initialisation
2008-10-30 23:45 ` Ingo Molnar
@ 2008-10-31 8:44 ` Ingo Molnar
0 siblings, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2008-10-31 8:44 UTC (permalink / raw)
To: James Bottomley; +Cc: Thomas Gleixner, linux-kernel, Yinghai Lu, H. Peter Anvin
* Ingo Molnar <mingo@elte.hu> wrote:
>
> * Ingo Molnar <mingo@elte.hu> 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 <mingo@elte.hu>
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 <mingo@elte.hu>
---
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 <asm/pat.h>
#include <asm/asm.h>
#include <asm/numa.h>
+#include <asm/smp.h>
#ifdef CONFIG_X86_LOCAL_APIC
#include <asm/mpspec.h>
#include <asm/apic.h>
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-10-31 8:44 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-30 21:13 [PATCH] x86: fix missing cpu_index initialisation James Bottomley
2008-10-30 21:21 ` Yinghai Lu
2008-10-30 21:23 ` Ingo Molnar
2008-10-30 21:27 ` James Bottomley
2008-10-30 23:17 ` Ingo Molnar
2008-10-30 23:45 ` Ingo Molnar
2008-10-31 8:44 ` Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox