From owner-freebsd-emulation@FreeBSD.ORG Mon Mar 3 18:44:51 2008 Return-Path: Delivered-To: freebsd-emulation@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 891FD1065679 for ; Mon, 3 Mar 2008 18:44:51 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 4EF128FC2A for ; Mon, 3 Mar 2008 18:44:51 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 2049C675EAA; Mon, 3 Mar 2008 19:44:50 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QDK2xDwzPnBa; Mon, 3 Mar 2008 19:44:37 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 35143675EA5; Mon, 3 Mar 2008 19:44:37 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.13.8/8.13.8/Submit) id m23IiZnj073633; Mon, 3 Mar 2008 19:44:35 +0100 (CET) (envelope-from rdivacky) Date: Mon, 3 Mar 2008 19:44:35 +0100 From: Roman Divacky To: fchang@cs.ubc.ca Message-ID: <20080303184435.GA73429@freebsd.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-emulation@FreeBSD.org Subject: Re: patch for /usr/ports/emulators/vmware3 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2008 18:44:51 -0000 On Mon, Mar 03, 2008 at 09:16:20AM -0800, fchang@cs.ubc.ca wrote: > Hi all: > > I finally got /usr/ports/emulator/vmware3 working on FreeBSD 7.0 i386. > There were 3 changes needed: > > 1) The avail_end kernel variable no longer exists; I googled and was > able to use Kip Macy's suggested replacement code > http://lists.freebsd.org/pipermail/freebsd-current/2007-January/068377.html > > 2) One of the assembly routine cannot compile, but fortunately that > routine is unused, so I just commented it out using an "#if 0" block > > 3) One file uses the old FILEDESC_LOCK and FILEDESC_UNLOCK. > Based on suggestion I found on mailing lists, I believe it is > equivalent to the new FILEDESC_SLOCK and FILEDESC_SUNLOCK. > > With the 3 changes, I was able to run vmware3 and boot up Windows XP in it. > It appears stable on my machine. > > Here is the patch: > > > --- work/vmware-distrib/vmmon-only/freebsd/driver.c.old 2008-03-03 > 17:03:25.000000000 +0000 > +++ work/vmware-distrib/vmmon-only/freebsd/driver.c 2008-03-03 > 17:04:13.000000000 +0000 > @@ -397,12 +397,12 @@ > if ((error = falloc(td, &fp, &fd)) != 0) > return error; > > - FILEDESC_LOCK(p->p_fd); > + FILEDESC_SLOCK(p->p_fd); > fp->f_data = data; > fp->f_flag = flags & FMASK; > fp->f_ops = &vmmon_fileops; > fp->f_type = DTYPE_SOCKET; > - FILEDESC_UNLOCK(p->p_fd); > + FILEDESC_SUNLOCK(p->p_fd); I dont think this is correct. you are modifying the filedescriptor while holding "shared lock". unless I am wrong it should be changed to FILEDESC_XLOCK/XUNLOCK thnx for your work! roman