3 ms·
This dichotomy of hardware assisted vs emulation is too simplistic though. > Sometimes you need to emulate the entire CPU. Other times the guest and host CPUs
by epcoa 3y ago
This dichotomy of hardware assisted vs emulation is too simplistic though.
> Sometimes you need to emulate the entire CPU. Other times the guest and host CPUs are the same and that CPU supports hardware assisted virtualisation.
You don't need dedicated hardware assistance to do some amount of virtualization if you have an MMU and memory protection. This is how early VMware on x86 worked, it was not a full blown emulator, it did not need to emulate the entire CPU. Most guest code ran unaltered without emulation, only certain ring 0 code had to be emulated.
VMware ESX and workstation ran usably well back in the x86 days, I mean it was a viable product. It was not just an "emulator", in contrast to something like BOCHS or early qemu.
https://en.wikipedia.org/wiki/X86_virtualization https://en.wikipedia.org/wiki/X86_virtualization
https://www.vmware.com/pdf/asplos235_adams.pdf https://www.vmware.com/pdf/asplos235_adams.pdf
I don't think an accurate categorization really. Emulation is a technique that may be used in parts of the implementation for virtualization, but they're different concepts, one is not a subset of the other.
> All emulators are a virtual machine
No, I can emulate a single piece of hardware like a network adapter. I can emulate just a CPU core indepedent of a particular virtual environment.
- hnlmorg 3y ago> This is how early VMware on x86 worked, it was not a full blown emulator, it did not need to emulate the entire CPU. Of course it didn't. But it did (and parts of it still does) emulate hardware. Which is my point. > This dichotomy of hardware assisted vs emulation is too simplistic though. Is it though? Or is this need to define different aspects of virtualisation as entirely different fields effectively being too simplistic? I'm acknowledging that there is shared heritage and commonality between principles -- even to the extent that some directly borrow from the other. You say "dichotomy" to refer to my comments yet you're the one trying to divide a complex field into small pigeonholes without acknowledging that they're intermingled. This is what PR people do to sell products to customers, not engineers like us. > VMware ESX and workstation ran usably well back in the x86 days Workstation predates ESX by a few years and the 1.x versions of Workstation really didn't run well _at all_. I used it personally, it was a bloody cool tech demo and even back then I could see the potential, but it was far too slow to use for anything serious. Particularly when UNIX and BSDs were still in vogue (albeit barely) and they had excellent support for application sandboxing via containerisation. > I don't think an accurate categorization really. Emulation is a technique that may be used in parts of the implementation for virtualization, So you agree with the technical description but not the categorisation? > but they're different concepts, one is not a subset of the other. That's like saying DocumentDB and Postgres aren't both databases because one is SQL and the other is not. The concepts between emulation and virtualisation are similar enough that I'd argue that one is a subset of another. What you're discussing is the implementation detail of one form of virtualisation -- baring in mind that there are other ways to run a virtual machine which we also haven't covered here. You've even agreed yourself that a VM requires parts of the full machine to be emulated for it to work. So the only reason people don't (still) refer to emulation as a subset of virtualisation is marketing. > It was not just an "emulator", in contrast to something like BOCHS or early qemu. I really don't get what you're trying to say with "early qemu". qemu still does full emulation. It also supports virtualisation too. If anything, it's another example of the point that I'm making which is that hardware virtualisation and emulation are too frequently intermingled for it to be sensible claiming they're distinct categories of computing. > No, I can emulate a single piece of hardware like a network adapter. I can emulate just a CPU core indepedent of a particular virtual environment. And that's exactly why they're a subset of virtual machines. I know this isn't the common way to refer to a VM but I'd argue that an emulated hardware adapter is still a virtual machine because it takes input, returns output, and is sandboxed and self contained. In the pure mathematical sense, it is a virtual machine just like how some software runtimes are also classified as virtual machines. I feel a lot of the issue here is down to businesses redefining common terms over the years to make their products seem extra special.
- epcoa 3y ago> early qemu By early qemu, meaning qemu prior to KVM and KQEMU (ie between 2003 and 2007), which only did full CPU emulation. > Workstation predates ESX by a few years and the 1.x versions of Workstation really didn't run well _at all_ It improved quickly. By 3.0 (early 2002) I was using an Windows 2000 desktop with Visual Studio on a Linux host as a daily driver workstation. That was still on pre VT-x x86. I then used this on a Pentium M (no VT-x) Thinkpad for years. > I know this isn't the common way to refer to a VM but I'd argue that an emulated hardware adapter is still a virtual machine ... The thing is overall I agree with you, I think. I agree that these terms have been used in different ways over the years to discuss overlapping concepts. Maybe the only thing is I was pushing back on a notion of "one true" ontology, but maybe that was not really your point. I also thought you were implying that system virtual machines for targets without hardware assistance (your other comment seems to suggest this) require full CPU emulation, but perhaps that was not your intent.
- hnlmorg 3y ago> I also thought you were implying that system virtual machines for targets without hardware assistance (your other comment seems to suggest this) require full CPU emulation, but perhaps that was not your intent. In fairness, I did write my comment that way. So I can see why that's the conclusion you drew. Sorry for the confusion there.