From patchwork Thu Aug 22 23:47:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 11110243 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7068E174A 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 5920223401 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?b?UmFkaW0gS3LEjW3DocWZ?= 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 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");