From owner-cvs-all Thu Nov 7 5:55:27 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5B10F37B401 for ; Thu, 7 Nov 2002 05:55:26 -0800 (PST) Received: from mail.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F4C443E8A for ; Thu, 7 Nov 2002 05:55:25 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 28331 invoked from network); 7 Nov 2002 13:55:26 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 7 Nov 2002 13:55:26 -0000 Received: from laptop.baldwin.cx (laptop.baldwin.cx [192.168.0.4]) by server.baldwin.cx (8.12.6/8.12.6) with ESMTP id gA7DtNn5055982; Thu, 7 Nov 2002 08:55:23 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200211070134.gA71YNn0045906@repoman.freebsd.org> Date: Thu, 07 Nov 2002 08:55:25 -0500 (EST) From: John Baldwin To: David Xu Subject: RE: cvs commit: src/sys/i386/i386 exception.s genassym.c trap.c Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 07-Nov-2002 David Xu wrote: > davidxu 2002/11/06 17:34:23 PST > > Modified files: > sys/i386/i386 exception.s genassym.c trap.c vm86.c > vm86bios.s > sys/i386/include pcb.h vm86.h > Log: > 1.Fix smp race between kernel vm86 BIOS calling and userland vm86 mode code, > remove global variable in_vm86call, set vm86 calling flag in PCB flags. > > 2.Fix vm86 BIOS calling preempted problem by changing vm86_lock mutex type > from MTX_DEF to MTX_SPIN. vm86pcb is not remembered in thread struct, > when the thread calling vm86 BIOS is preempted by interrupt thread, > and later switching back to the thread would cause incorrect context be > loaded into CPU registers, this leads to kernel crash. You could have left the mutex as MTX_DEF and just added a critical section (critical_enter/exit) around the actual BIOS call. This would be preferred. Especially since you broke witness by not adding the vm86 mutex to the spin lock list. Which also means you didn't test this with WITNESS which is highly recommended when changing locks. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message