All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ravikiran G Thirumalai <kiran@scalex86.org>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
	shai@scalex86.org
Subject: Re: [patch] x86: 2.6.31-rc7 crash due to buggy flat_phys_pkg_id
Date: Mon, 24 Aug 2009 18:26:32 -0700	[thread overview]
Message-ID: <20090825012632.GB6842@localdomain> (raw)
In-Reply-To: <4A932809.1000103@kernel.org>

On Mon, Aug 24, 2009 at 04:53:45PM -0700, Yinghai Lu wrote:
>Ravikiran G Thirumalai wrote:
>> 
>> Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
>> Cc: Yinghai Lu <yinghai@kernel.org>
>> 
>> Index: linux-2.6.31-rc6/arch/x86/kernel/apic/apic_flat_64.c
>> ===================================================================
>> --- linux-2.6.31-rc6.orig/arch/x86/kernel/apic/apic_flat_64.c	2009-08-21 12:42:16.000000000 -0700
>> +++ linux-2.6.31-rc6/arch/x86/kernel/apic/apic_flat_64.c	2009-08-21 14:12:21.654837472 -0700
>> @@ -161,7 +161,8 @@ static int flat_apic_id_registered(void)
>>  
>>  static int flat_phys_pkg_id(int initial_apic_id, int index_msb)
>>  {
>> -	return initial_apic_id >> index_msb;
>> +	return cpu_has_apic ? hard_smp_processor_id() >> index_msb :
>> +	    initial_apic_id >> index_msb;
>>  }
>
>it seems we should use initial apic id here.
>

Why?  The specs seem to indicate otherwise unless I am mistaken --
Intel  systems programming guide, Vol 3A Part1, chapter 7 section
7.5.5 - Identifying Logical Processors in a MP system:
<quote>
After the BIOS has completed the MP initialization protocol, each logical
processor can be uniquely identified by its local APIC ID. Software can
access these APIC IDs in either of the following ways
</quote>
phys_pkg_id() indicates that the logical package id is being looked up,
so local apic id should be used here no?
What am I missing?


>can you check which calling for vsmp cause the problem?
>arch/x86/kernel/cpu/addon_cpuid_features.c:     c->cpu_core_id = apic->phys_pkg_id(c->initial_apicid, ht_mask_width)
>arch/x86/kernel/cpu/addon_cpuid_features.c:     c->phys_proc_id = apic->phys_pkg_id(c->initial_apicid, core_plus_mask_width
>);
>arch/x86/kernel/cpu/addon_cpuid_features.c:     c->apicid = apic->phys_pkg_id(c->initial_apicid, 0);

The above are definitely problematic.  Anyplace that uses phys_pkg_id to get
the unique pkg id of a logical processor will have problems.

  parent reply	other threads:[~2009-08-25  1:26 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 [this message]
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:x86/urgent] x86: Fix vSMP boot crash tip-bot for Yinghai Lu
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=20090825012632.GB6842@localdomain \
    --to=kiran@scalex86.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=shai@scalex86.org \
    --cc=torvalds@linux-foundation.org \
    --cc=yinghai@kernel.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.