[haiku-development] Re: Regarding the KVM support

  • From: Laasya Sree <laasyasreesapa@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 1 Mar 2020 15:52:11 +0530

Hello,

Hope you are having a great weekend,

*Work done: *I have read about KVM[1] and NVMM[2] and connection between
KVM and QEMU[3]. And I think implementing NVMM will be apt:

   1. NVMM's complex emulation machinery is *not in the kernel, but in
   userland*. This is an excellent security property of NVMM, because it
   reduces the risk for the host in case of bug or vulnerability – the host
   kernel remains unaffected –, and also has the advantage of making the
   machinery easily fuzzable. Currently, this property is not found in other
   hypervisors such as KVM, HAXM or Bhyve.
   2. NVMM does use some specific internals of NetBSD to limit memory use
   so this would be one aspect to consider compatibility wise.
   3. Solaris/Illumos have ported KVM to their OS but sooner it became
   unmaintanable.
   4. In his blog post KVM on illumos
   <http://dtrace.org/blogs/bmc/2011/08/15/kvm-on-illumos/>, Cantrill
   explains why the porting effect was so grueling:

   *Because KVM is so tightly integrated into the Linux kernel, it was
   difficult to determine dependencies - and hard to know when to pull in the
   Linux implementation of a particular facility or function versus writing
   our own or making a call to the illumos equivalent (if any).*

   5. Haiku is released under MIT license and NVMM is under GNU General
   Pubic license(GPL). And the MIT license is compatible with many copyleft
   licenses, such as the GNU GPL. MIT licensed software can be re-licensed
   as GPL software, and integrated with other GPL software.
   6. KVM is 99 percent linux specific and NVMM is the fastest way to do it.

*Query*: Now that I have thought that NVMM is suitable for haiku I would
like to get your guidance regarding what to begin with and where to take my
first step. It would be really helpful if you could guide me on this.

Hope to hear from you soon.

[1] - https://www.linuxjournal.com/article/9764
[2] - https://blog.netbsd.org/tnf/entry/from_zero_to_nvmm
[3] - https://cloudbuilder.in/blogs/2014/03/09/kvm-and-qemu/


On Wed, Jan 29, 2020 at 6:32 PM Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
wrote:

29 janvier 2020 13:05 "Laasya Sree" <laasyasreesapa@xxxxxxxxx> a écrit:

Hello,

Apologies for the late reply.

Work done: I have booted haiku using Virtualbox and I have also
installed qemu for haiku. This took
some time as I didn't know that 'sudo', 'apt-get' commands wouldn't work
in haiku and finally I had
to install qemu from haiku-depot.

Hi,

Yes, apt and apt-get are specific to Debian based systems. The command to
use for package management
on Haiku is less creatively named pkgman (short for "package manager").

Query: As I had to install qemu by using the haiku-depot rather than
from the source code, I wanted
to install it using the code and I couldn't find the proper
documentation. It would be really
useful if you could please help me with the same.

For automated build from sources, you can use haikuporter, which is the
tool we use to build packages.
Hqikuporter uses "recipes" which are files describing the steps used to
build some software. You can
look at the recipe to see how things are done there, and you should be
able to reproduce these steps
manually.


https://github.com/haikuports/haikuports/wiki/A-Gentle-Introduction-to-HaikuPorter-%231
QEmu recipe:
https://github.com/haikuports/haikuports/blob/189994c0a685334f619d48d1630973ecf97bfed1/app-emulation/qemu/qemu-2.9.0.recipe
QEmu patches:
https://github.com/haikuports/haikuports/blob/189994c0a685334f619d48d1630973ecf97bfed1/app-emulation/qemu/patches/qemu-2.9.0.patchset

The rough process is:
- Download and extract the sources for qemu
- Apply the patches
- Install the dependencies using pkgman
- Build the program using the instructions in the BUILD() section of the
recipe

Also, I would like to know if I should implement
KVM or NVMM and what I'm expected to do after that.

If you are applying for Google Summer of Code, we expect that you are able
to do some research on
both and make the decision on your own according to, for example:
- The licenses used - are they compatible with Haiku?
- The size of the code to write - is one significantly simpler than the
other?
- The stability of the APIs - will the port continue working for a long
time, or will it be outdated after just a few months because everything
changed in KVM or NVMM?
- The documentation and support available - Is the documentation good? Are
developers from the project willing to help with porting it to Haiku or are
they not interested?
- And so on, there are probably other things to consider

It's up to you to research these options and provide a summary in your
GSoC application, explaining why you went with one solution rather than the
other.

--
Adrien.




-- 
Regards,
Laasya,
Amrita university <https://www.amrita.edu/>
|Github|| <https://github.com/laasyasree>amFoss| <https://amfoss.in/>

Other related posts: