]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
KVM: VMX: Disable VMX when system shutdown
authorSheng Yang <sheng@linux.intel.com>
Wed, 29 Apr 2009 03:09:04 +0000 (11:09 +0800)
committerAvi Kivity <avi@redhat.com>
Thu, 30 Apr 2009 12:29:16 +0000 (15:29 +0300)
Intel TXT(Trusted Execution Technology) required VMX off for all cpu to work
when system shutdown.

CC: Joseph Cihula <joseph.cihula@intel.com>
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
virt/kvm/kvm_main.c

index 3265566d757c05adb0223ac4aea8a52f735e235a..2b73e1902b3e3f1aede90ba333dfd4dbfb0fa30f 100644 (file)
@@ -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;
 }