←back to thread

QEMU 10.1.0

(wiki.qemu.org)
302 points dmitrijbelikov | 6 comments | | HN request time: 0.376s | source | bottom
Show context
dijit ◴[] No.45038037[source]
QEMU is truly excellent software, from the perspective of a person who very rarely needs to emulate another architecture. It "just works" and has wonderful integrations with basically everything I could want.. sometimes it feels like magic: even if the commandline UX is a bit weird in places.

I've always wondered though how it works with KVM: I know KVM is a virtualisation accelerator that enables passing through native code to the CPU somehow; but it feels like QEMU/KVM basically runs the internet now. Almost the entire modern cloud is built on QEMU and KVM as a hypervisor (right?) but I feel like I'm missing a lot about how it's working.

I also wonder if this steals huge amounts of resources away from emulation, or does it end up helping out. Because to say the modern internet is largely running on QEMU is likely a massive understatement.

replies(8): >>45038105 #>>45038111 #>>45038113 #>>45038185 #>>45038444 #>>45038616 #>>45038965 #>>45038990 #
monocasa ◴[] No.45038185[source]
KVM is basically three components.

* An abstraction over second level page tables to map some of a host user process as what the guest thinks of as physical memory.

* An abstraction to jump into the context that uses those page tables, and traps back out in the case of anything that the hardware would normally handle, but the hypervisor wants to handle manually instead.

* A collection of mechanisms to handle some of those traps in kernel space to avoid having to context switch back out to the host user process if the kind of trap is common enough, both in the sense of the trap itself happens often enough to show up on perf graphs, as well as the abstraction being exercised is relatively standard (think interrupt controllers and timers).

Let me know if you have any other questions.

replies(3): >>45038711 #>>45042005 #>>45042709 #
1. eddd-ddde ◴[] No.45038711[source]
Where could someone get started in terms of reading material to learn more about this in depth?
replies(3): >>45039162 #>>45041157 #>>45043593 #
2. dysoco ◴[] No.45039162[source]
I would assume sooner or later you're going to end up in the Intel Developer manuals or the equivalent for whatever architecture you are interested in. The Intel ones are very complete at least.
replies(2): >>45039342 #>>45042538 #
3. znpy ◴[] No.45039342[source]
> I would assume sooner or later you're going to end up in the Intel Developer manuals or the equivalent for whatever architecture you are interested in. The Intel ones are very complete at least.

I can vouch for this. I'm no virtualization expert but I did stumble upon some intel developers manuals (truthfully, i fell into the rabbit hole) and just skimming it made everything make much more sense.

For example: https://www.intel.com/content/dam/www/public/us/en/documents... - "CHAPTER 23 INTRODUCTION TO VIRTUAL MACHINE EXTENSIONS"

The link above explains how the VMX extension work on intel processors. Any software doing hardware-assisted virtualization (so no binary translation, no full-system-emulation) will likely be using those instructions.

4. yjftsjthsd-h ◴[] No.45041157[source]
From a different direction, I'd suggest https://www.devever.net/~hl/kvm
5. jlokier ◴[] No.45042538[source]
The AMD Processor Programming Reference manuals are also good for this, if you like complete and detailed. They complement the Intel manuals. Much the material is duplicate because the processors are so similar, but written in a different way.
6. billywhizz ◴[] No.45043593[source]
if you want to look at existing implementations on top of kvm then these might be useful - rust-vmm is a core library for AWS' firecracker vmm.

https://github.com/rust-vmm/kvm https://github.com/kvmtool/kvmtool https://github.com/sysprog21/kvm-host