From: Gerald Britton <gbritton@alum.mit.edu>
To: Alan Cox <alan@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: HyperThreading in recent 2.4-ac kernels
Date: Wed, 11 Dec 2002 18:30:59 -0500 [thread overview]
Message-ID: <20021211183059.A19030@light-brigade.mit.edu> (raw)
In-Reply-To: <200212112043.gBBKhLE28272@devserv.devel.redhat.com>; from alan@redhat.com on Wed, Dec 11, 2002 at 03:43:21PM -0500
HyperThreading appears to work properly in vanilla 2.4.x, but fails to
initialize the sibling CPUs in 2.4.x-ac. The problem appears to be in
improper indexing by physical vs. logical CPU numbers.
in smpboot.c (in smp_boot_cpus):
Dprintk("CPU present map: %lx\n", phys_cpu_present_map);
cpu = 1;
for (bit = 0; bit < NR_CPUS; bit++) {
...
phys_apicid = raw_phys_apicid[bit];
...
if ((cpu_to_physical_apicid(bit) == BAD_APICID) &&
...
in mpparse.c (in MP_processor_info):
raw_phys_apicid[num_processors - 1] = m->mpc_apicid;
Booting with HT and some debugging enabled yields:
...
LAPIC (acpi_id[0x0000] id[0x0] enabled[1])
CPU 0 (0x0000) enabledProcessor #0 Pentium 4(tm) XEON(tm) APIC version 16
LAPIC (acpi_id[0x0001] id[0x6] enabled[1])
CPU 1 (0x0600) enabledProcessor #6 Pentium 4(tm) XEON(tm) APIC version 16
LAPIC (acpi_id[0x0002] id[0x1] enabled[1])
CPU 2 (0x0100) enabledProcessor #1 Pentium 4(tm) XEON(tm) APIC version 16
LAPIC (acpi_id[0x0003] id[0x7] enabled[1])
CPU 3 (0x0700) enabledProcessor #7 Pentium 4(tm) XEON(tm) APIC version 16
...
CPU present map: c3
...
The processors appear to have physical IDs 0, 1, 6, 7. raw_phys_apicid[] gets
filled at indexes 0-4, but when the kernel tries to boot the CPUs, it queries
it with physical indexes 0, 1, 6, 7 and loses. I'm not sure exactly what the
correct way to fix this is. (a quick hack to raw_phys_apicid does get all 4
CPUs up and apparently working though)
There appear to be other areas where holes in the physical IDs will cause
problems (things fill indexes by a logical cpu number and index later by
physical ID, or the other way around).
Example: following booting a cpu, the check to see if it booted checks
cpu_to_physical_apicid(bit) where bit is the physical cpu id in the map, but
the table it's checking is indexed by logical cpu number.
-- Gerald
next prev parent reply other threads:[~2002-12-11 23:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-11 20:43 Linux 2.4.20-ac2 Alan Cox
2002-12-11 23:30 ` Gerald Britton [this message]
2002-12-12 1:36 ` HyperThreading in recent 2.4-ac kernels Alan Cox
2002-12-12 20:12 ` detecting layout in RAID Anu
2002-12-17 22:55 ` Neil Brown
2003-11-18 21:01 ` error in Sparc64 rwlock.S leif
2003-11-18 21:09 ` Andrew Morton
2003-11-19 0:46 ` David S. Miller
2003-11-19 21:37 ` leif
2003-11-19 22:30 ` Andrew Morton
2003-11-20 0:03 ` leif
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=20021211183059.A19030@light-brigade.mit.edu \
--to=gbritton@alum.mit.edu \
--cc=alan@redhat.com \
--cc=linux-kernel@vger.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.