From: Sheng Yang Date: Wed, 29 Apr 2009 03:09:04 +0000 (+0800) Subject: KVM: VMX: Disable VMX when system shutdown X-Git-Tag: v2.6.31-rc1~393^2~37 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=8e1c18157d8772e65247ac55525a05a26b83fffe;p=~shefty%2Frdma-dev.git KVM: VMX: Disable VMX when system shutdown Intel TXT(Trusted Execution Technology) required VMX off for all cpu to work when system shutdown. CC: Joseph Cihula Signed-off-by: Sheng Yang Signed-off-by: Avi Kivity --- diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 63d5fa2bc84..29c0afb064d 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -2391,15 +2391,15 @@ EXPORT_SYMBOL_GPL(kvm_handle_fault_on_reboot); static int kvm_reboot(struct notifier_block *notifier, unsigned long val, void *v) { - if (val == SYS_RESTART) { - /* - * Some (well, at least mine) BIOSes hang on reboot if - * in vmx root mode. - */ - printk(KERN_INFO "kvm: exiting hardware virtualization\n"); - kvm_rebooting = true; - on_each_cpu(hardware_disable, NULL, 1); - } + /* + * Some (well, at least mine) BIOSes hang on reboot if + * in vmx root mode. + * + * And Intel TXT required VMX off for all cpu when system shutdown. + */ + printk(KERN_INFO "kvm: exiting hardware virtualization\n"); + kvm_rebooting = true; + on_each_cpu(hardware_disable, NULL, 1); return NOTIFY_OK; }