
Intel Virtualisation: How VT-X, KVM and QEMU Work Together - Foe
https://binarydebt.wordpress.com/2018/10/14/intel-virtualisation-how-vt-x-kvm-and-qemu-work-together/
======
anonymousDan
There is a real lack of good textbooks on modern virtualization techniques and
hardware. Would be interested to hear any recommendations in case I've missed
something.

~~~
evancox100
I just posted a comment asking about multiprocessing/preemption - how do the
root OS and virtualized OS share the CPU core when the virtual OS assumes it
is the only thing responsible for scheduling thread execution?

~~~
the8472
Most hypervisors make this information available to the guest, you can see it
as _st%_ in top for example.

~~~
xxpor
Just to expand the abbreviation: steal time percentage

It's important to know for the OS because otherwise your clock will be way
off. There's probably other issues that would pop up too that I'm just
forgetting right now.

~~~
saagarjha
Wouldn't this only be detectable to a guest that's aware it's being
virtualized (that is, a paravirtualized one?)

~~~
tryauuum
I might be wrong, but I think "paravirtualized" means that you don't have to
modify your kernel to work with virtual CPU / virtual memory. It doesn't mean
"guest isn't aware it's being virtualized"

~~~
detaro
Paravirtualization means that the virtualization does not entirely pretend to
be real hardware, but has special interfaces that require OS modifications or
special drivers to use (although sometimes optional. E.g. KVM offers full
virtualization, but also has the option of providing VirtIO devices, which you
might call paravirtualization)

------
exdsq
Previous discussion:

[https://news.ycombinator.com/item?id=18212312](https://news.ycombinator.com/item?id=18212312)

------
zoom6628
Excellent write-up. first time i had clarity on the role of each part and i
have been using all of these tools for a very long time.

------
renox
I wonder if a CPU ISA change couldn't make virtualization more efficient?
Dedicated instructions for IO for example instead of using Load/Store.. D But
I don't think new ISA such as RISC V do this, I don't know why.

~~~
xxpor
I guess the question is, what would the new instructions do differently?

Plus, everything out there supports DMA already. Would you have to buy
different HW to support this new scheme?

An IOMMU + DMA is already pretty good, a lot of the bottleneck at this point
is really in the IO devices themselves these days (network cards and SSDs are
only so fast).

~~~
fithisux
The problem is that not all device drivers take advantage of IOMMU, to run
device drivers as user level programs.

~~~
xxpor
Maybe I'm just ignorant, but my impression was that the device drivers don't
have a choice if they're running in a VM. The hypervisor sets it up so that
all memory access was forced through the IOMMU.

