x86: fix missing cpu_index initialisation
PATCH 1/1 x86: fix missing cpu_index initialisation
Quoted 1 line
From
f49bbb826d8ec87609a63fb014af6aacb16aac38Mon Sep 17 00:00:00 2001
From: James Bottomley <[email protected]>
Date: Wed, 29 Oct 2008 15:13:09 -0500
Subject: [VOYAGER] x86: fix missing cpu_index initialisation
Ever since
commit 92cb7612aee39642d109b8d935ad265e602c0563
Author: Mike Travis <[email protected]> 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.
---
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(-)
arch/x86/kernel/cpu/common.c +2 -0
@@ -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 )
arch/x86/mach-voyager/voyager_smp.c +1 -0
@@ -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); }
Signature · 1 line
1.5.6.5
Quoted 35 lines · James Bottomley
Quoted 1 line
From
f49bbb826d8ec87609a63fb014af6aacb16aac38Mon Sep 17 00:00:00 2001From: James Bottomley <[email protected]>
Date: Wed, 29 Oct 2008 15:13:09 -0500
Subject: [VOYAGER] x86: fix missingcpu_indexinitialisationEver since
commit
92cb7612aee39642d109b8d935ad265e602c0563Author: Mike Travis <[email protected]> Date: Fri Oct 19 20:35:04 2007 +0200x86: convert
cpuinfo_x86array to aper_cpuarrayWe've had an extra field in
cpuinfo_x86which iscpu_index. Unfortunately, voyager has never initialised this, although the only noticeable impact seems to be that/proc/cpuinfoshows 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 <[email protected]>---
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(-)arch/x86/kernel/cpu/common.c +0
-0
arch/x86/kernel/cpu/common.c static void __init early_identify_cpu(struct cpuinfo_x86 *c) · line 554
Quoted 6 lines
arch/x86/kernel/cpu/common.c +2
-0@@ -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.oarch/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 oncearch/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
Quoted 10 lines · Yinghai Lu
CC
arch/x86/kernel/cpu/common.oarch/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 oncearch/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
Quoted 13 lines · Ingo Molnar
Quoted 10 lines · Yinghai Lu
CC
arch/x86/kernel/cpu/common.oarch/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 oncearch/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
Quoted 3 lines
depends on this patch perhaps:
Subject: [PATCH] fix compile breakage caused by
dc1e35c6e95e8923cf1d3510438b63c600fee1e2
Yes, sorry, that's what the line:
Quoted 6 lines
Signed-off-by James Bottomley <[email protected]>---
Depends on [VOYAGER] x86: add ability to test for boot CPU
arch/x86/kernel/cpu/common.c | 2 ++
Was supposed to convey
James
Ingo Molnar
AppliedQuoted 18 lines · James Bottomley
Quoted 1 line
From
f49bbb826d8ec87609a63fb014af6aacb16aac38Mon Sep 17 00:00:00 2001From: James Bottomley <[email protected]>
Date: Wed, 29 Oct 2008 15:13:09 -0500
Subject: [VOYAGER] x86: fix missingcpu_indexinitialisationEver since
commit
92cb7612aee39642d109b8d935ad265e602c0563Author: Mike Travis <[email protected]> Date: Fri Oct 19 20:35:04 2007 +0200x86: convert
cpuinfo_x86array to aper_cpuarrayWe've had an extra field in
cpuinfo_x86which iscpu_index. Unfortunately, voyager has never initialised this, although the only noticeable impact seems to be that/proc/cpuinfoshows all zeros for the processor ids.
Quoted 7 lines
Anyway, fix this by initialising the boot CPU properly and setting the index when the secondaries update.
Signed-off-by James Bottomley <[email protected]>---
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
Quoted 6 lines · Ingo Molnar
Quoted 1 line
Depends on [VOYAGER] x86: add ability to test for boot CPU
applied both to tip/x86/urgent:
6b5496e: x86/voyager: fix missing
cpu_indexinitialisation 3b25aec: x86/voyager: fix compile breakage caused bydc1e35c6e95e8923cf1d35104
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
---------->
Quoted 1 line
From
1c4acdb467f8a6704855a5670ff3d82e3c18eb0bMon Sep 17 00:00:00 2001
From: Ingo Molnar <[email protected]>
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.
--- arch/x86/kernel/cpu/common.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
arch/x86/kernel/cpu/common.c +2 -0
@@ -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 )
Quoted 10 lines · Ingo Molnar
Quoted 6 lines · Ingo Molnar
Quoted 1 line
Depends on [VOYAGER] x86: add ability to test for boot CPU
applied both to tip/x86/urgent:
6b5496e: x86/voyager: fix missing
cpu_indexinitialisation 3b25aec: x86/voyager: fix compile breakage caused bydc1e35c6e95e8923cf1d35104
Quoted 6 lines
this broke the x86 build:
arch/x86/kernel/cpu/common.c: In function 'early_identify_cpu':
arch/x86/kernel/cpu/common.c:553: error: 'structcpuinfo_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
---------------->
Quoted 1 line
From
b342797c1e5116a130841527b47dfaa462ed0968Mon Sep 17 00:00:00 2001
From: Ingo Molnar <[email protected]>
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.
--- arch/x86/kernel/cpu/common.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/x86/kernel/cpu/common.c +1 -0
@@ -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>