[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: on virtuality (was Re: VMWare)



Udi Finkelstein wrote:

> What's new here is that VMware is the first program not only to make a simple
                                        ^^^^^
> sandbox for user programs (like any protected mode O/S does - Linux and NT
> both do this), but instead it's "sandbox" is actually emulating all the
> protection violations as if the sandbox is the entire machine, and not one
> task in many.

Not the first. The second. Locus (now owned by Platinum, the same
company which also "ate" Memco) was the first, with its revolutionary
version 4.0 (currently 4.1.1) of "Merge". Unfortunately, they didn't
make it available for Linux, but only for some other x86-based
UNIXes. It must be admitted, though, that VMware is much more
superior and ambitious than Merge. IMHO, it is the most revolutionary
product I've ever seen.

> Why wasn't this done before? My guess is that since it's a known fact that the
> X86 is not truely virtualizable, no one bothered even trying.

The first one to develop the theories about self-virtualizibility,
was Prof. Popek. But Prof. Popek is also the head of Locus, so you
can say that he was the first one to "contradict" himself...

> By using the term fully virtualizable I mean that the CPU has the ability to
> trap and emulate in user mode any operation that might hint the user mode
> software that it's running in user mode! For example, if the register
> containing the user/supervisor mode bit is reabable in user mode, than a guest
> O/S could determie it's not running in supervisor mode, and refuse to run! On
> a true VM architecture, reading this register would be trapped, and an
> "emulated" value would be returned by the host O/S to the guest VM.
> 
> The X86 is known to be NOT fully virtualizable. Since I don't know the
> intricate details of the x86 protected more architecture (as much as I would
> really like), I can't tell you where the holes are, but they DO exist. An
> example of a CPU family where this hole did not exist is the 68K line by
> motorola (actually only the 68010 and up. In fact, almost all the difference
> between the 68000 and the 68010 was this virtuality thing).
> 
> As a simple proof, you can see that some O/S *DO NOT* run under VMware yet,
> and eve more, you CAN'T run VMware under itself. If the x86 was truly
> virtualizable, and VMware was written correctly, you could run a copy of
> VMware under VMware itself!

But even in this point, Merge is inferior: It can run only guest
OSes which the developers of Merge prepared special tables for them.
These tables contain names of files (e.g. kernel32.dll), offsets in
these files, and byte values to insert into these offsets. This is
the method used by Merge to overcome the difficulties you mentioned.
Contrary to VMware, Merge runs the guest OS at ring-0 (privileged),
but replaces all the sensitive instructions in the sensitive files
by illegal instructions. These illegal instructions activate the
monitor of Merge, which inspects the context, and decide what should
be done. On the other hand, VMware uses a more advanced method, which
allows it to run almost any OS out of the box. It runs the guest OS
at ring-3 (user-level!), catches the traps (caused by privileged
instructions), does the required things, but also marks the page, so
the next time, instead of a trap (which is very slow), a special
care is taken with the sensitive code.

Because of this reason, most of the OSes, including Linux/*BSD*/NT/
Win98/etc., could not run under Merge. Even localized versions of
Win95 couldn't run, and before VMware had their first demo (at the
beginning of 1999), I was busy trying to build a table for the Hebrew
Enabled Win95 (with sources of neither Merge nor Win95). Fortunately,
VMware came with their more reasonable solution.

> The moment an x86 vendor would offer a variant which is fully virtualizable
> (and we'll have VMware-like software to take advantage of this mode), I would
> be the first in line to buy it.

Transmeta?

-- 
Eli Marmor