From patchwork Tue Jan 22 19:36:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krish Sadhukhan X-Patchwork-Id: 10776215 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 66DF0746 for ; Tue, 22 Jan 2019 20:01:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5770A2BA6C for ; Tue, 22 Jan 2019 20:01:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55C502BA9E; Tue, 22 Jan 2019 20:01:26 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03C162BA87 for ; Tue, 22 Jan 2019 20:01:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726127AbfAVUBY (ORCPT ); Tue, 22 Jan 2019 15:01:24 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:56802 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726015AbfAVUBY (ORCPT ); Tue, 22 Jan 2019 15:01:24 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x0MJsq3J027187; Tue, 22 Jan 2019 20:01:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=4jvMbmKH1pAI/w2IwGW7cpmxfhx0Ry5IHcpZNhp+k0E=; b=5kFbCF4AFhPI3uPmzkU0oQDhL46qSSMJ8tSnA2kg24J5JvZOJid29V6mFDSzmh/uZ7Em 4W2nLUMee2o8Cb4p9pdQ83Vno1dmu10yOTUM/35CvkZSSTA8DmrIg2UMw3sXk2lgYJz1 4RHKx8EPGYzIbUxnIOX5rCrRd1IKzfkMwiOXKOJGYQ9GMT0OW65gI1tE/+n8iCWN11eP NMRnUx9oQA7VnKs9NqBFplU8wGLkQyo4WkgXirUFtbsZL6d3/H3CGzPb+n9GwGhlBrp0 m8jbxZ/DUDQbCRmnYyc8e47MF0TQDzaghfan9KpdyWr2wXn8LEIyJbYevKt/wCf8uZ7r 7Q== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2q3vhrnrud-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 Jan 2019 20:01:18 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x0MK1GF9009934 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 Jan 2019 20:01:17 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x0MK1GX5026160; Tue, 22 Jan 2019 20:01:16 GMT Received: from ban25x6uut29.us.oracle.com (/10.153.73.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 22 Jan 2019 12:01:16 -0800 From: Krish Sadhukhan To: kvm@vger.kernel.org Cc: pbonzini@redhat.com, rkrcmar@redhat.com, jmattson@google.com Subject: [kvm-unit-test nVMX] If "enable EPT" is enabled in a test, EPT pointer must also be set up Date: Tue, 22 Jan 2019 14:36:29 -0500 Message-Id: <20190122193629.5937-1-krish.sadhukhan@oracle.com> X-Mailer: git-send-email 2.17.2 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9144 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=857 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901220149 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 2737c0410fa60eeaef8a7af0f8968be40cb1e9d9 move the check for EPT pointer, from nested_ept_get_cr3() to check_vmentry_prereqs(). As a result if "enabled EPT" is set in a test but EPT pointer is not, vmentry will fail even if EPT pointer is not being tested in that particular test. Signed-off-by: Krish Sadhukhan --- x86/vmx_tests.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c index ee0c9ff..1e987e6 100644 --- a/x86/vmx_tests.c +++ b/x86/vmx_tests.c @@ -4682,6 +4682,7 @@ static void test_ept_eptp(void) report_prefix_pop(); secondary |= CPU_EPT; + setup_ept(false); vmcs_write(CPU_EXEC_CTRL1, secondary); report_prefix_pushf("Enable-EPT enabled, unrestricted-guest enabled"); test_vmx_controls(true, false); @@ -4737,6 +4738,7 @@ static void test_pml(void) report_prefix_pop(); secondary |= CPU_EPT; + setup_ept(false); vmcs_write(CPU_EXEC_CTRL1, secondary); report_prefix_pushf("enable-PML enabled, enable-EPT enabled"); test_vmx_controls(true, false);