mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	suresh.b.siddha@intel.com, Ingo Molnar <mingo@elte.hu>,
	lkml <linux-kernel@vger.kernel.org>,
	stable@kernel.org
Subject: Re: [PATCH] Make Intel 8-way Xeons boot again
Date: Sat, 9 Jan 2010 14:51:26 -0800	[thread overview]
Message-ID: <86802c441001091451t1edcfd26m9368628b6cc4f711@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1001091007150.7821@localhost.localdomain>

On Sat, Jan 9, 2010 at 10:11 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
>
> On Sat, 9 Jan 2010, Ananth N Mavinakayanahalli wrote:
>>
>> On an 8-way system with Intel Xeon X7350 CPUs, booting 2.6.32 or newer
>> kernels fails at:
>>
>> ...
>> CPU0: Intel(R) Xeon(R) CPU           X7350  @ 2.93GHz stepping 0b
>> Booting Node   0, Processors  #1 #2 #3 #4 #5 #6 #7 Ok.
>> Brought up 8 CPUs
>> Total of 8 processors activated (46906.05 BogoMIPS).
>>
>> Git bisect showed 2fbd07a5f as the offending commit.
>
> Ok, that commit definitely is buggy.
>
>> With the patch below, I am able to boot the latest Linus' git tree on
>> the machine. If this patch is correct, it needs to get into the stable
>> tree too.
>
> I don't think the patch is correct, though. The thing is, the AMD check
> seems to be the correct one: you can only use 'apic_flat' if all the APIC
> ID's are < 8.
>
> It doesn't matter _how_ many CPU's you have. If you have two CPU's, but
> one of them has an APIC ID >= 8, then you cannot use the flat APIC model,
> since it depends on a 8-bit bitfield.
>
> So your patch doesn't seem right either, because it still tests
> num_processors, which is bogus.
>
> In fact, I can't for the life of me understand why it treats different
> vendors differently. Why is that code not just a simple
>
>        /* Flat apic mode requires that all APIC ID's are in the range 0..7 */
>        if (apic == &apic_flat && max_physical_apicid >= 8)
>                apic = &apic_physflat;
>
> instead, with no crazy vendor tests.
>
> What am I missing?

according to Suresh, intel CPUs could use logical flat mode when total
num_cpus <=8 even some cpu's physical apicid > 0.

and init_apic_ldr should set ldr to the cpu to map cpu index to the cpu.

static void flat_init_apic_ldr(void)
{
        unsigned long val;
        unsigned long num, id;

        num = smp_processor_id();
        id = 1UL << num;
        apic_write(APIC_DFR, APIC_DFR_FLAT);
        val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
        val |= SET_APIC_LOGICAL_ID(id);
        apic_write(APIC_LDR, val);
}

in Ananth's case, APs are started, so LDR should be set correctly.

YH

  reply	other threads:[~2010-01-09 22:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-09 10:10 Ananth N Mavinakayanahalli
2010-01-09 18:11 ` Linus Torvalds
2010-01-09 22:51   ` Yinghai Lu [this message]
2010-01-11 17:38   ` Suresh Siddha
2010-01-09 21:13 ` Yinghai Lu
2010-01-10  2:30   ` Ananth N Mavinakayanahalli
2010-01-10  6:35     ` Yinghai Lu
2010-01-10 10:26       ` Ingo Molnar
2010-01-11  4:53         ` [PATCH] Revert 2fbd07a5f so machines with BSPs phsyical apic id != 0 can boot Ananth N Mavinakayanahalli
2010-01-11 21:39           ` Suresh Siddha
2010-01-11 22:55             ` Linus Torvalds
2010-01-11 23:45               ` Suresh Siddha
2010-01-11 23:51                 ` Suresh Siddha
2010-01-12  0:46                 ` Linus Torvalds
2010-01-12  0:50                   ` Linus Torvalds
2010-01-12  2:27                   ` Suresh Siddha
2010-01-14  0:03           ` Yuhong Bao
2010-01-11 21:43         ` [PATCH] Make Intel 8-way Xeons boot again Yinghai Lu
2010-01-11 21:53           ` Suresh Siddha
2010-01-12 19:10             ` Yinghai Lu
2010-01-12 20:20               ` Suresh Siddha
2010-01-12 21:02                 ` H. Peter Anvin
2010-01-12 21:07                   ` Suresh Siddha
2010-01-12 22:46     ` Suresh Siddha
2010-01-13  4:42       ` Ananth N Mavinakayanahalli

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=86802c441001091451t1edcfd26m9368628b6cc4f711@mail.gmail.com \
    --to=yinghai@kernel.org \
    --cc=ananth@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=stable@kernel.org \
    --cc=suresh.b.siddha@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®