public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* KVM & VMX root mode
@ 2007-08-31 13:02 Sander van Leeuwen
       [not found] ` <46D81156.8050100-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: Sander van Leeuwen @ 2007-08-31 13:02 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hi,

We have had several reports of users saying our product VirtualBox 
crashes their (Linux) host. It turned out that KVM is responsible, because
it leaves the CPU in VMX root mode.

Doing this changes the way the cpu operates: updates to reserved bits in 
control registers cause general protection faults.
We hit such cases on two occasions; clearing the X86_CR4_VMXE bit in CR4 
and turning off paging.

I have added a workaround to detect VMX root mode, simply refuse to run 
and recommend that the user disables KVM.
I would however appreciate if you could fix KVM instead.

-- 
Kind regards / mit freundlichen Gruessen / Met vriendelijke groet
  Sander van Leeuwen

innoTek GmbH
http://www.innotek.de
Germany 



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
       [not found] ` <46D81156.8050100-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
@ 2007-09-01 14:25   ` Avi Kivity
       [not found]     ` <46D97669.7050609-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: Avi Kivity @ 2007-09-01 14:25 UTC (permalink / raw)
  To: Sander van Leeuwen; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Sander van Leeuwen wrote:
> Hi,
>
> We have had several reports of users saying our product VirtualBox 
> crashes their (Linux) host. It turned out that KVM is responsible, because
> it leaves the CPU in VMX root mode.
>
> Doing this changes the way the cpu operates: updates to reserved bits in 
> control registers cause general protection faults.
> We hit such cases on two occasions; clearing the X86_CR4_VMXE bit in CR4 
> and turning off paging.
>
> I have added a workaround to detect VMX root mode, simply refuse to run 
> and recommend that the user disables KVM.
> I would however appreciate if you could fix KVM instead.
>
>   

Simply '/sbin/rmmod kvm-intel' and kvm will exit vmx root mode.


-- 
Any sufficiently difficult bug is indistinguishable from a feature.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
       [not found]     ` <46D97669.7050609-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-09-01 14:33       ` Alexey Eremenko
       [not found]         ` <7fac565a0709010733j2c3f58aav743949a3021a5c30-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2007-09-01 15:09       ` Sander van Leeuwen
  1 sibling, 1 reply; 22+ messages in thread
From: Alexey Eremenko @ 2007-09-01 14:33 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

> Simply '/sbin/rmmod kvm-intel' and kvm will exit vmx root mode.

Yes, but this is very poor solution. This basically disables KVM. It
doesn't enables users to run VirtualBox and KVM side-by-side, at the
same time.

I would like to see a really fixed solution.

-- 
-Alexey Eremenko "Technologov"

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
       [not found]         ` <7fac565a0709010733j2c3f58aav743949a3021a5c30-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2007-09-01 14:35           ` Avi Kivity
       [not found]             ` <46D9789B.9040001-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: Avi Kivity @ 2007-09-01 14:35 UTC (permalink / raw)
  To: Alexey Eremenko; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Alexey Eremenko wrote:
>> Simply '/sbin/rmmod kvm-intel' and kvm will exit vmx root mode.
>>     
>
> Yes, but this is very poor solution. This basically disables KVM. It
> doesn't enables users to run VirtualBox and KVM side-by-side, at the
> same time.
>
>   

If VirtualBox uses vmx, then it can't be run side-by-side with kvm.

-- 
Any sufficiently difficult bug is indistinguishable from a feature.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
       [not found]             ` <46D9789B.9040001-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-09-01 14:44               ` Alexey Eremenko
  0 siblings, 0 replies; 22+ messages in thread
From: Alexey Eremenko @ 2007-09-01 14:44 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

> If VirtualBox uses vmx, then it can't be run side-by-side with kvm.
>
VirtualBox doesn't uses VMX by default, but can take advantage of.

-- 
-Alexey Eremenko "Technologov"

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
       [not found]     ` <46D97669.7050609-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  2007-09-01 14:33       ` Alexey Eremenko
@ 2007-09-01 15:09       ` Sander van Leeuwen
       [not found]         ` <46D980C2.3040501-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
  1 sibling, 1 reply; 22+ messages in thread
From: Sander van Leeuwen @ 2007-09-01 15:09 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hi Avi,

Our non-vmx mode fails, because the cpu is in vmx root mode.

Two products that use vt-x for virtualization could perfectly co-exist 
if both comply with the way Intel recommends people to use vt-x.
See figure 19.1 in chapter 19.4 of the 'Intel 64 and IA-32 Architectures 
Software Developer's Manual'. VirtualBox is programmed to
follow these rules and therefor allows any other virtualizer to run 
side-by-side.

Currently KVM prevents us from using our generic virtualization engine 
and does not allow anybody else to use the vt-x extensions (without
explicitely leaving vmx root mode).

As your product is included in the mainline Linux kernel and enabled by 
default, it would be nice if you could follow Intel's recommendations.

Thank you.

Avi Kivity wrote:
> Sander van Leeuwen wrote:
>> Hi,
>>
>> We have had several reports of users saying our product VirtualBox 
>> crashes their (Linux) host. It turned out that KVM is responsible, 
>> because
>> it leaves the CPU in VMX root mode.
>>
>> Doing this changes the way the cpu operates: updates to reserved bits 
>> in control registers cause general protection faults.
>> We hit such cases on two occasions; clearing the X86_CR4_VMXE bit in 
>> CR4 and turning off paging.
>>
>> I have added a workaround to detect VMX root mode, simply refuse to 
>> run and recommend that the user disables KVM.
>> I would however appreciate if you could fix KVM instead.
>>
>>   
>
> Simply '/sbin/rmmod kvm-intel' and kvm will exit vmx root mode.
>
> If VirtualBox uses vmx, then it can't be run side-by-side with kvm.


-- 
Kind regards / mit freundlichen Gruessen / Met vriendelijke groet
   Sander van Leeuwen
 
innoTek GmbH
sandervl-2taLTamkYL2ELgA04lAiVw@public.gmane.org
http://www.innotek.de
Germany



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
       [not found]         ` <46D980C2.3040501-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
@ 2007-09-01 15:59           ` Avi Kivity
       [not found]             ` <46D98C53.4070604-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: Avi Kivity @ 2007-09-01 15:59 UTC (permalink / raw)
  To: Sander van Leeuwen; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Sander van Leeuwen wrote:
> Hi Avi,
>
> Our non-vmx mode fails, because the cpu is in vmx root mode.
>
> Two products that use vt-x for virtualization could perfectly co-exist 
> if both comply with the way Intel recommends people to use vt-x.
> See figure 19.1 in chapter 19.4 of the 'Intel 64 and IA-32 
> Architectures Software Developer's Manual'. VirtualBox is programmed to
> follow these rules and therefor allows any other virtualizer to run 
> side-by-side.

As far as I understand, kvm follows these rules.  It enables vmx when 
loaded and disables then when unloaded.

>
> Currently KVM prevents us from using our generic virtualization engine 
> and does not allow anybody else to use the vt-x extensions (without
> explicitely leaving vmx root mode).

Well, obviously kvm can't operate if you disable cr4.vmxe and/or switch 
paging off.  The two solutions are not run-time compatible.  I don't see 
why this is a problem as you should simply not run the product you 
aren't using, and everything should just work.

>
> As your product is included in the mainline Linux kernel and enabled 
> by default, it would be nice if you could follow Intel's recommendations.

kvm isn't enabled by default.  It requires explicit user action to enter 
vmx mode ('modprobe kvm-intel').


-- 
Any sufficiently difficult bug is indistinguishable from a feature.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
       [not found]             ` <46D98C53.4070604-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-09-01 17:24               ` Sander van Leeuwen
       [not found]                 ` <46D9A030.1020904-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: Sander van Leeuwen @ 2007-09-01 17:24 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Avi,

I'd like to make clear that we are talking about the situation where kvm 
is *not* being used by any application.

It's my understanding that in some (many?) distributions kvm is actually 
active on a permanent basis. I can't say whether this was done
by default or explicitly by the user. There is however no need to 
activate vmx root mode when there is no client program that is using
the kvm extension.

 From your comments I understand that you enable vmx root mode when the 
kvm module is loaded. Regardless of whether an application
actually wishes to use the kvm extension.



Avi Kivity wrote:
> Sander van Leeuwen wrote:
>> Hi Avi,
>>
>> Our non-vmx mode fails, because the cpu is in vmx root mode.
>>
>> Two products that use vt-x for virtualization could perfectly 
>> co-exist if both comply with the way Intel recommends people to use 
>> vt-x.
>> See figure 19.1 in chapter 19.4 of the 'Intel 64 and IA-32 
>> Architectures Software Developer's Manual'. VirtualBox is programmed to
>> follow these rules and therefor allows any other virtualizer to run 
>> side-by-side.
>
> As far as I understand, kvm follows these rules.  It enables vmx when 
> loaded and disables then when unloaded.
>
>>
>> Currently KVM prevents us from using our generic virtualization 
>> engine and does not allow anybody else to use the vt-x extensions 
>> (without
>> explicitely leaving vmx root mode).
>
> Well, obviously kvm can't operate if you disable cr4.vmxe and/or 
> switch paging off.  The two solutions are not run-time compatible.  I 
> don't see why this is a problem as you should simply not run the 
> product you aren't using, and everything should just work.
>
>>
>> As your product is included in the mainline Linux kernel and enabled 
>> by default, it would be nice if you could follow Intel's 
>> recommendations.
>
> kvm isn't enabled by default.  It requires explicit user action to 
> enter vmx mode ('modprobe kvm-intel').
>
>


-- 
Kind regards / mit freundlichen Gruessen / Met vriendelijke groet
   Sander van Leeuwen
 
innoTek GmbH
sandervl-2taLTamkYL2ELgA04lAiVw@public.gmane.org
http://www.innotek.de
Germany



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
       [not found]                 ` <46D9A030.1020904-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
@ 2007-09-01 17:46                   ` Alexey Eremenko
  2007-09-01 18:42                   ` Avi Kivity
  1 sibling, 0 replies; 22+ messages in thread
From: Alexey Eremenko @ 2007-09-01 17:46 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Sander wrote:
>I'd like to make clear that we are talking about the situation where kvm
is *not* being used by any application.

So, basically I can't use different virtualizers at the same time. Too bad...

-- 
-Alexey Eremenko "Technologov"

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
       [not found]                 ` <46D9A030.1020904-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
  2007-09-01 17:46                   ` Alexey Eremenko
@ 2007-09-01 18:42                   ` Avi Kivity
       [not found]                     ` <46D9B297.5070502-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  1 sibling, 1 reply; 22+ messages in thread
From: Avi Kivity @ 2007-09-01 18:42 UTC (permalink / raw)
  To: Sander van Leeuwen; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Sander van Leeuwen wrote:
> Avi,
>
> I'd like to make clear that we are talking about the situation where 
> kvm is *not* being used by any application.
>
> It's my understanding that in some (many?) distributions kvm is 
> actually active on a permanent basis. I can't say whether this was done
> by default or explicitly by the user. There is however no need to 
> activate vmx root mode when there is no client program that is using
> the kvm extension.
>
> From your comments I understand that you enable vmx root mode when the 
> kvm module is loaded. Regardless of whether an application
> actually wishes to use the kvm extension.

Yes.  The assumption is that if kvm is loaded, then there is an intent 
to use it.  This is similar to an ethernet device being claimed by the 
driver that supports it, even if no application actually uses that 
network interface.

We could change kvm to only claim vmx on first use, but that would 
reduce reliability.

My position is that:
- if you with to run something that conflicts with kvm enabling vmx, you 
should unload kvm, or not load it in the first place.  This is not a 
difficult operation.
- if you have an issue with distributions enabling kvm by default, then 
talk to these distributions.  kvm itself does not enable vmx by default.

>
>
>
>
> Avi Kivity wrote:
>> Sander van Leeuwen wrote:
>>> Hi Avi,
>>>
>>> Our non-vmx mode fails, because the cpu is in vmx root mode.
>>>
>>> Two products that use vt-x for virtualization could perfectly 
>>> co-exist if both comply with the way Intel recommends people to use 
>>> vt-x.
>>> See figure 19.1 in chapter 19.4 of the 'Intel 64 and IA-32 
>>> Architectures Software Developer's Manual'. VirtualBox is programmed to
>>> follow these rules and therefor allows any other virtualizer to run 
>>> side-by-side.
>>
>> As far as I understand, kvm follows these rules.  It enables vmx when 
>> loaded and disables then when unloaded.
>>
>>>
>>> Currently KVM prevents us from using our generic virtualization 
>>> engine and does not allow anybody else to use the vt-x extensions 
>>> (without
>>> explicitely leaving vmx root mode).
>>
>> Well, obviously kvm can't operate if you disable cr4.vmxe and/or 
>> switch paging off.  The two solutions are not run-time compatible.  I 
>> don't see why this is a problem as you should simply not run the 
>> product you aren't using, and everything should just work.
>>
>>>
>>> As your product is included in the mainline Linux kernel and enabled 
>>> by default, it would be nice if you could follow Intel's 
>>> recommendations.
>>
>> kvm isn't enabled by default.  It requires explicit user action to 
>> enter vmx mode ('modprobe kvm-intel').
>>
>>
>
>


-- 
Any sufficiently difficult bug is indistinguishable from a feature.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
       [not found]                     ` <46D9B297.5070502-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-09-03  3:14                       ` Daniel P. Berrange
       [not found]                         ` <20070903031403.GA16190-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: Daniel P. Berrange @ 2007-09-03  3:14 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Sander van Leeuwen

On Sat, Sep 01, 2007 at 09:42:31PM +0300, Avi Kivity wrote:
> Sander van Leeuwen wrote:
> > Avi,
> >
> > I'd like to make clear that we are talking about the situation where 
> > kvm is *not* being used by any application.
> >
> > It's my understanding that in some (many?) distributions kvm is 
> > actually active on a permanent basis. I can't say whether this was done
> > by default or explicitly by the user. There is however no need to 
> > activate vmx root mode when there is no client program that is using
> > the kvm extension.
> >
> > From your comments I understand that you enable vmx root mode when the 
> > kvm module is loaded. Regardless of whether an application
> > actually wishes to use the kvm extension.
> 
> Yes.  The assumption is that if kvm is loaded, then there is an intent 
> to use it.  This is similar to an ethernet device being claimed by the 
> driver that supports it, even if no application actually uses that 
> network interface.
> 
> We could change kvm to only claim vmx on first use, but that would 
> reduce reliability.
> 
> My position is that:
> - if you with to run something that conflicts with kvm enabling vmx, you 
> should unload kvm, or not load it in the first place.  This is not a 
> difficult operation.
> - if you have an issue with distributions enabling kvm by default, then 
> talk to these distributions.  kvm itself does not enable vmx by default.

So with my distributor / maintainer hat on...

In Fedora we enable KVM kernel modules by default because upstream LKML has
decided that KVM is the standard for exposing hardware virt capabilities from
the kernel to userspace. Asking the user to choose which kernel modules they 
load for virt is not really at all pratical because most users do not have 
the neccessary knowledge to be able to make an informed decision on this 
question. For this reason, in Fedora our general policy is to evaluate the
options provided in the /upstream/ kernel, identify the best driver for any
particular hardware capability & enable it by default. Thus KVM kernel mods
are enabled by default if you install the KVM userspace.

While one could in theory change KVM to only activate VMX when a guest is
started this wouldn't give a significant improvement to the user experiance.
Instead of being able to rely on KVM working, it now may or may not work 
depending on whether you happen to have a VirtualBox guest running or not &
vica-verca. You still would not be able to run guests from both concurrently
which should surely be the real goal. The only way I see the latter being
achieved is if VirtualBox were to leverage the existing KVM kernel APIs to
access the underlying hardware virt capabilities.

Regards,
Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
       [not found]                         ` <20070903031403.GA16190-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2007-09-03  7:29                           ` Sander van Leeuwen
       [not found]                             ` <46DBB7C1.60708-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: Sander van Leeuwen @ 2007-09-03  7:29 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Avi Kivity

Daniel P. Berrange wrote:
> While one could in theory change KVM to only activate VMX when a guest is
> started this wouldn't give a significant improvement to the user experiance.
> Instead of being able to rely on KVM working, it now may or may not work 
> depending on whether you happen to have a VirtualBox guest running or not &
> vica-verca. You still would not be able to run guests from both concurrently
> which should surely be the real goal. The only way I see the latter being
> achieved is if VirtualBox were to leverage the existing KVM kernel APIs to
> access the underlying hardware virt capabilities.
>   
You are mistaken. VT-x allows multiple clients to work concurrently. 
There's only one catch: all those
clients should follow certain guidelines.


-- 
Kind regards / mit freundlichen Gruessen / Met vriendelijke groet
  Sander van Leeuwen

innoTek GmbH
http://www.innotek.de
Germany 



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
       [not found]                             ` <46DBB7C1.60708-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
@ 2007-09-03  7:44                               ` Avi Kivity
       [not found]                                 ` <46DBBB65.3020406-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: Avi Kivity @ 2007-09-03  7:44 UTC (permalink / raw)
  To: Sander van Leeuwen; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Sander van Leeuwen wrote:
> Daniel P. Berrange wrote:
>> While one could in theory change KVM to only activate VMX when a
>> guest is
>> started this wouldn't give a significant improvement to the user
>> experiance.
>> Instead of being able to rely on KVM working, it now may or may not
>> work depending on whether you happen to have a VirtualBox guest
>> running or not &
>> vica-verca. You still would not be able to run guests from both
>> concurrently
>> which should surely be the real goal. The only way I see the latter
>> being
>> achieved is if VirtualBox were to leverage the existing KVM kernel
>> APIs to
>> access the underlying hardware virt capabilities.
>>   
> You are mistaken. VT-x allows multiple clients to work concurrently.
> There's only one catch: all those
> clients should follow certain guidelines.

Currently, kvm assumes that it is the only user that issues vmptrld
instructions.  There may me other such assumptions in the code.

There is also the question of who issues the vmxon/vmxoff instructions
and set the magic msr bits that enable kvm.  You can't have two
hypervisors doing that; that would be racy.  It should be possible to
abstract those bits out to something outside kvm, but I don't see that
happening.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
       [not found]                                 ` <46DBBB65.3020406-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-09-03  8:09                                   ` Sander van Leeuwen
       [not found]                                     ` <46DBC120.3050301-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: Sander van Leeuwen @ 2007-09-03  8:09 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f


[-- Attachment #1.1: Type: text/plain, Size: 1142 bytes --]

Avi Kivity wrote:
> Sander van Leeuwen wrote:
>   
>> You are mistaken. VT-x allows multiple clients to work concurrently.
>> There's only one catch: all those
>> clients should follow certain guidelines.
>>     
>
> Currently, kvm assumes that it is the only user that issues vmptrld
> instructions.  There may me other such assumptions in the code.
>
> There is also the question of who issues the vmxon/vmxoff instructions
> and set the magic msr bits that enable kvm.  You can't have two
> hypervisors doing that; that would be racy.  It should be possible to
> abstract those bits out to something outside kvm, but I don't see that
> happening.
>
>   
VirtualBox currently always executes vmxon when it wants to execute some 
guest code. When leaving
ring 0 it issues the corresponding vmxoff. While that may increase world 
switch overhead, it has not turned
out to be an issue for us. I think it's a bit risky to use somebody 
else's vmxon pointer.

You have a point with the msr updates though.


-- 
Kind regards / mit freundlichen Gruessen / Met vriendelijke groet
  Sander van Leeuwen

innoTek GmbH
http://www.innotek.de
Germany 


[-- Attachment #1.2: Type: text/html, Size: 1680 bytes --]

[-- Attachment #2: Type: text/plain, Size: 315 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

[-- Attachment #3: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
       [not found]                                     ` <46DBC120.3050301-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
@ 2007-09-03 11:34                                       ` Avi Kivity
       [not found]                                         ` <46DBF13B.9080005-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: Avi Kivity @ 2007-09-03 11:34 UTC (permalink / raw)
  To: Sander van Leeuwen; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Sander van Leeuwen wrote:
> Avi Kivity wrote:
>> Sander van Leeuwen wrote:
>>   
>>> You are mistaken. VT-x allows multiple clients to work concurrently.
>>> There's only one catch: all those
>>> clients should follow certain guidelines.
>>>     
>>
>> Currently, kvm assumes that it is the only user that issues vmptrld
>> instructions.  There may me other such assumptions in the code.
>>
>> There is also the question of who issues the vmxon/vmxoff instructions
>> and set the magic msr bits that enable kvm.  You can't have two
>> hypervisors doing that; that would be racy.  It should be possible to
>> abstract those bits out to something outside kvm, but I don't see that
>> happening.
>>
>>   
> VirtualBox currently always executes vmxon when it wants to execute 
> some guest code. When leaving
> ring 0 it issues the corresponding vmxoff. While that may increase 
> world switch overhead, it has not turned
> out to be an issue for us. 

The overhead will increase with newer hardware, as more state is cached 
on-chip.  It's probably okay when deploying to a desktop but i don't 
think it is good enough for a server.

> I think it's a bit risky to use somebody else's vmxon pointer.
>
> You have a point with the msr updates though. 

I think the easiest way forward is for you to unload kvm-intel (or 
kvm-amd) when you load, and to reload it when you unload.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
       [not found]                                         ` <46DBF13B.9080005-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-09-04  9:51                                           ` Sander van Leeuwen
       [not found]                                             ` <46DD2AA2.8010109-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: Sander van Leeuwen @ 2007-09-04  9:51 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Avi Kivity wrote:
>> I think it's a bit risky to use somebody else's vmxon pointer.
>>
>> You have a point with the msr updates though. 
> I think the easiest way forward is for you to unload kvm-intel (or 
> kvm-amd) when you load, and to reload it when you unload.
>
You may want to reconsider as KVM breaks VMWare server 1.3 on 64 bits 
linux hosts as well. In exactly the same way
as it breaks VirtualBox.

We have tried this ourselves and others have reported the same:
- http://www.vmware.com/community/message.jspa?messageID=718184
- http://www.redhat.com/archives/rhl-list/2007-June/msg02501.html


-- 
Kind regards / mit freundlichen Gruessen / Met vriendelijke groet
  Sander van Leeuwen

innoTek GmbH
http://www.innotek.de
Germany 



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
       [not found]                                             ` <46DD2AA2.8010109-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
@ 2007-09-04 13:55                                               ` Avi Kivity
       [not found]                                                 ` <46DD63B6.6050406-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  2007-09-04 14:02                                               ` Anthony Liguori
  1 sibling, 1 reply; 22+ messages in thread
From: Avi Kivity @ 2007-09-04 13:55 UTC (permalink / raw)
  To: Sander van Leeuwen; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Sander van Leeuwen wrote:
> Avi Kivity wrote:
>>> I think it's a bit risky to use somebody else's vmxon pointer.
>>>
>>> You have a point with the msr updates though. 
>> I think the easiest way forward is for you to unload kvm-intel (or 
>> kvm-amd) when you load, and to reload it when you unload.
>>
> You may want to reconsider as KVM breaks VMWare server 1.3 on 64 bits 
> linux hosts as well. In exactly the same way
> as it breaks VirtualBox.
>
> We have tried this ourselves and others have reported the same:
> - http://www.vmware.com/community/message.jspa?messageID=718184
> - http://www.redhat.com/archives/rhl-list/2007-June/msg02501.html
>

This is unsurprising.  But I believe the same solution (rmmod kvm-intel) 
will work for VMware as well as for VirtualBox, or anything else that 
wants to use VT.

Can you explain what is wrong with it?  It is simple, requires no kernel 
changes, and has no present and potential future performance impact.  It 
will work on all kernel versions, unlike any change you may wish us to make.

-- 
Any sufficiently difficult bug is indistinguishable from a feature.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
       [not found]                                             ` <46DD2AA2.8010109-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
  2007-09-04 13:55                                               ` Avi Kivity
@ 2007-09-04 14:02                                               ` Anthony Liguori
  2007-09-04 14:23                                                 ` Sander van Leeuwen
  1 sibling, 1 reply; 22+ messages in thread
From: Anthony Liguori @ 2007-09-04 14:02 UTC (permalink / raw)
  To: Sander van Leeuwen; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Avi Kivity

On Tue, 2007-09-04 at 11:51 +0200, Sander van Leeuwen wrote:
> Avi Kivity wrote:
> >> I think it's a bit risky to use somebody else's vmxon pointer.
> >>
> >> You have a point with the msr updates though. 
> > I think the easiest way forward is for you to unload kvm-intel (or 
> > kvm-amd) when you load, and to reload it when you unload.
> >
> You may want to reconsider as KVM breaks VMWare server 1.3 on 64 bits 
> linux hosts as well. In exactly the same way
> as it breaks VirtualBox.

Can VirtualBox and VMware server 1.3 on 64 bits run at the same time?

Regards,

Anthony Liguori

> We have tried this ourselves and others have reported the same:
> - http://www.vmware.com/community/message.jspa?messageID=718184
> - http://www.redhat.com/archives/rhl-list/2007-June/msg02501.html
> 
> 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
       [not found]                                                 ` <46DD63B6.6050406-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-09-04 14:16                                                   ` Sander van Leeuwen
       [not found]                                                     ` <46DD68A3.1060403-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: Sander van Leeuwen @ 2007-09-04 14:16 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Avi Kivity wrote:
> Sander van Leeuwen wrote:
>> You may want to reconsider as KVM breaks VMWare server 1.3 on 64 bits 
>> linux hosts as well. In exactly the same way
>> as it breaks VirtualBox.
>>
>> We have tried this ourselves and others have reported the same:
>> - http://www.vmware.com/community/message.jspa?messageID=718184
>> - http://www.redhat.com/archives/rhl-list/2007-June/msg02501.html
>>
>
> This is unsurprising.  But I believe the same solution (rmmod 
> kvm-intel) will work for VMware as well as for VirtualBox, or anything 
> else that wants to use VT.
>
> Can you explain what is wrong with it?  It is simple, requires no 
> kernel changes, and has no present and potential future performance 
> impact.  It will work on all kernel versions, unlike any change you 
> may wish us to make.
>
This was just an added note. More meant for distribution maintainers who 
feel it is necessary to activate KVM by default.


-- 
Kind regards / mit freundlichen Gruessen / Met vriendelijke groet
  Sander van Leeuwen

innoTek GmbH
http://www.innotek.de
Germany 



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
  2007-09-04 14:02                                               ` Anthony Liguori
@ 2007-09-04 14:23                                                 ` Sander van Leeuwen
       [not found]                                                   ` <46DD6A59.9000104-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
  0 siblings, 1 reply; 22+ messages in thread
From: Sander van Leeuwen @ 2007-09-04 14:23 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f


[-- Attachment #1.1: Type: text/plain, Size: 924 bytes --]

Anthony Liguori wrote:
> On Tue, 2007-09-04 at 11:51 +0200, Sander van Leeuwen wrote:
>   
>> Avi Kivity wrote:
>>     
>>>> I think it's a bit risky to use somebody else's vmxon pointer.
>>>>
>>>> You have a point with the msr updates though. 
>>>>         
>>> I think the easiest way forward is for you to unload kvm-intel (or 
>>> kvm-amd) when you load, and to reload it when you unload.
>>>
>>>       
>> You may want to reconsider as KVM breaks VMWare server 1.3 on 64 bits 
>> linux hosts as well. In exactly the same way
>> as it breaks VirtualBox.
>>     
>
> Can VirtualBox and VMware server 1.3 on 64 bits run at the same time?
>
>   
In theory they can, although I haven't tried myself. We've heard from 
people that they managed to run
the 32 bits version side by side.



-- 
Kind regards / mit freundlichen Gruessen / Met vriendelijke groet
  Sander van Leeuwen

innoTek GmbH
http://www.innotek.de
Germany 


[-- Attachment #1.2: Type: text/html, Size: 1578 bytes --]

[-- Attachment #2: Type: text/plain, Size: 315 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

[-- Attachment #3: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
       [not found]                                                     ` <46DD68A3.1060403-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
@ 2007-09-04 14:29                                                       ` Avi Kivity
  0 siblings, 0 replies; 22+ messages in thread
From: Avi Kivity @ 2007-09-04 14:29 UTC (permalink / raw)
  To: Sander van Leeuwen; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Sander van Leeuwen wrote:
> Avi Kivity wrote:
>   
>> Sander van Leeuwen wrote:
>>     
>>> You may want to reconsider as KVM breaks VMWare server 1.3 on 64 bits 
>>> linux hosts as well. In exactly the same way
>>> as it breaks VirtualBox.
>>>
>>> We have tried this ourselves and others have reported the same:
>>> - http://www.vmware.com/community/message.jspa?messageID=718184
>>> - http://www.redhat.com/archives/rhl-list/2007-June/msg02501.html
>>>
>>>       
>> This is unsurprising.  But I believe the same solution (rmmod 
>> kvm-intel) will work for VMware as well as for VirtualBox, or anything 
>> else that wants to use VT.
>>
>> Can you explain what is wrong with it?  It is simple, requires no 
>> kernel changes, and has no present and potential future performance 
>> impact.  It will work on all kernel versions, unlike any change you 
>> may wish us to make.
>>
>>     
> This was just an added note. More meant for distribution maintainers who 
> feel it is necessary to activate KVM by default.
>   

Well, you still haven't explained what is wrong with my proposal.  Can 
we make some progress instead of walking in circles?

-- 
Any sufficiently difficult bug is indistinguishable from a feature.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: KVM & VMX root mode
       [not found]                                                   ` <46DD6A59.9000104-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
@ 2007-09-04 14:51                                                     ` Anthony Liguori
  0 siblings, 0 replies; 22+ messages in thread
From: Anthony Liguori @ 2007-09-04 14:51 UTC (permalink / raw)
  To: Sander van Leeuwen; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Tue, 2007-09-04 at 16:23 +0200, Sander van Leeuwen wrote:
> Anthony Liguori wrote: 
> In theory they can, although I haven't tried myself. We've heard from
> people that they managed to run
> the 32 bits version side by side. 

Only if VMware disables VMX root mode.  32 bit VMware doesn't use VT/SVM
by default IIUC.

Regards,

Anthony Liguori

> 
> 
> -- 
> Kind regards / mit freundlichen Gruessen / Met vriendelijke groet
>   Sander van Leeuwen
> 
> innoTek GmbH
> http://www.innotek.de
> Germany 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2007-09-04 14:51 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-31 13:02 KVM & VMX root mode Sander van Leeuwen
     [not found] ` <46D81156.8050100-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
2007-09-01 14:25   ` Avi Kivity
     [not found]     ` <46D97669.7050609-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-09-01 14:33       ` Alexey Eremenko
     [not found]         ` <7fac565a0709010733j2c3f58aav743949a3021a5c30-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-09-01 14:35           ` Avi Kivity
     [not found]             ` <46D9789B.9040001-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-09-01 14:44               ` Alexey Eremenko
2007-09-01 15:09       ` Sander van Leeuwen
     [not found]         ` <46D980C2.3040501-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
2007-09-01 15:59           ` Avi Kivity
     [not found]             ` <46D98C53.4070604-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-09-01 17:24               ` Sander van Leeuwen
     [not found]                 ` <46D9A030.1020904-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
2007-09-01 17:46                   ` Alexey Eremenko
2007-09-01 18:42                   ` Avi Kivity
     [not found]                     ` <46D9B297.5070502-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-09-03  3:14                       ` Daniel P. Berrange
     [not found]                         ` <20070903031403.GA16190-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2007-09-03  7:29                           ` Sander van Leeuwen
     [not found]                             ` <46DBB7C1.60708-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
2007-09-03  7:44                               ` Avi Kivity
     [not found]                                 ` <46DBBB65.3020406-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-09-03  8:09                                   ` Sander van Leeuwen
     [not found]                                     ` <46DBC120.3050301-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
2007-09-03 11:34                                       ` Avi Kivity
     [not found]                                         ` <46DBF13B.9080005-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-09-04  9:51                                           ` Sander van Leeuwen
     [not found]                                             ` <46DD2AA2.8010109-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
2007-09-04 13:55                                               ` Avi Kivity
     [not found]                                                 ` <46DD63B6.6050406-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-09-04 14:16                                                   ` Sander van Leeuwen
     [not found]                                                     ` <46DD68A3.1060403-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
2007-09-04 14:29                                                       ` Avi Kivity
2007-09-04 14:02                                               ` Anthony Liguori
2007-09-04 14:23                                                 ` Sander van Leeuwen
     [not found]                                                   ` <46DD6A59.9000104-2taLTamkYL2ELgA04lAiVw@public.gmane.org>
2007-09-04 14:51                                                     ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox