linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: YhLu <YhLu@tyan.com>
To: YhLu <YhLu@tyan.com>, Andi Kleen <ak@muc.de>
Cc: Matt Domsch <Matt_Domsch@dell.com>,
	linux-kernel@vger.kernel.org, discuss@x86-64.org,
	jamesclv@us.ibm.com, suresh.b.siddha@intel.com
Subject: RE: 256 apic id for amd64
Date: Fri, 7 Jan 2005 10:27:05 -0800	[thread overview]
Message-ID: <3174569B9743D511922F00A0C943142307291311@TYANWEB> (raw)

Also in arch/x86_64/kernel/setup.c  init_amd


        if (c->cpuid_level >= 0x80000008) {

---->

        n = cpuid_eax(0x80000000);

        if (n >= 0x80000008) {

for c->cupid_level is get cupid_eax(0) and it always =1

YH

-----Original Message-----
From: YhLu 
Sent: Friday, January 07, 2005 10:08 AM
To: 'Andi Kleen'
Cc: Matt Domsch; linux-kernel@vger.kernel.org; discuss@x86-64.org;
jamesclv@us.ibm.com; suresh.b.siddha@intel.com
Subject: RE: 256 apic id for amd64

Hard_smp_processor_id is CPU physical apicid.
Boot_cpu_id is boot_cpu_physical_apicid.

There is two configuration that we need to enable APIC_EXT_ID.
1. 8 way + dual core --- 8*2 + 2 +1 = 19, the cpu will use 0-15, and ioapic
need to use 16 above.
2. 4 way + 7 amd 8131 + 1 8111 --- 4+7*2+1=19

After enabling APIC_EXT_ID, the K8 can use 256 apicid. But the io apic
device (amd 8131 and 8111) still need to use 0-15. So We need to use 16
above for cpu apic id.

The BIOS or LinuxBIOS will set the apic id of CPU to 16 later. Or that's to
say
Apicid = initial apic id + apicid_offset.

When dual core is used and nb_cfg_54 is set, node 0 will use initial apicid
0/1 for core0 and core1. after setting apicid_offset. Apicid will be 16/17.

Without subtract boot_cpu_id, phys_pkg_id will return 8.
With that, It will return 0.

The c->x86_apicid is initial apic id and it is by cupid(0x1).

I guess for one core old cpu
nb_cfg_54 can not be set, and node 0 will use initial apidid 0. After
setting apicid_offset. Apicid will be 16.

Without subtract boot_cpu_id, phys_pkg_id will return 16.
With that, It will return 0.

YH

-----Original Message-----
From: Andi Kleen [mailto:ak@muc.de] 
Sent: Friday, January 07, 2005 4:25 AM
To: YhLu
Cc: Matt Domsch; linux-kernel@vger.kernel.org; discuss@x86-64.org;
jamesclv@us.ibm.com; suresh.b.siddha@intel.com
Subject: Re: 256 apic id for amd64

On Thu, Jan 06, 2005 at 06:53:11PM -0800, YhLu wrote:
> static unsigned int phys_pkg_id(int index_msb)
> {
>         return hard_smp_processor_id() >> index_msb;
> }
> 
> In arch/x86_64/kernel/genapic_cluster.c
> 
> Should be changed to 
> 
> static unsigned int phys_pkg_id(int index_msb)
> {
>         /* physical apicid, so we need to substract offset */
>         return (hard_smp_processor_id() - boot_cpu_id) >> index_msb;
> }

Why? 

If you want a patch merged you need to supply some more explanation
please.

Also cc Suresh & James for comment.

-Andi

             reply	other threads:[~2005-01-07 18:18 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-07 18:27 YhLu [this message]
2005-01-07 19:29 ` 256 apic id for amd64 Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2005-01-11 19:11 YhLu
2005-01-11 19:04 YhLu
2005-01-10 20:48 YhLu
2005-01-10 20:46 YhLu
2005-01-11  5:36 ` Andi Kleen
2005-01-10 20:37 YhLu
2005-01-10 20:09 YhLu
2005-01-10 20:18 ` Andi Kleen
2005-01-10 19:41 YhLu
2005-01-10 19:43 ` Andi Kleen
2005-01-11  0:42 ` James Cleverdon
2005-01-11  3:28   ` Siddha, Suresh B
2005-01-11  4:42     ` Andi Kleen
2005-01-10 18:48 YhLu
2005-01-10 18:45 ` Andi Kleen
2005-01-10 18:44 Andi Kleen
2005-01-11  4:04 ` Siddha, Suresh B
2005-01-11  4:39   ` Andi Kleen
2005-01-11 17:50   ` Andi Kleen
2005-01-08  2:53 YhLu
2005-01-09 23:56 ` James Cleverdon
2005-01-08  2:37 Mikael Pettersson
2005-01-08 15:46 ` Andi Kleen
2005-01-08  1:50 YhLu
2005-01-08  0:50 YhLu
2005-01-08  0:42 ` Andi Kleen
2005-01-08  0:28 YhLu
2005-01-08  0:26 ` James Cleverdon
2005-01-08  0:34   ` Andi Kleen
2005-01-08  0:04 YhLu
2005-01-08  0:12 ` James Cleverdon
2005-01-07 21:44 YhLu
2005-01-07 22:18 ` Andi Kleen
2005-01-07 21:14 YhLu
2005-01-07 21:12 ` Andi Kleen
2005-01-07 19:43 YhLu
2005-01-07 19:40 ` Andi Kleen
2005-01-07 18:19 YhLu
2005-01-07 19:29 ` Andi Kleen
2005-01-07  2:53 YhLu
2005-01-07 12:24 ` Andi Kleen
2005-01-08  1:30   ` James Cleverdon
2005-01-07  1:06 YhLu
2005-01-07 12:44 ` Andi Kleen
2004-12-30 23:19 YhLu
2004-12-30 23:16 YhLu
2004-12-29  4:43 YhLu
2004-12-30 18:45 ` Andi Kleen
2004-12-30 22:56   ` Matt Domsch
2004-12-30 23:26     ` Andi Kleen

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=3174569B9743D511922F00A0C943142307291311@TYANWEB \
    --to=yhlu@tyan.com \
    --cc=Matt_Domsch@dell.com \
    --cc=ak@muc.de \
    --cc=discuss@x86-64.org \
    --cc=jamesclv@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suresh.b.siddha@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).