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

This is a great proposal! It’s very complete and shows that you have done the needed research. I added two comments in the doc but it’s just some minor details.

Thank you !

I think your next step should be to look into the review comments in your patch submission on Gerrit and reply to them if you haven’t already done so. We can move part of the discussion into the forum if it gets too involved for Gerrit (which isn’t the best place to discuss design and development approaches).

Yesterday I pushed another patchset which essentially refactors the code to fit the more OS-independent DragonFlyBSD style of NVMM. I already replied to every comment, although I left 2 of them unresolved (since they may involve more debate).

I agree that moving part of the discussion here may be a good idea, if it gets too long.

2 Likes

I suppose we should CC @KapiX here, because he was poking at porting NVMM at one point. I’m not sure how far he got (or if he ever published his code anywhere, I don’t see it if so.) Perhaps he might have some ideas or comments (or even some code to get you jump-started…)

1 Like

I never got anything usable. I have uploaded the code at my GitHub fork just now.

nvmm-old branch is my attempt with NetBSD code. I think this one was compiling, but a lot of things were missing.
nvmm2-old is a restart with DragonflyBSD code. (This one is IMO the way to go, its abstraction is better.)

7 Likes

The only thing I’ll point out here is you should get someone to give you an AMD machine… just to test on, its not much sense to leave out the svm code when you are probably already doing 99% of the work to implement it also.

Many people here would be happy to send you a test laptop etc… myself included. I have a stack of Lenovo Zacate based laptops that do have SVM if you want one.They are chunky durable machines I just toss around wherever I need a computer. They aren’t fast just cheap and durable.

In any case even if you don’t get around to SVM this will be a great addition to Haiku anyway!

2 Likes

Thank you ! Looks useful.

nvmm2-old is a restart with DragonflyBSD code. (This one is IMO the way to go, its abstraction is better.)

Yes, the proposal already states that we’re porting DragonFlyBSD version of nvmm.

1 Like

The only thing I’ll point out here is you should get someone to give you an AMD machine… just to test on, its not much sense to leave out the svm code when you are probably already doing 99% of the work to implement it also.

I agree, that’s why I stated that if time and circumstances (that is, I can get my hands on a machine that supports SVM) allow this will get done. I still think that it’s better to get VMX+QEMU working first, and then add SVM.

Many people here would be happy to send you a test laptop etc… myself included. I have a stack of Lenovo Zacate based laptops that do have SVM if you want one.They are chunky durable machines I just toss around wherever I need a computer. They aren’t fast just cheap and durable.

Great to hear! If the project is selected for GSoC and things go well I hope it’ll get to the point of adding SVM support too. I would call for a SVM machine then, if needed.

2 Likes

By the way what area of the world are you located in?

I live in Spain

Ah well if you end up wanting a laptop lets check for something from Europe first so we avoid shipping costs and such, but I’m still good to send you one if needed I’m located east coast USA.

I was just notified that this project has been acepted to GSoC!

And according to the GSoC site scottmc and waddlesplash are my mentors. Looking forward to have a productive summer!

I want to thank everyone that showed interest for this project (and big thanks to Pulkomandy, who kindly review my application draft).

27 Likes

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.

25 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:

19 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

9 Likes