public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: don't use current_cpu_data in x2apic phys_pkg_id
@ 2009-07-25 10:23 Yinghai Lu
  2009-07-27 18:44 ` Suresh Siddha
  2009-08-04 15:32 ` [tip:x86/urgent] x86: Don't " tip-bot for Yinghai Lu
  0 siblings, 2 replies; 3+ messages in thread
From: Yinghai Lu @ 2009-07-25 10:23 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Suresh Siddha,
	Andrew Morton
  Cc: linux-kernel@vger.kernel.org


one system that socket 1 come up as BSP. kexeced kernel report BSP as:
[    1.524550] Initializing cgroup subsys cpuacct
[    1.536064] initial_apicid:20
[    1.537135] ht_mask_width:1
[    1.538128] core_select_mask:f
[    1.539126] core_plus_mask_width:5
[    1.558479] CPU: Physical Processor ID: 0
[    1.559501] CPU: Processor Core ID: 0
[    1.560539] CPU: L1 I cache: 32K, L1 D cache: 32K
[    1.579098] CPU: L2 cache: 256K
[    1.580085] CPU: L3 cache: 24576K
[    1.581108] CPU 0/0x20 -> Node 0
[    1.596193] CPU 0 microcode level: 0xffff0008

it doesn't have correct physical processor id. and will get error
[   38.840859] CPU0 attaching sched-domain:
[   38.848287]  domain 0: span 0,8,72 level SIBLING
[   38.851151]   groups: 0 8 72
[   38.858137]   domain 1: span 0,8-15,72-79 level MC
[   38.868944]    groups: 0,8,72 9,73 10,74 11,75 12,76 13,77 14,78 15,79
[   38.881383] ERROR: parent span is not a superset of domain->span
[   38.890724]    domain 2: span 0-7,64-71 level CPU
[   38.899237] ERROR: domain->groups does not contain CPU0
[   38.909229]     groups: 8-15,72-79
[   38.912547] ERROR: groups don't span domain->span
[   38.919665]     domain 3: span 0-127 level NODE
[   38.930739]      groups: 0-7,64-71 8-15,72-79 16-23,80-87 24-31,88-95 32-39,96-103 40-47,104-111 48-55,112-119 56-63,120-127

it turns out:
we can not use current_cpu_data in phys_pgd_id for x2apic.

identify_boot_cpu is called by check_bugs before smp_prepare_cpus.
and till smp_prepare_cpus current_cpu_data for bsp is assigned with
boot_cpu_data

just make phys_pkg_id for x2apic is aligned to xapic

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 arch/x86/kernel/apic/x2apic_cluster.c |    2 +-
 arch/x86/kernel/apic/x2apic_phys.c    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/arch/x86/kernel/apic/x2apic_cluster.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/apic/x2apic_cluster.c
+++ linux-2.6/arch/x86/kernel/apic/x2apic_cluster.c
@@ -170,7 +170,7 @@ static unsigned long set_apic_id(unsigne
 
 static int x2apic_cluster_phys_pkg_id(int initial_apicid, int index_msb)
 {
-	return current_cpu_data.initial_apicid >> index_msb;
+	return initial_apicid >> index_msb;
 }
 
 static void x2apic_send_IPI_self(int vector)
Index: linux-2.6/arch/x86/kernel/apic/x2apic_phys.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/apic/x2apic_phys.c
+++ linux-2.6/arch/x86/kernel/apic/x2apic_phys.c
@@ -162,7 +162,7 @@ static unsigned long set_apic_id(unsigne
 
 static int x2apic_phys_pkg_id(int initial_apicid, int index_msb)
 {
-	return current_cpu_data.initial_apicid >> index_msb;
+	return initial_apicid >> index_msb;
 }
 
 static void x2apic_send_IPI_self(int vector)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: don't use current_cpu_data in x2apic phys_pkg_id
  2009-07-25 10:23 [PATCH] x86: don't use current_cpu_data in x2apic phys_pkg_id Yinghai Lu
@ 2009-07-27 18:44 ` Suresh Siddha
  2009-08-04 15:32 ` [tip:x86/urgent] x86: Don't " tip-bot for Yinghai Lu
  1 sibling, 0 replies; 3+ messages in thread
From: Suresh Siddha @ 2009-07-27 18:44 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Andrew Morton,
	linux-kernel@vger.kernel.org

On Sat, 2009-07-25 at 03:23 -0700, Yinghai Lu wrote:
> one system that socket 1 come up as BSP. kexeced kernel report BSP as:
> [    1.524550] Initializing cgroup subsys cpuacct
> [    1.536064] initial_apicid:20
> [    1.537135] ht_mask_width:1
> [    1.538128] core_select_mask:f
> [    1.539126] core_plus_mask_width:5
> [    1.558479] CPU: Physical Processor ID: 0
> [    1.559501] CPU: Processor Core ID: 0
> [    1.560539] CPU: L1 I cache: 32K, L1 D cache: 32K
> [    1.579098] CPU: L2 cache: 256K
> [    1.580085] CPU: L3 cache: 24576K
> [    1.581108] CPU 0/0x20 -> Node 0
> [    1.596193] CPU 0 microcode level: 0xffff0008
> 
> it doesn't have correct physical processor id. and will get error
> [   38.840859] CPU0 attaching sched-domain:
> [   38.848287]  domain 0: span 0,8,72 level SIBLING
> [   38.851151]   groups: 0 8 72
> [   38.858137]   domain 1: span 0,8-15,72-79 level MC
> [   38.868944]    groups: 0,8,72 9,73 10,74 11,75 12,76 13,77 14,78 15,79
> [   38.881383] ERROR: parent span is not a superset of domain->span
> [   38.890724]    domain 2: span 0-7,64-71 level CPU
> [   38.899237] ERROR: domain->groups does not contain CPU0
> [   38.909229]     groups: 8-15,72-79
> [   38.912547] ERROR: groups don't span domain->span
> [   38.919665]     domain 3: span 0-127 level NODE
> [   38.930739]      groups: 0-7,64-71 8-15,72-79 16-23,80-87 24-31,88-95 32-39,96-103 40-47,104-111 48-55,112-119 56-63,120-127
> 
> it turns out:
> we can not use current_cpu_data in phys_pgd_id for x2apic.
> 
> identify_boot_cpu is called by check_bugs before smp_prepare_cpus.
> and till smp_prepare_cpus current_cpu_data for bsp is assigned with
> boot_cpu_data
> 
> just make phys_pkg_id for x2apic is aligned to xapic
> 
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>

Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:x86/urgent] x86: Don't use current_cpu_data in x2apic phys_pkg_id
  2009-07-25 10:23 [PATCH] x86: don't use current_cpu_data in x2apic phys_pkg_id Yinghai Lu
  2009-07-27 18:44 ` Suresh Siddha
@ 2009-08-04 15:32 ` tip-bot for Yinghai Lu
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Yinghai Lu @ 2009-08-04 15:32 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, yinghai, akpm, suresh.b.siddha, tglx,
	mingo

Commit-ID:  d8c7eb34c2db6268909ae8c3958be63bde254292
Gitweb:     http://git.kernel.org/tip/d8c7eb34c2db6268909ae8c3958be63bde254292
Author:     Yinghai Lu <yinghai@kernel.org>
AuthorDate: Sat, 25 Jul 2009 03:23:09 -0700
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Tue, 4 Aug 2009 16:22:44 +0200

x86: Don't use current_cpu_data in x2apic phys_pkg_id

One system has socket 1 come up as BSP.

kexeced kernel reports BSP as:

[    1.524550] Initializing cgroup subsys cpuacct
[    1.536064] initial_apicid:20
[    1.537135] ht_mask_width:1
[    1.538128] core_select_mask:f
[    1.539126] core_plus_mask_width:5
[    1.558479] CPU: Physical Processor ID: 0
[    1.559501] CPU: Processor Core ID: 0
[    1.560539] CPU: L1 I cache: 32K, L1 D cache: 32K
[    1.579098] CPU: L2 cache: 256K
[    1.580085] CPU: L3 cache: 24576K
[    1.581108] CPU 0/0x20 -> Node 0
[    1.596193] CPU 0 microcode level: 0xffff0008

It doesn't have correct physical processor id and will get an
error:

[   38.840859] CPU0 attaching sched-domain:
[   38.848287]  domain 0: span 0,8,72 level SIBLING
[   38.851151]   groups: 0 8 72
[   38.858137]   domain 1: span 0,8-15,72-79 level MC
[   38.868944]    groups: 0,8,72 9,73 10,74 11,75 12,76 13,77 14,78 15,79
[   38.881383] ERROR: parent span is not a superset of domain->span
[   38.890724]    domain 2: span 0-7,64-71 level CPU
[   38.899237] ERROR: domain->groups does not contain CPU0
[   38.909229]     groups: 8-15,72-79
[   38.912547] ERROR: groups don't span domain->span
[   38.919665]     domain 3: span 0-127 level NODE
[   38.930739]      groups: 0-7,64-71 8-15,72-79 16-23,80-87 24-31,88-95 32-39,96-103 40-47,104-111 48-55,112-119 56-63,120-127

it turns out: we can not use current_cpu_data in phys_pgd_id
for x2apic.

identify_boot_cpu() is called by check_bugs() before
smp_prepare_cpus() and till smp_prepare_cpus() current_cpu_data
for bsp is assigned with boot_cpu_data.

Just make phys_pkg_id for x2apic is aligned to xapic.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
LKML-Reference: <4A6ADD0D.10002@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 arch/x86/kernel/apic/x2apic_cluster.c |    2 +-
 arch/x86/kernel/apic/x2apic_phys.c    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c
index 8e4cbb2..2ed4e2b 100644
--- a/arch/x86/kernel/apic/x2apic_cluster.c
+++ b/arch/x86/kernel/apic/x2apic_cluster.c
@@ -170,7 +170,7 @@ static unsigned long set_apic_id(unsigned int id)
 
 static int x2apic_cluster_phys_pkg_id(int initial_apicid, int index_msb)
 {
-	return current_cpu_data.initial_apicid >> index_msb;
+	return initial_apicid >> index_msb;
 }
 
 static void x2apic_send_IPI_self(int vector)
diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c
index a284359..0b631c6 100644
--- a/arch/x86/kernel/apic/x2apic_phys.c
+++ b/arch/x86/kernel/apic/x2apic_phys.c
@@ -162,7 +162,7 @@ static unsigned long set_apic_id(unsigned int id)
 
 static int x2apic_phys_pkg_id(int initial_apicid, int index_msb)
 {
-	return current_cpu_data.initial_apicid >> index_msb;
+	return initial_apicid >> index_msb;
 }
 
 static void x2apic_send_IPI_self(int vector)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-08-04 15:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-25 10:23 [PATCH] x86: don't use current_cpu_data in x2apic phys_pkg_id Yinghai Lu
2009-07-27 18:44 ` Suresh Siddha
2009-08-04 15:32 ` [tip:x86/urgent] x86: Don't " tip-bot for Yinghai Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox