From patchwork Thu Apr 4 14:42:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Druzhinin X-Patchwork-Id: 10885709 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 14AB213B5 for ; Thu, 4 Apr 2019 14:44:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0047028A9C for ; Thu, 4 Apr 2019 14:44:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8BBF28AAB; Thu, 4 Apr 2019 14:44:12 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 976F228A9C for ; Thu, 4 Apr 2019 14:44:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hC3ZP-0006eG-3h; Thu, 04 Apr 2019 14:42:23 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hC3ZO-0006eB-7h for xen-devel@lists.xenproject.org; Thu, 04 Apr 2019 14:42:22 +0000 X-Inumbo-ID: d87c51bc-56e7-11e9-8ab9-e7f4e7b3ace6 Received: from SMTP03.CITRIX.COM (unknown [162.221.156.55]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id d87c51bc-56e7-11e9-8ab9-e7f4e7b3ace6; Thu, 04 Apr 2019 14:42:18 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.60,308,1549929600"; d="scan'208";a="82752959" From: Igor Druzhinin To: Date: Thu, 4 Apr 2019 15:42:09 +0100 Message-ID: <1554388929-20127-1-git-send-email-igor.druzhinin@citrix.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86/vmx: Fixup removals from MSR load-lists X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Igor Druzhinin , kevin.tian@intel.com, wei.liu2@citrix.com, jbeulich@suse.com, andrew.cooper3@citrix.com, jun.nakajima@intel.com, roger.pau@citrix.com Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Commit fd32dcfe ("x86/vmx: Don't leak EFER.NXE into guest context") introduced a regression on Harpertown and earlier cores (Gen 1 VT-x) where as soon as guest EFER becomes equal to Xen EFER (almost any 64-bit VM) stale version of EFER is incorrectly loaded into a guest causing almost immediate guest failure. Signed-off-by: Igor Druzhinin Reviewed-by: Andrew Cooper Reviewed-by: Jan Beulich Acked-by: Kevin Tian --- I assume this is a candidate for backporting to stable-4.12. --- xen/arch/x86/hvm/vmx/vmcs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c index 74f2a08..45d1849 100644 --- a/xen/arch/x86/hvm/vmx/vmcs.c +++ b/xen/arch/x86/hvm/vmx/vmcs.c @@ -1490,15 +1490,15 @@ int vmx_del_msr(struct vcpu *v, uint32_t msr, enum vmx_msr_list_type type) switch ( type ) { case VMX_MSR_HOST: - __vmwrite(VM_EXIT_MSR_LOAD_COUNT, vmx->host_msr_count--); + __vmwrite(VM_EXIT_MSR_LOAD_COUNT, --vmx->host_msr_count); break; case VMX_MSR_GUEST: - __vmwrite(VM_EXIT_MSR_STORE_COUNT, vmx->msr_save_count--); + __vmwrite(VM_EXIT_MSR_STORE_COUNT, --vmx->msr_save_count); /* Fallthrough */ case VMX_MSR_GUEST_LOADONLY: - __vmwrite(VM_ENTRY_MSR_LOAD_COUNT, vmx->msr_load_count--); + __vmwrite(VM_ENTRY_MSR_LOAD_COUNT, --vmx->msr_load_count); break; }