Generic Virtualization with Virtual Processors
Adam Lackorzynski, Alexander Warg and Michael Peter, TUD - Operating Systems, Technische Universität Dresden, Germany
After virtualization has been gaining traction in a variety of fields ranging from the desktop to the datacenter, it comes as no surprise that it is making inroads into embedded systems as well, being colocated with real-time workloads on the same system. The complexity of a VM implementation depends on the virtualization abilities of the processor used. Unfortunately, the ISA of many popular embedded CPUs is not virtualizable, which precludes efficient pure or faithful virtualization.
In this paper, we make the case for OS rehosting, a flavor of virtualization that lends itself to implementations of low complexity and does not rely an CPU virtualization extensions. The feasibility of OS rehosting crucially depends on the traits of the interface of the underlying kernel. Our observation was that the ubiquitously used thread model is rather poorly suited to run an OS on top. As a solution, we propose the currently often employed threads be supplemented with virtual processors (vCPUs), an abstraction that is more aligned with the underlying hardware.
To evaluate our proposition, we ported the Linux kernel to a vCPU enhanced version of the Fiasco microkernel. Compared to a previous thread-based version, we found the development effort significantly reduced. As expected, the vCPU version performed significantly better in microbenchmarks such as (user) thread switching while the advantage in application benchmarks was much less pronounced.