From owner-freebsd-smp Tue Feb 4 12:27:34 2003 Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 417D037B401; Tue, 4 Feb 2003 12:27:32 -0800 (PST) Received: from heron.mail.pas.earthlink.net (heron.mail.pas.earthlink.net [207.217.120.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0EB3B43F75; Tue, 4 Feb 2003 12:27:26 -0800 (PST) (envelope-from tlambert2@mindspring.com) Received: from pool0327.cvx21-bradley.dialup.earthlink.net ([209.179.193.72] helo=mindspring.com) by heron.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 18g9f5-0007k2-00; Tue, 04 Feb 2003 12:27:20 -0800 Message-ID: <3E4021D4.7D1FCD43@mindspring.com> Date: Tue, 04 Feb 2003 12:25:56 -0800 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: John Baldwin Cc: freebsd-smp@freebsd.org, Chris Luke , Brendon and Wendy Subject: Re: mp_machdep.c patch References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a414520413692b38ee449afed6324b4f14548b785378294e88350badd9bab72f9c350badd9bab72f9c Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org John Baldwin wrote: > > You have to enable HT in the BIOS. If it is not enabled in the > > BIOS, it will not add entries to the MP Table for the virtual > > processors, and they will not be recognized. > > This is not correct. Some BIOS's list all virtual processors in > the mptable (in which case the HTT patch is not needed and basically > has no affect) but most only list the first core in each physical > CPU. Enabling/disabling HT in the BIOS usually only affects ACPI's > MADT table, not the MP table. The HT patch I wrote doesn't use the > BIOS at all. It _only_ uses the values in registers returned from > cpuid. I have personal experience with a machine that modifies the contents of the MP Table, based on the BIOS settings, with regard to hyperthreading. The problem with the use of the "cpuid 1" instruction to count the number of cores on a processor is that doing this does not take into account user settings in the BIOS, where hyperthreading is intentionally being disabled, for whatever reason. There is no good answer to this problem, which does not require exposing a control knob to the user, as a manual control. Most likely, it requires exposing two control knobs, since the operations are orthogonal: o ht_detect_method ACPI Use ACPI (notimp) MPTAB Use the MP Table FALLBK Try ACPI, if present; if not, then try the MPTAB. If ACPI is present, *don't* try MP Table DISABLE Do not use HT, even if present o ht_probe_level ONESHOT Use the specified detection method _only_, so that HT can be controlled by the BIOS settings CPUID Use the CPUID instruction to always find HT, if it's a supported CPU feature ...probably defaulting to FALLBK+ONESHOT, to maximize POLA, with the possibility of BIOS controls controlling the OS behaviour, as expected. One question this raises is whether or not ACPI would indicate "present, but disabled" vs. "not present". The FALLBK approach requires the former, if BIOS controls are to be maintained. This is likely BIOS implementation dependent, unfortunately: if it's even possible, some vendor likely implements their BIOS by making the entries disappear from ACPI. Obviously, this approach would require a lot of work, particularly with the ACPI support being an outstanding issue. 8-(. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message