From owner-freebsd-smp Mon Dec 8 13:53:43 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id NAA17262 for smp-outgoing; Mon, 8 Dec 1997 13:53:43 -0800 (PST) (envelope-from owner-freebsd-smp) Received: from Ilsa.StevesCafe.com (Ilsa.StevesCafe.com [205.168.119.129]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id NAA17248; Mon, 8 Dec 1997 13:53:34 -0800 (PST) (envelope-from fbsd@Ilsa.StevesCafe.com) Received: from Ilsa.StevesCafe.com (localhost [127.0.0.1]) by Ilsa.StevesCafe.com (8.8.7/8.8.5) with ESMTP id OAA12205; Mon, 8 Dec 1997 14:53:21 -0700 (MST) Message-Id: <199712082153.OAA12205@Ilsa.StevesCafe.com> X-Mailer: exmh version 2.0gamma 1/27/96 From: Steve Passe To: freebsd-gnats-submit@freebsd.org cc: mgove@cais.com, smp@freebsd.org Subject: Re: kern/5244: F00F workaround dosn't always work on SMP system. In-reply-to: Your message of "Sat, 06 Dec 1997 19:50:07 PST." <199712070350.TAA11511@hub.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 08 Dec 1997 14:53:21 -0700 Sender: owner-freebsd-smp@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi, > >Number: 5244 > >Category: kern > >Synopsis: F00F workaround dosn't always work on SMP system. > > ... > >Description: > Intel F00F workaround appears to only install on the first CPU in a dual CPU configuration. > > >How-To-Repeat: > Execute the 'F00F' code, repeatedly. Sometimes it dies with Illegal instruction, sometimes the system hangs. > The basic problem is the fact that r_idt is local in UP, and global in SMP. This is because SMP:init_secondary() uses the global r_idt to sync the additional CPUs to the boot CPU: --- machdep.c: ... #ifdef SMP /* table descriptors - used to load tables by microp */ struct region_descriptor r_gdt, r_idt; #endif ... init386(first) int first; { ... #ifndef SMP /* table descriptors - used to load tables by microp */ struct region_descriptor r_gdt, r_idt; #endif --- mp_machdep.c: init_secondary(void) { ... lidt(&r_idt); lldt(_default_ldt); --- I think to trick is to rework f00f_hack() to use the global in the SMP case, AND to insure that init_secondary() runs AFTER f00f_hack(). I'm not clear on what f00f_hack() does, and do not have the available hardware to test it (ie dual P5), so I'll have to leave this to someone else to deal with... -- Steve Passe | powered by smp@csn.net | Symmetric MultiProcessor FreeBSD