Anonymous edits have been disabled on the wiki. If you want to contribute please login or create an account.


Warning for game developers: PCGamingWiki staff members will only ever reach out to you using the official press@pcgamingwiki.com mail address.
Be aware of scammers claiming to be representatives or affiliates of PCGamingWiki who promise a PCGW page for a game key.

Topic on Talk:Virtualization

Line 3: Line 3:
 
If we are just caring for x86, once upon a time there were just full architecture emulator/simulators like Bochs, I guess. Not very differently from any modern console emulator you could say.  
 
If we are just caring for x86, once upon a time there were just full architecture emulator/simulators like Bochs, I guess. Not very differently from any modern console emulator you could say.  
  
Then VMware came in 1999 with [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.832.5579&rep=rep1&type=pdf#page=5 binary translation] and performance became a thing. Not that the technique itself is fast (QEMU also has a nice JIT recompiler, but that's far from the native speed you can [https://research.cs.wisc.edu/areas/os/Seminar/schedules/archive/vmware_osseminar.ppt otherwise] get), but because it allowed to overcome the x86 [https://www.anandtech.com/show/2480/3 insidiousnesses] and use direct execution in most other places people actually cared for (i.e. normal applications).  
+
Then VMware came in 1999 with [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.832.5579&rep=rep1&type=pdf#page=5 binary translation] and performance became a thing. Not that the technique itself is fast (QEMU also has a nice [https://old.reddit.com/r/emulation/comments/9kg1fj/ps4_emulator_orbital_has_a_patreon/e700hq2/?context=2 JIT recompiler] by default, but that's far from [https://research.cs.wisc.edu/areas/os/Seminar/schedules/archive/vmware_osseminar.ppt native speed]), but because it allowed to overcome the x86 [https://www.anandtech.com/show/2480/3 insidiousnesses] and use direct execution in most other places people actually cared for (i.e. normal applications).  
  
 
As a fun fact this [https://www.vmware.com/content/dam/digitalmarketing/vmware/en/pdf/techpaper/software_hardware_tech_x86_virt.pdf#page=4 could not] have been used on Intel CPUs to virtualize 64 bit efficiently. And since VirtualBox 6.1 and Workstation 14 it is not even supported anymore.  
 
As a fun fact this [https://www.vmware.com/content/dam/digitalmarketing/vmware/en/pdf/techpaper/software_hardware_tech_x86_virt.pdf#page=4 could not] have been used on Intel CPUs to virtualize 64 bit efficiently. And since VirtualBox 6.1 and Workstation 14 it is not even supported anymore.  
  
Thankfully between 2005 and 2006 Intel and AMD made trap-and-emulate possible in hardware, and that's what VT-X and AMD-V are all about eventually. It is more about lessening the burden to have a smart hypervisor (and perhaps some edge case) [https://www.vmware.com/pdf/asplos235_adams.pdf than] performance though. And for historical reason, I'm not sure if solutions other than VMware's ever supported "64 bit at all" without it. It is also needed for 64/32 and 32/64 bit mixed host and guests (KVM doesn't support the latter [https://www.mail-archive.com/search?l=qemu-devel@nongnu.org&q=subject:%22[Bug+596106\<nowiki>]</nowiki>%22&o=oldest&f=1 for reasons])
+
Thankfully between 2005 and 2006 Intel and AMD made classical trap-and-emulate virtualization possible, and that's what VT-X and AMD-V are all about eventually. It is more about lessening the burden to have a smart hypervisor (and perhaps some edge case) [https://www.vmware.com/pdf/asplos235_adams.pdf than] performance though. And for historical reason, I'm not sure if solutions other than VMware's ever supported "64 bit at all" without it. It is also needed for 64/32 and 32/64 bit mixed host and guests (KVM doesn't support the latter [https://www.mail-archive.com/search?l=qemu-devel@nongnu.org&q=subject:%22%5BBug+596106\%5D%22&o=oldest&f=1 for reasons])
  
 
Note: when [https://web.archive.org/web/20080726233057/http://blogs.msdn.com/virtual_pc_guy/archive/2008/05/07/it-doesn-t-feel-like-a-hypervisor-to-me.aspx Hyper-V] is enabled, it pretends "Hardware Virtual Machine"s not to be supported.  
 
Note: when [https://web.archive.org/web/20080726233057/http://blogs.msdn.com/virtual_pc_guy/archive/2008/05/07/it-doesn-t-feel-like-a-hypervisor-to-me.aspx Hyper-V] is enabled, it pretends "Hardware Virtual Machine"s not to be supported.  
Line 13: Line 13:
 
And then it came [[Wikipedia:Second Level Address Translation|SLAT]]. Which simplified as much as possible memory management (not to be confused with the previous handling of just the instruction set), leading also to [https://web.archive.org/web/20150226042650/http://www.vmware.com/pdf/RVI_performance.pdf performance] [https://www.vmware.com/pdf/Perf_ESX_Intel-EPT-eval.pdf increases], and it is becoming a hard requirement in a lot of modern products, from Hyper-V, to [https://github.com/intel/haxm/issues/30#issuecomment-372544743 HAXM], and Workstation ≥14. It is known as [https://web.archive.org/web/20150322111930/http://support.amd.com/en-us/kb-articles/Pages/GPU120AMDRVICPUsHyperVWin8.aspx RVI] on the AMD front and EPT on the Intel one. Even though in the later case, depending on the mood of a hypervisor (or maybe the key difference is [https://web.archive.org/web/20110427072327/https://searchservervirtualization.techtarget.com/news/2240034817/KVM-reignites-Type-1-vs-Type-2-hypervisor-debate being] Type-2 rather than Type-1?), they may actually be required to support "Unrestricted guests" too. <small>Aka leaving Bloomfield in the dirt.</small>
 
And then it came [[Wikipedia:Second Level Address Translation|SLAT]]. Which simplified as much as possible memory management (not to be confused with the previous handling of just the instruction set), leading also to [https://web.archive.org/web/20150226042650/http://www.vmware.com/pdf/RVI_performance.pdf performance] [https://www.vmware.com/pdf/Perf_ESX_Intel-EPT-eval.pdf increases], and it is becoming a hard requirement in a lot of modern products, from Hyper-V, to [https://github.com/intel/haxm/issues/30#issuecomment-372544743 HAXM], and Workstation ≥14. It is known as [https://web.archive.org/web/20150322111930/http://support.amd.com/en-us/kb-articles/Pages/GPU120AMDRVICPUsHyperVWin8.aspx RVI] on the AMD front and EPT on the Intel one. Even though in the later case, depending on the mood of a hypervisor (or maybe the key difference is [https://web.archive.org/web/20110427072327/https://searchservervirtualization.techtarget.com/news/2240034817/KVM-reignites-Type-1-vs-Type-2-hypervisor-debate being] Type-2 rather than Type-1?), they may actually be required to support "Unrestricted guests" too. <small>Aka leaving Bloomfield in the dirt.</small>
  
---
+
But when everything seemed all finally nice smooth and dandy, from 2018 onward another important [https://forums.virtualbox.org/viewtopic.php?f=6&t=88706&start=15 factor] distinguishing the various programs is how good they managed to wire and/or workaround the various speculative execution vulnerabilities and mitigations.
 +
----
 +
Tangential to all of this, last but not least, VT-d/AMD-Vi/IOMMU is the magic allowing passing through of physical hardware devices to guests. It requires support in the motherboard chipset and bios, in addition to the usual one by the CPU.
  
Tangential to all of this, last but not least, VT-d/AMD-Vi/IOMMU is the magic allowing passing through of physical hardware devices to guests. It requires support in the motherboard chipset and bios, in addition to the usual one by the CPU.
+
EDIT: it [https://web.archive.org/web/20191122203540/https://www.virtualbox.org/manual/ch09.html#pcipassthrough actually] happens to be a requirement only for devices using [https://arstechnica.com/information-technology/2010/02/io-virtualization/3/ DMA].. such as about everything and the kitchen sink in 2020. But if you have a gpu from [https://www.vogons.org/viewtopic.php?t=59169 the 90s] <small>(and a PCI slot? people really have mixed opinions on whether bus mastering is an integral part of PCIe or not)</small> you should be done!
  
Also, from 2018 onward, another important [https://forums.virtualbox.org/viewtopic.php?f=6&t=88706&start=15 factor] distinguishing the various programs is how good they managed to wire and/or workaround the various speculative execution vulnerabilities and mitigations.
+
Otherwise [https://studiopixl.com/2017-08-27/3d-acceleration-using-virtio.html paravirtualization] is the only hope left.