From patchwork Fri Dec 16 13:43:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haozhong Zhang X-Patchwork-Id: 9477919 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 EAD8660827 for ; Fri, 16 Dec 2016 13:47:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF28A2883C for ; Fri, 16 Dec 2016 13:47:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D3CDD2885F; Fri, 16 Dec 2016 13:47:00 +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 96EA82883C for ; Fri, 16 Dec 2016 13:47:00 +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 1cHsof-00064C-3A; Fri, 16 Dec 2016 13:44:53 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cHsod-00061q-Sn for xen-devel@lists.xenproject.org; Fri, 16 Dec 2016 13:44:51 +0000 Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id 30/7A-01392-3DFE3585; Fri, 16 Dec 2016 13:44:51 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrGLMWRWlGSWpSXmKPExsVywNxEW/fS++A IgxPfFCy+b5nM5MDocfjDFZYAxijWzLyk/IoE1owHk1ezFVzkqGh7ldHAeIuti5GDQ0igUmLB xqwuRk4OCQFeiSPLZrBC2H4Sk+/sYgexhQR6GSXOnQ0DsdkE9CVWPD4IViMioCRxb9VkJhCbW SBS4v6mw4wgtrCAv8SCFZvAelkEVCWunvrNBmLzCthJLDvymxFivrzEhaunWEBsTqD4heN7oM 6xlWjdrzGBkXcBI8MqRo3i1KKy1CJdQ2O9pKLM9IyS3MTMHF1DA2O93NTi4sT01JzEpGK95Pz cTYzAMGAAgh2M27Z7HmKU5GBSEuVdviM4QogvKT+lMiOxOCO+qDQntfgQowYHh8CVc3OnM0mx 5OXnpSpJ8K59B1QnWJSanlqRlpkDDFSYUgkOHiUR3ucgad7igsTc4sx0iNQpRkUpcd5OkIQAS CKjNA+uDRYdlxhlpYR5GYGOEuIpSC3KzSxBlX/FKM7BqCQMMYUnM68EbvoroMVMQIst5oEtLk lESEk1MJ46/vZHbNyBnseexfvLGq/cZ5+pWD5D52PAVbFjLnMXLput/udbbnJJsuOVD7Vtbq3 zBTXLv09i91znMF31+ek9lvqTcjwUDu66uZb9xsn0bxzqQXzP9VWXPgtLvH9YZapM/gpLptXf pjY+eh5TuK2sfE1+yZmqrFehwZGzRGbZf/9WLH4r66USS3FGoqEWc1FxIgDiaSwXiQIAAA== X-Env-Sender: haozhong.zhang@intel.com X-Msg-Ref: server-8.tower-31.messagelabs.com!1481895871!76565229!11 X-Originating-IP: [192.55.52.43] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26863 invoked from network); 16 Dec 2016 13:44:50 -0000 Received: from mga05.intel.com (HELO mga05.intel.com) (192.55.52.43) by server-8.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 16 Dec 2016 13:44:50 -0000 Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP; 16 Dec 2016 05:44:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,357,1477983600"; d="scan'208";a="43260511" Received: from hz-desktop.sh.intel.com (HELO localhost) ([10.239.159.148]) by fmsmga005.fm.intel.com with ESMTP; 16 Dec 2016 05:44:48 -0800 From: Haozhong Zhang To: xen-devel@lists.xenproject.org Date: Fri, 16 Dec 2016 21:43:43 +0800 Message-Id: <20161216134348.16236-12-haozhong.zhang@intel.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161216134348.16236-1-haozhong.zhang@intel.com> References: <20161216134348.16236-1-haozhong.zhang@intel.com> Cc: Andrew Cooper , Haozhong Zhang Subject: [Xen-devel] [XTF PATCH 11/16] vvmx: test vmxon with bit 31 of VMCS revision ID set 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 VMfailInvalid is expected in this test. Signed-off-by: Haozhong Zhang --- tests/vvmx/vmxon.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/vvmx/vmxon.c b/tests/vvmx/vmxon.c index 75b6dcb..268baa8 100644 --- a/tests/vvmx/vmxon.c +++ b/tests/vvmx/vmxon.c @@ -118,6 +118,22 @@ static bool test_vmxon_mismatched_revid(void) VMXERR_VMFAIL_INVALID, 0, 0); } +/** + * vmxon with VMCS revision ID[31] set + * + * Expect: VMfailInvalid + */ +static bool test_vmxon_revid_bit31(void) +{ + clear_vmcs(vmxon_region, get_vmcs_revid() | (1UL << 31)); + + exinfo_t fault; + uint8_t ret = vmxon((uint64_t)vmxon_region, &fault); + + return handle_vmxinsn_err(__func__, ret, fault, + VMXERR_VMFAIL_INVALID, 0, 0); +} + bool test_vmxon(void) { if ( !test_vmxon_novmxe() ) @@ -138,6 +154,9 @@ bool test_vmxon(void) if ( !test_vmxon_mismatched_revid() ) return false; + if ( !test_vmxon_revid_bit31() ) + return false; + return true; }