From owner-freebsd-hackers Sat Oct 19 20:44:22 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C170637B6AD for ; Sat, 19 Oct 2002 20:44:16 -0700 (PDT) Received: from dsl-64-128-185-9.telocity.com (dsl-64-128-185-9.telocity.com [64.128.185.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id C586F4496E for ; Sat, 19 Oct 2002 20:25:06 -0700 (PDT) (envelope-from mjoyner2@hq.dyns.cx) Received: (from root@localhost) by dsl-64-128-185-9.telocity.com (8.12.6/8.11.5) id g9K3OCjo027134; Sat, 19 Oct 2002 23:24:12 -0400 (EDT) (envelope-from mjoyner2@hq.dyns.cx) Received: from ip-24.internal (ip-34.internal [192.168.2.34]) by hq.dyns.cx (8.12.6/8.11.5av) with ESMTP id g9K3DR5u026807; Sat, 19 Oct 2002 23:13:28 -0400 (EDT) (envelope-from mjoyner2@hq.dyns.cx) Received: from hq.dyns.cx (localhost [127.0.0.1]) by ip-24.internal (8.12.6/8.12.6) with ESMTP id g9K3Dn1f002591; Sat, 19 Oct 2002 23:14:01 -0400 (EDT) (envelope-from mjoyner2@hq.dyns.cx) Message-ID: <3DB21F6D.30504@hq.dyns.cx> Date: Sat, 19 Oct 2002 23:13:49 -0400 From: wolf User-Agent: Mozilla/5.0 (X11; U; Linux i386; en-US; rv:0.9.4.1) Gecko/20020508 Netscape6/6.2.3 X-Accept-Language: en-us MIME-Version: 1.0 To: soralx@cydem.zp.ua Cc: freebsd-hackers@freebsd.org Subject: Re: vmware2 and simd instructions References: <3DAE1642.1030208@hq.dyns.cx> <200210171933.18756.soralx@cydem.zp.ua> <3DAF6FFB.2090409@hq.dyns.cx> <200210190138.53850.soralx@cydem.zp.ua> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS perl-11 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG soralx@cydem.zp.ua wrote: >>>>is there anyway to lie to vmware2 about the processor installed? or a >>>>patch to vmmon to have it lie to the guest os about the processor >>>>installed? >>>> >>>yes >>> >>Please enlighten us. >>I would like to have more than ancient stuff running in my vmware2 >> > > I assume "to lie to vmware2 about the processor installed" means to > force vmware2 to report differents CPU features returned by its CPUID > instruction. > > I guess `vmware` reads CPU info from '/usr/compat/linux/proc/cpuinfo' > (that is, linuxprocfs) - confirmed by disassembling `vmware`. > You may 'lie' to vmware by modifying 'cpuinfo' (i.e., patch for linuxprocfs), > but that will make sense only if you want to force vmware2 not to use some > CPU feature. > You probably need to be able to execute MMX/SSE/SSE2 instructions, and vmware2 > doesn't (?) know about them: > =BEGIN======/root/.vmware/vmware-log.root=========8<= > ... > Oct 19 00:48:59: Unknown CPUID Feature 0x3c680000 > Oct 19 00:48:59: cpuFeatures == 0x701 > ... > =END========/root/.vmware/vmware-log.root=========>8= > > 0x701 means: FPU, CX8, APIC, > > My CPU Features=0x3febfbff MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,,ACC> > > As you can see, I have almost all the available features, and vmware2 > understans only 701H - no MMX/SSE/SSE2. > > Therefore, we need to disassemble the code, find the place where VMWare emulates > CPUID instruction, and, if EAX=0x01, return EDX: > > OR EDX,00001101000000000000000000000000b > > Also, we can find where (code) `vmware` stores CPU features in the 'cpuFeatures' > variable (not far from a place where it puts CPUID features to log file) > and patch it to always save our value. > > Moreover, if you want, you can also patch it for returning another > CPU ID and stepping. > > I'll try to check it after the weekend. I don't think this may work at all, > since vmware2 probably doesn't have emulation for the advanced instructions, > and may generate 'Invalid OpCode' (#UD) exception. > > So you better think how to make vmware3 working on FreeBSD (port vmmon3)... :) > > 18.10.2002; 22:59:26 > [SorAlx] http://cydem.zp.ua/ > From what I have gathered doing web seaches, the cpuid opcode is *not* trappable. :( when trying to boot a redhat 7.3 kernel I get the following messages in my vmware file: (abbreviated for brevity's sake) Oct 16 23:44:46: NOT TESTED (warning) F(127):645 Oct 16 23:44:46: NOT TESTED (warning) F(127):645 Oct 16 23:44:46: NOT TESTED (warning) F(127):645 . . . Oct 16 23:44:46: NOT TESTED (warning) F(122):1912 . . . Oct 16 23:44:47: NOT TESTED (warning) F(127):645 Oct 16 23:44:47: F(140) line=1893 0x10:0xc02660bc fault=13 . . . Seems like there should be a way to trap the fault 13 to not have the guest os panic or blue screen. I would be willing to help get the vmmon3 running if someone who can actually kernel code would let me help them. :) I currently have enough drive space free so that I can build a clean chroot/jailed environment for testing purposes. Poking around in the auto-install perl script they ship, leads me to believe we would need to write a FreeBSD install script, using theirs as a basis simply for what type of operations need doing and when. -Mike -- Michael Joyner FreeBSD System Administrator http://manhattan.hq.dyns.cx/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message