Hello again and a happy new year :-)

This is the last post of my blog series on how to port an unikernel to Xen. Last time we had a look at the performance of my implementations and how it compared to the original one. The results looked very promising which led me to the conclusion that Xen is a valid choice when looking for a platform to run HermitCore on. In this post I will wrap thing up and provide a small summary about what I have done.

Over the course of the last posts, I showed how I extended the unikernel HermitCore in such a way that it can be executed in different ways as a guest in Xen. On the one hand as a fully virtualized guest whose hardware is completely emulated by Xen, which makes it possible to run practically unmodified operating systems. On the other hand as a paravirtualized guest whose OS has to be modified, but which promised better performance. First, I gave an insight into Xen to explain the conceptual changes that need to be made to a paravirtualized guest. I also provided a short introduction to unikernels and HermitCore.

The focus of my implementation was initially aimed at the support for the operation as a so-called HVM guest. I wrote a wrapper script to create a bootable ISO image from the unmodified HermitCore files and start it as a fully virtualized guest in Xen. Apart from supporting multiple CPU cores, this can be considered working completely.

The next thing I tried, was to modify HermitCore to work as a fully paravirtualized guest in Xen. I explained the necessary substantial changes at many crucial places in the source code in detail. Unfortunately it would have also been necessary to change the memory management in large parts, in order to fulfill the restrictions demanded by Xen. Since the implementation of the memory management represented a bachelor thesis on its own, I chose not to do this.

Instead, I implemented the necessary changes to run HermitCore as a hybrid PVH guest under Xen. This had the advantage that no changes to the memory management were necessary. I could adopt the already made changes to the source code with slight modifications and HermitCore was extended so that it is completely functional except for a few small restrictions.

Finally I compared the new HermitCore operating modes with the original modes using the benchmarks already included in HermitCore. It turned out that the new modes are able to keep up with the original implementation in terms of performance except for a few minor differences.

It would be interesting to see in future work, what would be necessary to implement the missing features in HermitCore to make it work completely under Xen. This includes support for multiple CPU cores, a working network driver and a working console as a PVH guest. It would also be interesting to see how extensive the changes to the memory management must be in order to run HermitCore as a completely paravirtualized guest.

Finally I can say that Xen is a very interesting additional platform for HermitCore. The effort required for porting was reasonable and the performance looks promising. Since Xen is one of the most used hypervisors in the cloud and HermitCore is also specially developed for cloud computing, it is certainly a useful addition.

I hope you enjoyed my blog post series and will be back for my future posts :-)

Jan