public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Wilck <martin.wilck@fujitsu-siemens.com>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: linux-kernel@vger.kernel.org, Andi Kleen <ak@suse.de>,
	"Wichert, Gerhard" <Gerhard.Wichert@fujitsu-siemens.com>
Subject: Re: APIC version and 8-bit APIC IDs
Date: Wed, 31 Aug 2005 16:50:13 +0200	[thread overview]
Message-ID: <4315C3A5.7080200@fujitsu-siemens.com> (raw)
In-Reply-To: <Pine.LNX.4.61L.0508311450020.10940@blysk.ds.pg.gda.pl>

[ Putting everyone cc again and leaving maciej's reply intact for 
reference ]

Maciej W. Rozycki wrote:

>>The ID is 0x14 for Intel. But that is wrong for AMD CPUs. The actual Dual-Core
> 
> 
>  Why can't hw designers ever get such things right?  Sigh...
> 
> 
>>Athlon CPUs we have report an APIC version of 0x10. Please refer to the start
>>of this thread.
> 
> 
>  Frankly, such a change implies a change to the inter-APIC communication 
> protocol, so the major revision should have been bumped, like it happened 
> for the I/O APIC (0x20); I hope they do not worry of changing the design 
> so many times they run out of numbers!  Thus none of the implementers has 
> done their job properly, but for Intel there is at least some change, 
> while for AMD there seems no generic way of determining that -- 0x10 
> implies a "traditional" integrated APIC as implemented in Pentium in 1995, 
> using a three-wire serial bus for communication...
> 
>  Perhaps a variable should be added holding the "architectural revision" 
> of the APIC subsystem, set up by the early CPU/APIC initialization code 
> and used from there on instead of direct references to the version 
> register as implemented in the hardware.  It does not have to be based on 
> what hardware uses, e.g.:
> 
> - 0: no APIC,
> 
> - 1: 82489DX -- communication using a five-wire inter-APIC bus, 8-bit 
>      physical ID, 32-bit logical ID, etc.,
> 
> - 2: Pentium-style -- communication using a three-wire inter-APIC bus, 
>      4-bit physical ID, 8-bit logical ID, etc.,
> 
> - 3: P4-style -- communication using the system bus, 8-bit physical ID, 
>      8-bit logical ID, etc.

AMD has their HyperTransport bus, which is yet a different thing.

According to what AMD told us, all K8 CPUs support 8-bit APIC IDs 
("extended APIC IDs" in their speak), but they are only enabled
"when both ApicExtId and ApicExtBrdCst in the HyperTransport Transaction 
Control Register are set".

As we cannot read PCI config space at APIC configuration time, my 
suggestion would be something like

unsigned char phys_apic_id_mask(int apic_version)
         if (apic_version < 0x10 || apic_version >= 0x14 ||
		(boot_cpu_data.vendor == X86_VENDOR_AMD &&
          	 boot_cpu_data.family >= 0x0f))
		return 0xff;
	else
		return 0x0f;
}

That would assume that no BIOS is so stupid to set APIC IDs >0xf and at 
the same time forget to enable the respective bits in the HyperTransport 
Transaction Control Register.

I do not oversee whether boot_cpu_data is initialized when the APIC IDs 
need to be tested/masked, but somebody else certainly does.

> 
> 
>>Anyway, I understand that you agree this does not belong into the subarch
>>code?
> 
> 
>  That's CPU/chipset specific indeed.  It shouldn't really depend on the 
> platform these are used in.  Exceptions, if any, can be handled on a case 
> by case basis.
> 
>   Maciej

Regards
Martin

-- 
Martin Wilck                Phone: +49 5251 8 15113
Fujitsu Siemens Computers   Fax:   +49 5251 8 20409
Heinz-Nixdorf-Ring 1        mailto:Martin.Wilck@Fujitsu-Siemens.com
D-33106 Paderborn           http://www.fujitsu-siemens.com/primergy

  parent reply	other threads:[~2005-08-31 14:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <42FC8461.2040102@fujitsu-siemens.com.suse.lists.linux.kernel>
2005-08-12 11:43 ` APIC version and 8-bit APIC IDs Andi Kleen
2005-08-12 13:21   ` Martin Wilck
2005-08-12 13:32     ` Andi Kleen
2005-08-12 13:51       ` Martin Wilck
2005-08-12 14:55         ` Martin Wilck
2005-08-12 14:57           ` Andi Kleen
2005-08-12 16:37             ` yhlu
2005-08-12 16:42               ` Andi Kleen
2005-08-12 17:44                 ` yhlu
2005-08-22  9:50                   ` Martin Wilck
2005-08-23 11:10                     ` Maciej W. Rozycki
2005-08-26 14:01                       ` Martin Wilck
2005-08-26 14:50                         ` Maciej W. Rozycki
2005-08-29  7:25                           ` Martin Wilck
2005-08-12 18:19             ` Siddha, Suresh B
2005-08-12 18:22               ` Andi Kleen
2005-08-12 18:40                 ` Siddha, Suresh B
2005-08-12 18:50                   ` Andi Kleen
2005-08-31 13:13   ` Martin Wilck
2005-08-31 13:25     ` Maciej W. Rozycki
2005-08-31 14:27       ` Martin Wilck
     [not found]       ` <4315B2D9.6080700@fujitsu-siemens.com>
     [not found]         ` <Pine.LNX.4.61L.0508311450020.10940@blysk.ds.pg.gda.pl>
2005-08-31 14:50           ` Martin Wilck [this message]
2005-08-31 14:40     ` Andi Kleen
2005-08-12 11:13 Martin Wilck

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=4315C3A5.7080200@fujitsu-siemens.com \
    --to=martin.wilck@fujitsu-siemens.com \
    --cc=Gerhard.Wichert@fujitsu-siemens.com \
    --cc=ak@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@linux-mips.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