All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Yinghai Lu <yinghai@kernel.org>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	yinghai@kernel.org, torvalds@linux-foundation.org,
	shai@scalex86.org, gorcunov@gmail.com, kiran@scalex86.org,
	suresh.b.siddha@intel.com, tglx@linutronix.de, mingo@elte.hu
Subject: [tip:x86/urgent] x86: Fix vSMP boot crash
Date: Wed, 26 Aug 2009 08:15:59 GMT	[thread overview]
Message-ID: <tip-295594e9cf6ae2efd73371777aa8feba0f87f42f@git.kernel.org> (raw)
In-Reply-To: <4A944D3C.5030100@kernel.org>

Commit-ID:  295594e9cf6ae2efd73371777aa8feba0f87f42f
Gitweb:     http://git.kernel.org/tip/295594e9cf6ae2efd73371777aa8feba0f87f42f
Author:     Yinghai Lu <yinghai@kernel.org>
AuthorDate: Tue, 25 Aug 2009 13:44:44 -0700
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 26 Aug 2009 10:13:17 +0200

x86: Fix vSMP boot crash

2.6.31-rc7 does not boot on vSMP systems:

[    8.501108] CPU31: Thermal monitoring enabled (TM1)
[    8.501127] CPU 31 MCA banks SHD:2 SHD:3 SHD:5 SHD:6 SHD:8
[    8.650254] CPU31: Intel(R) Xeon(R) CPU           E5540  @ 2.53GHz stepping 04
[    8.710324] Brought up 32 CPUs
[    8.713916] Total of 32 processors activated (162314.96 BogoMIPS).
[    8.721489] ERROR: parent span is not a superset of domain->span
[    8.727686] ERROR: domain->groups does not contain CPU0
[    8.733091] ERROR: groups don't span domain->span
[    8.737975] ERROR: domain->cpu_power not set
[    8.742416]

Ravikiran Thirumalai bisected it to:

| commit 2759c3287de27266e06f1f4e82cbd2d65f6a044c
| x86: don't call read_apic_id if !cpu_has_apic

The problem is that on vSMP systems the CPUID derived
initial-APICIDs are overlapping - so we need to fall
back on hard_smp_processor_id() which reads the local
APIC.

Both come from the hardware (influenced by firmware
though) so it's a tough call which one to trust.

Doing the quirk expresses the vSMP property properly
and also does not affect other systems, so we go for
this solution instead of a revert.

Reported-and-Tested-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Shai Fultheim <shai@scalex86.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
LKML-Reference: <4A944D3C.5030100@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 arch/x86/kernel/apic/probe_64.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/apic/probe_64.c b/arch/x86/kernel/apic/probe_64.c
index bc3e880..fcec2f1 100644
--- a/arch/x86/kernel/apic/probe_64.c
+++ b/arch/x86/kernel/apic/probe_64.c
@@ -44,6 +44,11 @@ static struct apic *apic_probe[] __initdata = {
 	NULL,
 };
 
+static int apicid_phys_pkg_id(int initial_apic_id, int index_msb)
+{
+	return hard_smp_processor_id() >> index_msb;
+}
+
 /*
  * Check the APIC IDs in bios_cpu_apicid and choose the APIC mode.
  */
@@ -69,6 +74,11 @@ void __init default_setup_apic_routing(void)
 		printk(KERN_INFO "Setting APIC routing to %s\n", apic->name);
 	}
 
+	if (is_vsmp_box()) {
+		/* need to update phys_pkg_id */
+		apic->phys_pkg_id = apicid_phys_pkg_id;
+	}
+
 	/*
 	 * Now that apic routing model is selected, configure the
 	 * fault handling for intr remapping.

  parent reply	other threads:[~2009-08-26  8:16 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-24 18:26 [patch] x86: 2.6.31-rc7 crash due to buggy flat_phys_pkg_id Ravikiran G Thirumalai
2009-08-24 23:53 ` Yinghai Lu
2009-08-25  0:27   ` Yinghai Lu
2009-08-25  1:38     ` Ravikiran G Thirumalai
2009-08-25  5:03       ` Yinghai Lu
2009-08-25  1:26   ` Ravikiran G Thirumalai
2009-08-25  5:12     ` Yinghai Lu
2009-08-25 17:17       ` Ravikiran G Thirumalai
2009-08-25 18:15         ` Ingo Molnar
2009-08-25 18:31           ` Cyrill Gorcunov
2009-08-25 18:50             ` Yinghai Lu
2009-08-25 18:57               ` Linus Torvalds
2009-08-25 19:12                 ` Ingo Molnar
2009-08-25 19:17                   ` Yinghai Lu
2009-08-25 19:24                     ` Ingo Molnar
2009-08-25 20:36                       ` Ravikiran G Thirumalai
2009-08-25 20:44                         ` [PATCH] x86: fix vsmp booting with phys_pkg_id changing Yinghai Lu
2009-08-26  8:08                           ` Ingo Molnar
2009-08-26  8:15                           ` tip-bot for Yinghai Lu [this message]
2009-08-25 19:53                   ` [patch] x86: 2.6.31-rc7 crash due to buggy flat_phys_pkg_id Ravikiran G Thirumalai
2009-08-25 18:59               ` Cyrill Gorcunov
2009-08-25 19:27               ` Ravikiran G Thirumalai
2009-08-25 19:33                 ` Ingo Molnar
2009-08-25 19:36                 ` Yinghai Lu
2009-08-25 19:20             ` Ravikiran G Thirumalai
2009-08-25 19:26               ` Ingo Molnar
2009-08-25 19:40               ` Cyrill Gorcunov
2009-08-25 18:35           ` Yinghai Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-295594e9cf6ae2efd73371777aa8feba0f87f42f@git.kernel.org \
    --to=yinghai@kernel.org \
    --cc=gorcunov@gmail.com \
    --cc=hpa@zytor.com \
    --cc=kiran@scalex86.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=shai@scalex86.org \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.