Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73A93C3A5A1 for ; Thu, 22 Aug 2019 23:47:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 50182233A0 for ; Thu, 22 Aug 2019 23:47:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727347AbfHVXrr (ORCPT ); Thu, 22 Aug 2019 19:47:47 -0400 Received: from mga17.intel.com ([192.55.52.151]:15676 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727330AbfHVXrr (ORCPT ); Thu, 22 Aug 2019 19:47:47 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 16:47:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,419,1559545200"; d="scan'208";a="203589304" Received: from sjchrist-coffee.jf.intel.com ([10.54.74.41]) by fmsmga004.fm.intel.com with ESMTP; 22 Aug 2019 16:47:47 -0700 From: Sean Christopherson To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Cc: kvm@vger.kernel.org, Krish Sadhukhan Subject: [kvm-unit-tests PATCH] x86: Skip EPT tests that involve unrestricted guest when URG is disabled Date: Thu, 22 Aug 2019 16:47:46 -0700 Message-Id: <20190822234746.3379-1-sean.j.christopherson@intel.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Cc: Krish Sadhukhan Fixes: f749ddc19bb2d ("nVMX x86: Check enable-EPT on vmentry of L2 guests") Signed-off-by: Sean Christopherson --- x86/vmx_tests.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c index 9078665..f035f24 100644 --- a/x86/vmx_tests.c +++ b/x86/vmx_tests.c @@ -4797,6 +4797,9 @@ static void test_ept_eptp(void) test_vmx_valid_controls(false); report_prefix_pop(); + if (!(ctrl_cpu_rev[1].clr & CPU_URG)) + goto skip_unrestricted_guest; + secondary |= CPU_URG; vmcs_write(CPU_EXEC_CTRL1, secondary); report_prefix_pushf("Enable-EPT disabled, unrestricted-guest enabled"); @@ -4809,6 +4812,7 @@ static void test_ept_eptp(void) test_vmx_valid_controls(false); report_prefix_pop(); +skip_unrestricted_guest: secondary &= ~CPU_URG; vmcs_write(CPU_EXEC_CTRL1, secondary); report_prefix_pushf("Enable-EPT enabled, unrestricted-guest disabled"); -- 2.22.0