Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Oct 2002 01:38:53 -0600
From:      <soralx@cydem.zp.ua>
To:        mjoyner2@hq.dyns.cx
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: vmware2 and simd instructions
Message-ID:  <200210190138.53850.soralx@cydem.zp.ua>
In-Reply-To: <3DAF6FFB.2090409@hq.dyns.cx>
References:  <3DAE1642.1030208@hq.dyns.cx> <200210171933.18756.soralx@cydem.zp.ua> <3DAF6FFB.2090409@hq.dyns.cx>

next in thread | previous in thread | raw e-mail | index | archive | help
>>>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, <b10 - reserved?>

My CPU Features=0x3febfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,
MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,<b28>,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/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210190138.53850.soralx>