From patchwork Thu Feb 23 09:41:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haozhong Zhang X-Patchwork-Id: 9588003 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 185D460578 for ; Thu, 23 Feb 2017 09:43:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05CE428613 for ; Thu, 23 Feb 2017 09:43:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEE6728621; Thu, 23 Feb 2017 09:43:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B35AA28613 for ; Thu, 23 Feb 2017 09:43:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgpu5-0000Of-Tz; Thu, 23 Feb 2017 09:41:37 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgpu4-0000Na-EN for xen-devel@lists.xen.org; Thu, 23 Feb 2017 09:41:36 +0000 Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id 22/24-28994-F4EAEA85; Thu, 23 Feb 2017 09:41:35 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOLMWRWlGSWpSXmKPExsVywNxEW9d/3bo Ig2s7JS2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oz9b9pYCi6wVayYcImpgXE2axcjJ4eQQKXE 2nlLmUFsCQFeiSPLZrBC2H4Sc1cvYuxi5AKq6WWU2NI5H6yITUBfYsXjg2BFIgLSEtc+X2YEs ZkFqiUmTp8DZgsLuEpMujWXCcRmEVCVuDG7ia2LkYODV8BGYuuGXIj58hIXrp5iAQlzCthKzJ uYBnGOjcTDQ31sExh5FzAyrGJUL04tKkst0jXRSyrKTM8oyU3MzNE1NDDVy00tLk5MT81JTCr WS87P3cQIDAQGINjBeKvP+RCjJAeTkigv28p1EUJ8SfkplRmJxRnxRaU5qcWHGGU4OJQkeNPW AuUEi1LTUyvSMnOAIQmTluDgURLh5QNJ8xYXJOYWZ6ZDpE4x6nLcOH7gDZMQS15+XqqUOG8WS JEASFFGaR7cCFh8XGKUlRLmZQQ6SoinILUoN7MEVf4VozgHo5IwbwzIFJ7MvBK4Ta+AjmACOs LSeS3IESWJCCmpBsZuKTO2W7+4d27m7RHsqgnbvEzI+PAfo0W/14SJHdBZzHpt350X8orqnzg fPKj1VS5d0Vz0UWfPyudHGVc+uch6Rpl/bW/w9S26d63ruYRVhPRuLot8Fiwgulfe+oT46r4d s+Q1KyKbj+secrL1e2X0cl1Sx4YFS6t8OXcU/p/Eezdn7VWp/l4lluKMREMt5qLiRADbayCii gIAAA== X-Env-Sender: haozhong.zhang@intel.com X-Msg-Ref: server-12.tower-206.messagelabs.com!1487842892!50039680!2 X-Originating-IP: [192.55.52.43] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 8350 invoked from network); 23 Feb 2017 09:41:35 -0000 Received: from mga05.intel.com (HELO mga05.intel.com) (192.55.52.43) by server-12.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 23 Feb 2017 09:41:35 -0000 Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP; 23 Feb 2017 01:41:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,197,1484035200"; d="scan'208";a="69208000" Received: from hz-desktop.sh.intel.com (HELO localhost) ([10.239.159.133]) by fmsmga006.fm.intel.com with ESMTP; 23 Feb 2017 01:41:32 -0800 From: Haozhong Zhang To: xen-devel@lists.xen.org Date: Thu, 23 Feb 2017 17:41:17 +0800 Message-Id: <20170223094117.7212-3-haozhong.zhang@intel.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20170223094117.7212-1-haozhong.zhang@intel.com> References: <20170223094117.7212-1-haozhong.zhang@intel.com> Cc: Haozhong Zhang , Jan Beulich , Andrew Cooper Subject: [Xen-devel] [PATCH v2 3/3] x86/hvm: check HAP before enabling nested VMX X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The current implementation of nested VMX cannot work without HAP. Signed-off-by: Haozhong Zhang --- Cc: Jan Beulich Cc: Andrew Cooper --- xen/arch/x86/hvm/hvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 6621d62..b8db808 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -4123,7 +4123,7 @@ static int hvmop_set_param( * Remove the check below once we have * shadow-on-shadow. */ - if ( cpu_has_svm && !paging_mode_hap(d) && a.value ) + if ( (cpu_has_svm || cpu_has_vmx) && !paging_mode_hap(d) && a.value ) rc = -EINVAL; if ( a.value && d->arch.hvm_domain.params[HVM_PARAM_ALTP2M] )