[PATCH] Activate Virtualization On Demand

2009-09-15 Thread Alexander Graf
X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from working (vmx) or using invalid TLB entries (svm). Currently KVM activates virtualization when the respective kernel

Re: [PATCH] Activate Virtualization On Demand

2009-09-14 Thread Marcelo Tosatti
On Wed, Sep 09, 2009 at 04:18:58PM +0200, Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from working (vmx) or using invalid TLB entries (svm).

Re: [PATCH] Activate Virtualization On Demand

2009-09-14 Thread Marcelo Tosatti
On Mon, Sep 14, 2009 at 05:52:48PM +0200, Alexander Graf wrote: On 14.09.2009, at 15:23, Marcelo Tosatti wrote: On Wed, Sep 09, 2009 at 04:18:58PM +0200, Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result

Re: [PATCH] Activate Virtualization On Demand

2009-09-14 Thread Alexander Graf
On 14.09.2009, at 18:14, Marcelo Tosatti wrote: On Mon, Sep 14, 2009 at 05:52:48PM +0200, Alexander Graf wrote: On 14.09.2009, at 15:23, Marcelo Tosatti wrote: On Wed, Sep 09, 2009 at 04:18:58PM +0200, Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the

Re: [PATCH] Activate Virtualization On Demand

2009-09-14 Thread Marcelo Tosatti
On Mon, Sep 14, 2009 at 06:25:20PM +0200, Alexander Graf wrote: having succeeded. The hardware_enable_all caller calls hardware_disable_all (kvm_usage_count--) when enabling fails. But it does not hold any lock in between hardware_enable_all and hardware_disable_all. So its unsafe if

Re: [PATCH] Activate Virtualization On Demand

2009-09-14 Thread Alexander Graf
On 14.09.2009, at 18:46, Marcelo Tosatti wrote: On Mon, Sep 14, 2009 at 06:25:20PM +0200, Alexander Graf wrote: having succeeded. The hardware_enable_all caller calls hardware_disable_all (kvm_usage_count--) when enabling fails. But it does not hold any lock in between hardware_enable_all

Re: [PATCH] Activate Virtualization On Demand

2009-09-14 Thread Alexander Graf
On 14.09.2009, at 15:23, Marcelo Tosatti wrote: On Wed, Sep 09, 2009 at 04:18:58PM +0200, Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from

Re: [PATCH] Activate Virtualization On Demand

2009-09-13 Thread Avi Kivity
On 09/09/2009 05:18 PM, Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from working (vmx) or using invalid TLB entries (svm). Currently KVM

[PATCH] Activate Virtualization On Demand

2009-09-09 Thread Alexander Graf
X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from working (vmx) or using invalid TLB entries (svm). Currently KVM activates virtualization when the respective kernel

Re: [PATCH] Activate Virtualization On Demand v2

2009-06-18 Thread Avi Kivity
On 06/18/2009 12:56 AM, Alexander Graf wrote: I can test suspend/resume for you if you don't have a friendly machine. I have a personal interest in keeping it working :) Thinking about it again - there's only the atomic dec_and_test vs. read thing and the suspend test missing. Is the

Re: [PATCH] Activate Virtualization On Demand v2

2009-06-17 Thread Alexander Graf
On 16.06.2009, at 17:13, Avi Kivity wrote: On 06/16/2009 05:08 PM, Alexander Graf wrote: Please tell me you tested suspend/resume with/without VMs and cpu hotunplug/hotplug. I tested cpu hotplugging. On the last round I tested suspend/ resume, but this time I couldn't because my machine

Re: [PATCH] Activate Virtualization On Demand v2

2009-06-16 Thread Avi Kivity
On 06/15/2009 02:30 PM, Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from working (vmx) or using invalid TLB entries (svm). Currently KVM

Re: [PATCH] Activate Virtualization On Demand v2

2009-06-16 Thread Avi Kivity
On 06/15/2009 03:17 PM, Christoph Hellwig wrote: On Mon, Jun 15, 2009 at 01:30:05PM +0200, Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from

Re: [PATCH] Activate Virtualization On Demand v2

2009-06-16 Thread Alexander Graf
Avi Kivity wrote: On 06/15/2009 02:30 PM, Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from working (vmx) or using invalid TLB entries (svm).

Re: [PATCH] Activate Virtualization On Demand v2

2009-06-16 Thread Avi Kivity
On 06/16/2009 05:08 PM, Alexander Graf wrote: Please tell me you tested suspend/resume with/without VMs and cpu hotunplug/hotplug. I tested cpu hotplugging. On the last round I tested suspend/resume, but this time I couldn't because my machine can't do suspend :-(. So I'll try hard and

[PATCH] Activate Virtualization On Demand v2

2009-06-15 Thread Alexander Graf
X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from working (vmx) or using invalid TLB entries (svm). Currently KVM activates virtualization when the respective kernel

Re: [PATCH] Activate Virtualization On Demand v2

2009-06-15 Thread Christoph Hellwig
On Mon, Jun 15, 2009 at 01:30:05PM +0200, Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from working (vmx) or using invalid TLB entries (svm).

Re: [PATCH] Activate Virtualization On Demand v2

2009-06-15 Thread Alexander Graf
On 15.06.2009, at 14:17, Christoph Hellwig wrote: On Mon, Jun 15, 2009 at 01:30:05PM +0200, Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from

Re: [PATCH] Activate Virtualization On Demand v2

2009-06-15 Thread Christoph Hellwig
On Mon, Jun 15, 2009 at 02:25:01PM +0200, Alexander Graf wrote: I don't want to fight political battles here. So stop that crap. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at

[PATCH] Activate Virtualization On Demand

2009-03-17 Thread Alexander Graf
X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from working (vmx) or using invalid TLB entries (svm). Currently KVM activates virtualization when the respective kernel

Re: [PATCH] Activate Virtualization On Demand

2009-03-17 Thread Avi Kivity
Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from working (vmx) or using invalid TLB entries (svm). Currently KVM activates virtualization when

Re: [PATCH] Activate Virtualization On Demand

2009-03-17 Thread Alexander Graf
On 17.03.2009, at 13:04, Avi Kivity a...@redhat.com wrote: Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from working (vmx) or using invalid

Re: [PATCH] Activate Virtualization On Demand v3

2008-11-06 Thread Alexander Graf
On 05.11.2008, at 21:58, Eduardo Habkost wrote: On Wed, Nov 05, 2008 at 11:41:04AM +0100, Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from

[PATCH] Activate Virtualization On Demand v2

2008-11-05 Thread Alexander Graf
X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from working (vmx) or using invalid TLB entries (svm). Currently KVM activates virtualization when the respective kernel

Re: [PATCH] Activate Virtualization On Demand v2

2008-11-05 Thread Avi Kivity
Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from working (vmx) or using invalid TLB entries (svm). Currently KVM activates virtualization when

Re: [PATCH] Activate Virtualization On Demand v2

2008-11-05 Thread Daniel P. Berrange
On Wed, Nov 05, 2008 at 09:48:16AM +0100, Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from working (vmx) or using invalid TLB entries (svm).

Re: [PATCH] Activate Virtualization On Demand v2

2008-11-05 Thread Alexander Graf
Daniel P. Berrange wrote: On Wed, Nov 05, 2008 at 09:48:16AM +0100, Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from working (vmx) or using

Re: [PATCH] Activate Virtualization On Demand v2

2008-11-05 Thread Alexander Graf
Avi Kivity wrote: Alexander Graf wrote: We'll be in a nice fix if we can only enable virtualization on some processors; that's the reason hardware_enable() was originally specified as returning void. I don't see an easy way out, but it's hardly a likely event. I don't think

Re: [PATCH] Activate Virtualization On Demand v2

2008-11-05 Thread Avi Kivity
Alexander Graf wrote: We'll be in a nice fix if we can only enable virtualization on some processors; that's the reason hardware_enable() was originally specified as returning void. I don't see an easy way out, but it's hardly a likely event. I don't think there's any way we can

Re: [PATCH] Activate Virtualization On Demand v2

2008-11-05 Thread Alexander Graf
Avi Kivity wrote: Alexander Graf wrote: [snip] static int kvm_resume(struct sys_device *dev) { -hardware_enable(NULL); +if (atomic_read(kvm_usage_count)) +hardware_enable(NULL); return 0; } Move the test to hardware_enable()? It's repeated too often.

Re: [PATCH] Activate Virtualization On Demand v2

2008-11-05 Thread Alexander Graf
Avi Kivity wrote: Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from working (vmx) or using invalid TLB entries (svm). Currently KVM activates

Re: [PATCH] Activate Virtualization On Demand v3

2008-11-05 Thread Alexander Graf
Avi Kivity wrote: Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from working (vmx) or using invalid TLB entries (svm). Currently KVM activates

Re: [PATCH] Activate Virtualization On Demand v2

2008-11-05 Thread Christian Borntraeger
Am Mittwoch, 5. November 2008 schrieb Alexander Graf: printk(KERN_INFO kvm: disabling virtualization on CPU%d\n, cpu); [...] printk(KERN_INFO kvm: disabling virtualization on CPU%d\n, cpu); [...]

Re: [PATCH] Activate Virtualization On Demand v2

2008-11-05 Thread Avi Kivity
Christian Borntraeger wrote: When you are at it, could move these printk to the arches that atually enable/disable virtualization? For example you could do something like if (callback) { printk ...; callback(); } And then you could remove kvm_arch_hardware_enable/disable

Re: [PATCH] Activate Virtualization On Demand v2

2008-11-05 Thread Alexander Graf
Zhang, Xiantao wrote: Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from working (vmx) or using invalid TLB entries (svm). Currently

Re: [PATCH] Activate Virtualization On Demand v3

2008-11-05 Thread Avi Kivity
Alexander Graf wrote: In any case, I'll defer applying until Eduardo's kdump/reboot changes go in, since they touch the same places, and Eduardo's changes are much harder to test. I agree. Apart from that, do I get an ACK for it, so I can at least put it into our package and rest assured

Re: [PATCH] Activate Virtualization On Demand v3

2008-11-05 Thread Avi Kivity
Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from working (vmx) or using invalid TLB entries (svm). Currently KVM activates virtualization when

Re: [PATCH] Activate Virtualization On Demand v3

2008-11-05 Thread Eduardo Habkost
On Wed, Nov 05, 2008 at 11:41:04AM +0100, Alexander Graf wrote: X86 CPUs need to have some magic happening to enable the virtualization extensions on them. This magic can result in unpleasant results for users, like blocking other VMMs from working (vmx) or using invalid TLB entries (svm).