News for hackers. Stuff that matters.
Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by fwsgonzo on Thursday July 22, 2021 @08:16AM (#27917964)
Not a lot of meat on this, but it looks nice from glancing at all the bits. I would recommend that you read the CPUID bits from the real CPU and copy most of them over so that the kernel can enable features like SSE4.x, AVX/AVX2 and various others. Use KVM_GET_SUPPORTED_CPUID and then KVM_SET_CPUID2.

I would also set the CPU name to KVMKVMKVM and enable a few of the paravirtual devices like KVMCLOCK.

Good luck with your project!

Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by flouthoc_fl on Thursday July 22, 2021 @08:21AM (#27918000)
This is a really nice feedback, thanks a lot.
Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by flouthoc_fl on Thursday July 22, 2021 @08:44AM (#27918192)
also really thanks for discussing about CPU SIGNATURE specifically.
Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by flakiness on Thursday July 22, 2021 @03:54PM (#27923486)
Once I read an LWN article about KVM [1] and it introduced a tool called kvmtool [2] and a tiny test program illustrating how to use the KVM API. However the sample program was too simple and the latest kvmtool seemed too complex for my taste.

Wiser seems simple enough (5 small enough .c files). If it is capable to boot Linux, it can be a great learning material. Great job!

- [1] https://lwn.net/Articles/658511/

- [2] https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool...

Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by flouthoc_fl on Thursday July 22, 2021 @07:09AM (#27917527)
Its is hypervisor-ish as of now more like a vm monitor.
Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by gwd on Thursday July 22, 2021 @08:10AM (#27917926)
Why do you call it a hypervisor when it's more like a VMM?

Even the name "VMM" is a quirk of KVM; before KVM, "virtual machine monitor" was another name for a hypervisor: that is, the thing that ran on the bare hardware and provided the virtual hardware interface to the VM. KVM has fairly unique architecture, where a VM is basically a process.

I'm willing to tolerate that "drift" of meaning, because we need a word for the piece of software which converts a process into a VM, and "VMM" is a good fit. But I'd have to really object to the idea of calling such a piece of software a "hypervisor".

If your plan is to make wiser into an actual hypervisor at some point, I'd appreciate it if you made that clear in your README.

Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by flouthoc_fl on Thursday July 22, 2021 @08:17AM (#27917974)
@gwd you are correct vmm is a better fit. I'll update the repo thanks for the feedback :)
Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by jnwatson on Thursday July 22, 2021 @01:43PM (#27921960)
KVM isn't particularly unique in its process architecture. It is a classic "type 2 hypervisor", just as Wiser is.

I do prefer VMM as the term though.

Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by flouthoc_fl on Thursday July 22, 2021 @07:13AM (#27917554)
it is*
Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by tsegratis on Thursday July 22, 2021 @07:49AM (#27917785)
Wow, nice work, great name

What's your roadmap?

Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by flouthoc_fl on Thursday July 22, 2021 @07:57AM (#27917841)
Its something to think upon. As of now i don't have anything, just fix bugs and complete unfinished components maybe :).
Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by chaoticmass on Thursday July 22, 2021 @09:56AM (#27918890)
Excuse my ignorance, but what is this sort of thing used for?
Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by Topgamer7 on Thursday July 22, 2021 @11:10AM (#27919801)
An excellent example is Marcan's m1n1 hypervisor. He uses it to boot MacOS to inspect interactions between the OS and hardware calls.

Part of his efforts to have native linux on m1 CPU based apple devices.

There is a very technical video he gives an overview of his hypervisor: https://www.youtube.com/watch?v=igYgGH6PnOw

Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by rwmj on Thursday July 22, 2021 @07:41AM (#27917733)
How is it better than libkrun (written in Rust but with a C API).
Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by oscargrouch on Thursday July 22, 2021 @09:28AM (#27918577)
This whole "written in Rust" as if it was a feature BS must stop someday.

Get the project 'A' features and compare with project 'B' features, the strength and weakness of programming languages will be apparent, on the features, runtime speed, bugs, etc..

Choosing a project over another just because its in a given language is not based on logical reasoning, but emotional reasoning and therefore the bad paths will get evident with time (Except of course if the language is really unsuitable to the domain, which is not the case here whether with C or Rust).

This emotional bias for me is a reason to actually look at Rust projects with suspicious if people working on it know its just another tool with some given properties and not some magical wand that will turn everything into unicorns and rainbows.

Note: this is also targeted at "why you would want to choose C over others ?" comment bellow in the same line

Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by riquito on Thursday July 22, 2021 @11:54AM (#27920368)
> This whole "written in Rust" as if it was a feature BS must stop someday.

I hope you can notice the hypocrisy when the title of this post has "written in <language>" in it but you have no qualm with it. The comment you are responding to didn't imply anything, it could have mentioned any language, try to read with a more open mind

Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by sigjuice on Thursday July 22, 2021 @11:00AM (#27919691)
It will take a few years. We just got over the "written in Go" era.
Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by rileytg on Thursday July 22, 2021 @02:15PM (#27922353)
afaik one of the reasons it is considered a feature is memory safety. i agree a better selling point would be to say "written in a memory safe language".
Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by bobthebuilders on Thursday July 22, 2021 @10:10AM (#27919075)
Rust is a langauge which exists because colleges want to churn out programmers who do have not spent the requitisre 4 years required to learn C. I really think we need some sort of licensing for programming...
Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by throwawayboise on Thursday July 22, 2021 @02:05PM (#27922225)
Colleges should not be churning out "programmers" with skills in one language. Trade schools would be better for that.

In college I learned theory and algorithms, and was exposed to half a dozen programming languages at least. I mastered none of them, that wasn't the point.

Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by kobebrookskC3 on Thursday July 22, 2021 @10:48AM (#27919536)
yeah, and that license should be revoked if you decide to use a memory unsafe language for code exposed to untrusted input
Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by sergiomattei on Thursday July 22, 2021 @05:04PM (#27924327)
Didn't you hear? It's only programming if you use assembly.

Use of a memory safe or high level language results in immediate revocation of the Programmer Card™.

Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by vp8989 on Thursday July 22, 2021 @12:19PM (#27920793)
Are you implying that Rust takes less time to "learn" (whatever that means) than C? Have you seen Rust?
Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by Zababa on Thursday July 22, 2021 @02:44PM (#27922665)
I think it's commonly accepted that it takes less time to write memory-safe code in Rust than in C. It's also commonly accepted that for stuff where you can leverage a lots of libraries and mostly write glue code, Rust is faster than C. It's up to you to evaluate if those are your goals or not.
Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by unrealhoang on Thursday July 22, 2021 @01:42PM (#27921935)
Rust does take less time to learn than C.
Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by flouthoc_fl on Thursday July 22, 2021 @07:54AM (#27917820)
actually its not at all better but maybe different , libkrun is far more advanced and has a better support. Wiser is only restricted as a CLI tool as of now.
Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by netr0ute on Thursday July 22, 2021 @07:49AM (#27917786)
It's another option.
Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by qwertu on Thursday July 22, 2021 @07:41AM (#27917731)
why you would want to choose C over others ?
Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by inshadows on Thursday July 22, 2021 @07:51AM (#27917801)
I guess because it works?

I don't fear Rust Evangelism Strike Force. Bring it.

Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by FpUser on Thursday July 22, 2021 @09:30AM (#27918601)
Maybe because it is their own project and it is their rights to do however they see fit.
Re:Show HN: Wiser – minimal hypervisor boots Linux VM, writt... by Santosh83 on Thursday July 22, 2021 @07:59AM (#27917860)
The author has also written a Rust project: a minimal Linux container framework. I guess these projects are for learning purposes...