Beautiful Architecture Chap. 9 - JPC: An x86 PC Emulator in Pure Java
I find the discussion of emulators vs. virtual machines to be somewhat confusing because the terms "emulation", "virtualization", and "simulation" all seem to be used interchangeably. Given how rapidly technology evolves to produce a solution that has the best of both worlds, we probably won't ever find a hard distinction between an emulator, a simulator, and a virtual machine. Nevertheless, it's important to understand their key differences at the moment and to dive into the architectural details of existing solutions. Here's a list of pros & cons of JPC and Virtual Machines in general.
JPC Pros
1. No dependency on the underlying hardware
- Can virtualize an x86 machine on any host that has a JVM
- Completely isolated from HW & SW platform changes; there's no need to change the OS or to have special hardware
2. JVMs are ubiquitous and considered to be one the most secured virtual machines
- JVMs guards against programming errors
- The 3 layers (JPC, JVM, Hardware) are completely independent from each other since they're made by different companies. Given that each have other general uses, they must have gone through some rigorous testing. Therefore, it's unlikely for a security threat to permeate through all these layers.
JPC Cons
1. Highly dependent of Java
- The process of trying to achieve optimal performance, the development of JPC let to workarounds specific to a Java environment.
- With talks about Sun going to be bought out in near future, Java's destiny is uncertain.
2. Still slower than a VM
- Currently executes code at 10% native speed.
- Article never talked about how it compared in performance with other VMs
VM Pros
1. Paravirtualization eliminates the extra level of indirection by making calls to the Hypervisor (as implied by Dan Orchard's blog).
VM Cons
1. As the article states, "You need hardware that is the same as that being 'virtualized'"
2. More dependency on HW/SW
- Paravirtualization requires changing OS or having the HW provide these capabilities
3. Security holes have been claimed
- Blue Pill & System Management Mode (SMS) Memory Attacks via Intel CPU cache Poisoning
- "HW supported x86 CPU virtualization has security vulnerabilities due to the shared L1/L2 cache of multicore chips"
Neither Pro nor Con
1. Virtualization products are typically designed for speed, not security.
In comparison to other emulators, Bochs (written in C++) needs to have built-in support for different operating system while JPC only needs support from a JVM. However, "JPC has to deal with the extra design restrictions and performance considerations for running under a JVM".
Awana81 pointed out that they didn't mention that it only supports a limited number of OSs as of today. Throughout the article, they celebrate the successful emulation of an x86 computer, which is everywhere, yet they haven't gotten it to boot up a WinXP desktop (which is probably the most common OS nowadays). They were only able to boot up to the command line prompt of DOS, many flavors of Linux, and legacy Windows OSs.
Overall, I can see several reasons why emulators like JPC can be useful. You can test software for mobile devices, embedded system and video game consoles before flashing the code into these devices. Also as described at http://www-jpc.physics.ox.ac.uk/applications_cloud.html , this could provide opportunities for cloud computing on idle desktops as opposed to large datacenters where it can save financial & environmental costs . JPC has partnered with NereusV to provide a way for people to donate CPU idle time of their computers by simply going to a webpage; nothing to be installed. Then, developers push their x86 PC software to these NereusV clients without any action by the host user. This is all done within the confinements of JPC, which adds a security level on top of the Java Applet Sandbox.
In the end, the usage of emulators and VMs boil down to this: virtual machines are mostly used for running different OS environments while emulators are mostly used to emulate embedded, mobile devices.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment