[GSOC 2024] Hardware acceleration for Haiku's QEMU port

Congratsssssss

Congratulations, looking forward to it!

Would be a great thing! Congrats +1

1 Like

Ahoy @dalmegnu ,

Have a great journey ! … riding on the road of cyberways,
seeking out to build a well-formed HW acceleration of a VM chariot
using just C / C++ equity and your talent.

Kudos !
Tra-raa !

:cowboy_hat_face:

Great news! I make pretty heavy use of VMs so this is one of the main missing Haiku features that’s stopping me using Haiku as my main OS.

2 Likes

Today I successfully virtualized the first VM! It’s a very simple proof of concept that takes two integers and adds them. It came as a companion to this blog post.

Also, both NVMM frontend and the VMX backend are compiling on Haiku (until today there were parts that didn’t compile), although some parts remain untested.

It may not look very impressive but it has taken more than a month to get the full example working.

26 Likes

Can’t say, that looks amazing :smiley: but I know from other ports that things can be hard to get even some basics shown, thanks for working on this! :+1: (and that’s just me doing the easy stuff) :smiley:

4 Likes

Here you can see the first ever VM running on QEMU (virtualized)!

The bad news is they run slower than with software emulation :clown_face:

20 Likes

Interesting part would be to know how it behaves in virtual with and without acceleration. :slight_smile:

1 Like

Well, GSoC has come to an end!

The final report: [GSoC 2024] Hardware Virtualization: Final Report | Haiku Project

Waddlesplash told me it got to HN: Hardware Virtualization | Hacker News

10 Likes

I’ve not been reading the Haiku forums for a while so I missed this.

This is fantastic news, or at least it will be when we can run Linux and other stuff well.

Haiku’s lack of hardware virtualization has long been one of the main things stopping me from trying to run Haiku as my main OS. I’m always creating new VMs and containers under Linux. I can mostly live without proper GPU support but I can’t live without good hardware virt support.

2 Likes

This is fantastic news, or at least it will be when we can run Linux and other stuff well.

Yes, well, it can’t really run much stuff well right now. There aren’t missing features, just some hard to figure out bugs.

Some months have passed so I thought it was time for an update: There are still memory corruption issues. I’ve been trying to find a minimal reproducer for this but I haven’t been successful so far, as small operating systems seem to work fine (but Haiku fails). I’ll keep working on that, I have a few ideas but this might be beyond my debugging skills.

The good news (although note I haven’t done extensive testing):

  • Haiku+NVMM behavior on real hardware vs when running as a guest on Linux/KVM seems to match now.
  • Disabling SMP is no longer needed. VM migrations across different cpus work well now.
  • Cyberus guest tests seem to return now the same results on Haiku and NetBSD.
16 Likes

Thanks for the update! I was curious about the state. It is nice that things are progressing, it is quite a challenge to take on!

Is there any info or stack traces that would make sense sharing either a tracking ticket or the dev mailing list? Also remember that it might be existing haiku code that is the cause…

1 Like