[GSoC 2024] Hardware Virtualization: Final Report

Blog post by dalme on Wed, 2024-08-21 00:00

Project overview

QEMU is a virtual machine which allows running an operating system inside of another. While there already is a Haiku port, it currently does not support any acceleration system through native virtualization (through Intel VT-x and AMD SVM.) This makes it too slow for many uses. This project aimed to bring hardware virtualization to Haiku by porting NVMM, a hypervisor that already has QEMU support, into Haiku from DragonFlyBSD. The project goals (as included on the proposal) were:

[GSoC 2024] Hardware Virtualization: Progress Report #2

Blog post by dalme on Thu, 2024-07-25 19:59

Another month has gone by and we’re entering now the last month of GSoC! So, what did I get done this month?

What works now that didn’t work before?

  • The driver supports now the 16 IOCTL calls defined by the driver, which means that both the frontend and the VMX backend are complete.
  • EPT tables support: Much of my previous post content was about EPT tables and all the problems I was having to get them working. Now support for them is complete and it works! The EPT page fault handler only consists of one call to Haiku’s page fault handler, since it’s everything integrated into Haiku’s virtual memory subsystem.
  • libnvmm’s test suite is ported and all tests pass.
  • QEMU (latest version from Haikuports) is capable, after applying a patch, of detecting NVMM support and compile. It doesn’t work, sadly, something breaks after executing a few chunks of any given VM.

However, I didn’t make any progress on the SVM backend (which is still at a very early state). I’m beginning to realise that this is one thing I won’t be able to finish during the coding period. I probably have all the pieces needed to port it but I have to look at the differences between SVM and VMX (there are a few) and that will probably take some time I might not have in the end. Also, it’s worth to mention that despite getting more and more stuff working the list of TODO things keeps getting longer and longer. Things on that list are improvements on performance and behavior (NVMM’s kidnaps the CPU which is probably not the best behavior if we want the system to be responsive, …). None of them is very long or difficult but there are a lot of those little things to do so they will end up requiring a considerable amount of time.

[GSoC 2024] Hardware virtualization: Progress Report #1

Blog post by dalme on Thu, 2024-06-27 02:47

When the coding period began I was expecting to publish a progress report every week. However, we’ve reached the end of the first month of the coding period and this is my first update: This probably tells that there hasn’t been as much progress as I expected, although progress have been made.

What works

  • The library was one of the first things I got done, because it consists of very portable code, which made it very easy to port, while allowing me to test the (still reduced) driver capabilities much easier as I could use already existing code examples for NVMM instead of trying to talk directly to the driver.

[GSoC 2024] Hardware virtualization for Haiku’s QEMU port

Blog post by dalme on Sat, 2024-05-11 19:08

Introduction

Hi there! I’m Daniel Martin (aka dalme) and I’m a final year undergraduate student at Complutense University of Madrid (Spain). I’ve been accepted into Google Summer of Code and I’ll be working to bring hardware virtualization to Haiku, a project that has been in the GSoC ideas list for around a decade. I’ll be mentored by scottmc and waddlesplash.

Project overview

QEMU is a virtual machine which allows running an operating system inside of another. While there already is a Haiku port, it currently does not support any acceleration system through native virtualization (through Intel VT-x and AMD SVM). This makes it too slow for many uses, due to having to emulate the guest OS on software. Fixing this would allow Haiku users to run another system, such as Windows or Linux, at almost native speed. This would make using Haiku as primary operating system a viable approach for more people since they could effectively run applications that are not yet available on Haiku.