Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7035775ybi; Thu, 13 Jun 2019 08:30:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgNPbPkwOfXdQjaLhOB1tRmrCHiMR/9iOYvnYlgzmasMEh5ssr+9NEYKDo/pJUnwTBWjeU X-Received: by 2002:a17:902:29a7:: with SMTP id h36mr36755019plb.158.1560439806193; Thu, 13 Jun 2019 08:30:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560439806; cv=none; d=google.com; s=arc-20160816; b=uCkdERVAcxGqz1XFhVDFKXr+TXMXGvQGiAwhoYiwMbJkXLuuJ+qGhtUx9PDAyN+Z1B 6B9QkmWUF7wYkFyzLG34qnLIpClmROn7rrMFO4bDEEXNQLzRK//WgMrmdUjDGVCdGsL/ C5bDQ+P/r/0uhLtk2C1IVg355vlNCBuBxzmcmo2rkY5/qjExWhNIl5Zo2MH8tLMC++ii txRTLqnTJYUpscqrbCJPo4xRIC3VBDkOR6NvcueXawU39tDexi/AjH3G0OlJNhmWH6Hp VYGAQhUlOT7CH7/nQdA7bXgGIHf0L3IDo2r0VSU1u7+/8cRwWqMYqaHmQq9N3df3JLzV fW9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Z2iEY8EXmuNn/XfjspU+26QgiuDL4OWuuAC08QYIIFM=; b=zRpivlv/vl2QKa2gkKl6Ul7nZIGiFaVmHxqQ3lmLTf74irFkMF1u2TPEL22+NB+ny5 qhdfCKCjCon4K5dehlP+klmSgYTGR/bTAkEW3kUVzzA+yQAnjigM1X/xV3fSkRkcL+14 KLk/njiXpP5TsMbgvFTh0HXDgJ1rVojDnja0iO0kaJq2nVBWtatAsSQLemVP/36oQwSU M3Wpm4CyUL4Hd+y8eyWZclAD3UZfwIJnXqXhp202BqUWX2yPlWNSVGgvdhXamL4b3pD4 8+/nzWl/G11Ty/AH6SPEaxXA4U2aO5unJ+93qdsY/7hAuqjNEJtDJbOIJLVCbYDRAGl4 aiXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t4si3545046plb.188.2019.06.13.08.29.50; Thu, 13 Jun 2019 08:30:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729576AbfFMP1q (ORCPT + 99 others); Thu, 13 Jun 2019 11:27:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35152 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729011AbfFMLfG (ORCPT ); Thu, 13 Jun 2019 07:35:06 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 32CB26EB81; Thu, 13 Jun 2019 11:35:06 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.43.2.155]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0EBAC60FAB; Thu, 13 Jun 2019 11:35:04 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PATCH] KVM: nVMX: use correct clean fields when copying from eVMCS Date: Thu, 13 Jun 2019 13:35:02 +0200 Message-Id: <20190613113502.9535-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 13 Jun 2019 11:35:06 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Unfortunately, a couple of mistakes were made while implementing Enlightened VMCS support, in particular, wrong clean fields were used in copy_enlightened_to_vmcs12(): - exception_bitmap is covered by CONTROL_EXCPN; - vm_exit_controls/pin_based_vm_exec_control/secondary_vm_exec_control are covered by CONTROL_GRP1. Fixes: 945679e301ea0 ("KVM: nVMX: add enlightened VMCS state") Signed-off-by: Vitaly Kuznetsov --- arch/x86/kvm/vmx/nested.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c index 1032f068f0b9..d3940da3d435 100644 --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -1397,7 +1397,7 @@ static int copy_enlightened_to_vmcs12(struct vcpu_vmx *vmx) } if (unlikely(!(evmcs->hv_clean_fields & - HV_VMX_ENLIGHTENED_CLEAN_FIELD_CONTROL_PROC))) { + HV_VMX_ENLIGHTENED_CLEAN_FIELD_CONTROL_EXCPN))) { vmcs12->exception_bitmap = evmcs->exception_bitmap; } @@ -1437,7 +1437,7 @@ static int copy_enlightened_to_vmcs12(struct vcpu_vmx *vmx) } if (unlikely(!(evmcs->hv_clean_fields & - HV_VMX_ENLIGHTENED_CLEAN_FIELD_HOST_GRP1))) { + HV_VMX_ENLIGHTENED_CLEAN_FIELD_CONTROL_GRP1))) { vmcs12->pin_based_vm_exec_control = evmcs->pin_based_vm_exec_control; vmcs12->vm_exit_controls = evmcs->vm_exit_controls; -- 2.20.1