Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with libvirt in the future? #93

Open
playXE opened this issue Apr 25, 2023 · 3 comments
Open

Integration with libvirt in the future? #93

playXE opened this issue Apr 25, 2023 · 3 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@playXE
Copy link

playXE commented Apr 25, 2023

Hi! Nice work! I am running RISC-V Ubuntu 22.04 on my home server through libvirt/qemu and SSH into it through forwarded ports for developing JIT compiler for RISC-V. But build times on QEMU are just super slow. So I am asking if libvirt integration would be possible in the future so setting up and managing the VM can be done through Cockpit UI or virt-manager

@LekKit
Copy link
Owner

LekKit commented Apr 25, 2023

At some point yes, the RVVM Machine API may be wrapped to provide libvirt support. There been some work done by others, but they shortly ditched it halfway through due to lack of interest, so it doesn't seem complicated.

I would however recommend running qemu-user, or rvvm-user (which isn't usable yet but stay tuned) if the compile speeds matter very much.

The SoftMMU approach used by both QEMU & RVVM for emulating whole machines makes them inevitably slower than the host for some workloads, and compilers are very much affected. There are ways around that (using VMA to accelerate emulated MMU) but it requires a ton of work and existing OSes limit this in one way or another.

TL;DR RVVM might be 50% or whatever faster than QEMU for compiling, but it's not like it's near native speed anyways

@playXE
Copy link
Author

playXE commented Apr 25, 2023

Thanks for an answer! 50% is already very good for me! Just running my project with concurrent GC + JIT compiler takes almost an eternity on some tests and if it would be 1.5 times faster that's super great for me

@LekKit
Copy link
Owner

LekKit commented Apr 25, 2023

It's a rough estimation given that RVVM is ~2x faster on cold code translation, ~40% faster on pure integer math but ain't as good at load/stores or very complex logic. GCC falls into this estimation, but your usecase might even be slower, who knows - that's why "benchmark first". FPU/Atomic are currently interpreted only.

You may also submit chunks of code/asm you think are executing too slow on RVVM so I can have a look at optimizing it.

About the issue topic, read a bit about libvirt infrastructure, it seems it will be easy to get initial thing going, but the lack of documentation on adding a new hypervisor is absolutely painful. Upstreaming it seems a necessity, considering there is no way to add a new hypervisor without rebuilding libvirt.
If anyone could point out the lacking documentation bits, would be very helpful.

@LekKit LekKit added documentation Improvements or additions to documentation enhancement New feature or request labels Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants