All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Cleverdon <jamesclv@us.ibm.com>
To: linux-kernel@vger.kernel.org, Andi Kleen <ak@suse.de>
Cc: "Martin J. Bligh" <mbligh@aracnet.com>
Subject: [PATCH][2.6.8.1-mm4]  phys_proc_id change for x86-64
Date: Wed, 8 Sep 2004 17:23:16 -0700	[thread overview]
Message-ID: <200409081723.16929.jamesclv@us.ibm.com> (raw)
In-Reply-To: <200409081647.46980.jamesclv@us.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 1644 bytes --]

The value that cpuinfo returns for command 1 in ebx is the
physical APIC ID latched when the system comes out of reset.

Ordinarily, this is identical to the value in the local APIC's ID
register, because nearly all BIOSes accept the HW assigned value.

Our systems, made up of individual building blocks, can't do
that.  Each node boots as a separate system and is joined
together by the BIOS.  Thus, the BIOS rewrites the local APIC ID
register with a new value.

Potomac and Nocona chips have a mechanism by which the BIOS
writer can change bits 7:5 to match the assigned cluster ID. 
Bits 2:0 come from the thread ID.  However, bits 4:3 are still
those latched at reset.  Oops!

Summary:  Large clustered systems can't use cpuid to derive the
sibling information.

Fix:  Use the local APIC ID.  That's the value we use to online
the CPUs, so it had better be OK.  For non-clustered systems,
cpuid == local APIC, so nothing but large boxes should be
affected.






diff -pruN 2.6.8.1-mm4/arch/x86_64/kernel/setup.c w8.1m4/arch/x86_64/kernel/setup.c
--- 2.6.8.1-mm4/arch/x86_64/kernel/setup.c	2004-08-25 14:48:21.000000000 -0700
+++ w8.1m4/arch/x86_64/kernel/setup.c	2004-09-02 15:51:55.000000000 -0700
@@ -724,7 +724,7 @@ static void __init detect_ht(struct cpui
 		}
 		if (index_lsb != index_msb )
 			index_msb++;
-		initial_apic_id = ebx >> 24 & 0xff;
+		initial_apic_id = hard_smp_processor_id();
 		phys_proc_id[cpu] = initial_apic_id >> index_msb;
 		
 		printk(KERN_INFO  "CPU: Physical Processor ID: %d\n",


-- 
James Cleverdon
IBM LTC (xSeries Linux Solutions)
{jamesclv(Unix, preferred), cleverdj(Notes)} at us dot ibm dot comm

[-- Attachment #2: cpu_sibling_map_2004-08-31_2.6.8.1-mm4 --]
[-- Type: text/x-diff, Size: 551 bytes --]

diff -pruN 2.6.8.1-mm4/arch/x86_64/kernel/setup.c w8.1m4/arch/x86_64/kernel/setup.c
--- 2.6.8.1-mm4/arch/x86_64/kernel/setup.c	2004-08-25 14:48:21.000000000 -0700
+++ w8.1m4/arch/x86_64/kernel/setup.c	2004-09-02 15:51:55.000000000 -0700
@@ -724,7 +724,7 @@ static void __init detect_ht(struct cpui
 		}
 		if (index_lsb != index_msb )
 			index_msb++;
-		initial_apic_id = ebx >> 24 & 0xff;
+		initial_apic_id = hard_smp_processor_id();
 		phys_proc_id[cpu] = initial_apic_id >> index_msb;
 		
 		printk(KERN_INFO  "CPU: Physical Processor ID: %d\n",

      reply	other threads:[~2004-09-09  0:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-08 23:47 [PATCH][2.6.8.1-mm4] Clustered APIC support for x86-64 James Cleverdon
2004-09-09  0:23 ` James Cleverdon [this message]

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=200409081723.16929.jamesclv@us.ibm.com \
    --to=jamesclv@us.ibm.com \
    --cc=ak@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@aracnet.com \
    /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.