kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Sylvain Leroux <sylvain@chicoree.fr>, kvm@vger.kernel.org
Subject: Re: KVM is type 1 hypervisor, but...
Date: Tue, 30 May 2017 15:16:33 +0200	[thread overview]
Message-ID: <766f093c-ea5b-0bb2-04f8-c406d0ef16b7@redhat.com> (raw)
In-Reply-To: <87109f32-5a26-3ad8-ce5e-d5074d2d69d8@chicoree.fr>



On 27/05/2017 19:06, Sylvain Leroux wrote:
> I certainly do not want to start a type 1 vs type 2 holly war. But I'm
> working on some introductory course on virtualization and I have hard
> time to conciliate the average user daily experience with the premise
> KVM *is* type 1.

Hi Sylvain,

it would help if you provided the original quote about type-1 and
type-2, because I have never been able to find it.  It is often cited
together with the above Popek-Goldberg paper but I cannot find it in there

If you really want to cut hypervisors in two, you could distinguish
"type-1" hypervisors that run in supervisor mode (x86 says ring 0) from
"type-2" hypervisors that run in user mode (x86 says ring 3).

It is debatable that this classification makes sense because, on a
virtualizable machine with paging, a hypervisor running in ring 3 would
likely need some help from the kernel in order to build page tables;
Popek and Goldberg's paper ("Formal Requirements for Virtualizable Third
Generation Architectures" paper, CACM vol. 17 n. 7 pages 412-421) only
mentions a simple segmented architecture.  But anyway, based on this
classification, type-2 hypervisors on x86 _must_ be doing dynamic
translation, because x86 with virtual machine extensions is not
virtualizable and virtual machine extensions are only accessible from
ring 0.  Anything that uses virtual machine extensions would be type-1.

You arrive to the same conclusion if you say that type-1 runs in VMX
root mode and type-2 runs in VMX non-root mode.

Another case where the distinction is substantially blurred by computers
and OSes newer than the 1970s is I/O devices.  In this case, VFIO allows
I/O devices to be used directly by the virtual machine with no overhead
for I/O calls, and together with KVM no overhead for interrupts either.

In other words, kernel modules like KVM or Apple's Hypervisor.framework
augment conventional OSes with the abilities of a VMM, but KVM and
Hypervisor.framework (and VirtualBox too) are definitely "bare metal".

I would just ignore it.  To some extent, the modern usage of the type-1
and type-2 terms is really more about VMware and Xen trying to bash KVM,
than anything else.

Paolo

  parent reply	other threads:[~2017-05-30 13:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-27 17:06 KVM is type 1 hypervisor, but Sylvain Leroux
2017-05-28  6:34 ` Christoph Hellwig
2017-05-28  8:46   ` Sylvain Leroux
2017-05-28 11:51     ` Christoph Hellwig
2017-05-28 19:06       ` Sylvain Leroux
2017-05-29  6:41         ` Jan Kiszka
2017-05-29  9:05           ` Sylvain Leroux
2017-05-29 20:34             ` Jan Kiszka
2017-06-05 15:00               ` Sylvain Leroux
     [not found]       ` <48902d71-d540-4cd6-b76b-196febf40db6@email.android.com>
2017-05-29  8:13         ` Christoph Hellwig
2017-05-29  9:12           ` Sylvain Leroux
2017-05-30 13:16 ` Paolo Bonzini [this message]
     [not found]   ` <CACJDEmor4xvd4t2cEW=MLJrQiwQP9rpON09CLXDouw_Oej3Cng@mail.gmail.com>
2017-05-31 14:21     ` Paolo Bonzini
2017-06-05 14:39   ` Sylvain Leroux
2017-06-05 15:40     ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=766f093c-ea5b-0bb2-04f8-c406d0ef16b7@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=sylvain@chicoree.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).