From patchwork Wed Apr 29 03:09:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 20552 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3T39Glg015437 for ; Wed, 29 Apr 2009 03:09:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753902AbZD2DJD (ORCPT ); Tue, 28 Apr 2009 23:09:03 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753397AbZD2DJC (ORCPT ); Tue, 28 Apr 2009 23:09:02 -0400 Received: from mga09.intel.com ([134.134.136.24]:6567 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753360AbZD2DJA (ORCPT ); Tue, 28 Apr 2009 23:09:00 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 28 Apr 2009 19:59:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.40,264,1239001200"; d="scan'208";a="510814289" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.13.147]) by orsmga001.jf.intel.com with ESMTP; 28 Apr 2009 20:08:19 -0700 Received: from yasker by syang10-desktop with local (Exim 4.69) (envelope-from ) id 1Lz0AS-0004sl-FV; Wed, 29 Apr 2009 11:09:04 +0800 From: Sheng Yang To: Avi Kivity Cc: kvm@vger.kernel.org, Sheng Yang , Joseph Cihula Subject: [PATCH] KVM: VMX: Disable VMX when system shutdown Date: Wed, 29 Apr 2009 11:09:04 +0800 Message-Id: <1240974544-18744-1-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.6.0.4 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Intel TXT(Trusted Execution Technology) required VMX off for all cpu to work when system shutdown. CC: Joseph Cihula Signed-off-by: Sheng Yang --- virt/kvm/kvm_main.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 3265566..2b73e19 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; }