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=-13.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 6B6CFC433E3 for ; Tue, 14 Jul 2020 00:23:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 483B221883 for ; Tue, 14 Jul 2020 00:23:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726907AbgGNAX6 (ORCPT ); Mon, 13 Jul 2020 20:23:58 -0400 Received: from mga02.intel.com ([134.134.136.20]:36936 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726345AbgGNAX5 (ORCPT ); Mon, 13 Jul 2020 20:23:57 -0400 IronPort-SDR: aHr1/x954aK0zHg6iIA5KAFzBxJRqiPPPKZcIbPD5ebpBApc6B3y3hshxwWhxVAGemE3kBLUMI Rg734929rTiw== X-IronPort-AV: E=McAfee;i="6000,8403,9681"; a="136910636" X-IronPort-AV: E=Sophos;i="5.75,349,1589266800"; d="scan'208";a="136910636" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2020 17:23:56 -0700 IronPort-SDR: n6qLgXD5LktAyl5QyGumIzqJHegV0PyYaCd/qlpxT+PNMct2ntuFhaLejSgpIuKtxCLEmtfF8N dTflf6+SalpQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,349,1589266800"; d="scan'208";a="268505778" Received: from sjchrist-coffee.jf.intel.com ([10.54.74.152]) by fmsmga007.fm.intel.com with ESMTP; 13 Jul 2020 17:23:56 -0700 From: Sean Christopherson To: Paolo Bonzini Cc: kvm@vger.kernel.org, Krish Sadhukhan , Karl Heubaum , Sean Christopherson , Oliver Upton , Jim Mattson Subject: [kvm-unit-tests PATCH 2/2] nVMX: Use the standard non-canonical value in test_mtf3 Date: Mon, 13 Jul 2020 17:23:55 -0700 Message-Id: <20200714002355.538-3-sean.j.christopherson@intel.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200714002355.538-1-sean.j.christopherson@intel.com> References: <20200714002355.538-1-sean.j.christopherson@intel.com> 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 Use the standard non-canonical value of repeating 'a' instead of a custom (1 << 63) value in test_mtf3. When PCID is enabled, bit 63 is a flag that controls TLB swithching on MOV CR3 and is not included in the canonical check of CR3, i.e. if CR4.PCIDE=1 then the test will load 0 into CR3 and all manner of confusion things happen. Fixes: 46cc038c6afb8 ("x86: VMX: Add tests for monitor trap flag") Cc: Oliver Upton Cc: Jim Mattson Signed-off-by: Sean Christopherson --- x86/vmx_tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c index cb42a2d..32e3d4f 100644 --- a/x86/vmx_tests.c +++ b/x86/vmx_tests.c @@ -5107,7 +5107,7 @@ static void test_mtf_guest(void) * MOV RAX is done before the VMCALL such that MTF is only enabled * for the instruction under test. */ - "mov $0x8000000000000000, %rax;\n\t" + "mov $0xaaaaaaaaaaaaaaaa, %rax;\n\t" "vmcall;\n\t" "mov %rax, %cr3;\n\t" "test_mtf3:\n\t" -- 2.26.0