Re: Guest mode question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Sep 16, 2012 at 2:32 AM, Nadav Har'El <nyh@xxxxxxxxxxxxxxxxxxx> wrote:
> On Sat, Sep 15, 2012, Steven wrote about "Guest mode question":
>> Hi,
>> I have a question about vm execution in the guest mode. Suppose I have
>> two VMs on a machine.
>> Is it possible that both VMs are in the guest mode? Like this
>>      vm1 enters guest mode
>>      vm2 enters guest mode
>>      // at this point, two VMs are in guest mode
>>
>> Or the hypervisor will first force one VM to vmexit before the second
>> VM enters the guest mode?
>
> Your description, of a *VM* being in guest mode, makes it sound like
> you're describing *nested* virtualization, i.e., running another hypervisor
> (like KVM) as the guest of the parent KVM. If this is what you actually
> meant, then, yes, indeed, several VMs may be in guest mode because they
> are each running a nested guest (aka an L2, a guest of a guest).
>
> But if you didn't ask about nested virtualization, but rather normal,
> single-level, virtualization, there's a different answer:
>
> It is the CPU thread (one core, or even one hyperthread), *not* the VM,
> which can be in root or guest mode. It is in root mode when the hypervisor
> runs, and in guest mode when a specific guest (VM) runs. One CPU thread can
> only run one code at a time, so of course it cannot be running two VMs at the
> same time - if it is running VM B now, it's because VM A is not running now.

Hi, Nadav
thanks for your reply. My question is regarding the the normal
single-level virtualization.
    Suppose that the physical machine has only one core and 2 VMs.
Each VM has one vcpu, so there are two vcpu threads running with the
hypervisor.
Does your answer mean these two VMs can not be in the guest mode at
the same time? For example, when the hypervisor schedules one VM, the
running VM must have a vmexit call first and then the hypervisor can
issue vmrun call to the other VM.
So only one VM can be in the guest mode, right?


> Of course, if you have a muticore machine, both A and B might be
> running, on two separate cores. In that case, both cores (not VMs) may
> be in guest mode concurrently.
>
> --
> Nadav Har'El                        |        Sunday, Sep 16 2012, 29 Elul 5772
> nyh@xxxxxxxxxxxxxxxxxxx             |-----------------------------------------
> Phone +972-523-790466, ICQ 13349191 |Does replacing myself with a shell-script
> http://nadav.harel.org.il           |make me impressive or insignificant?
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux