Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp836954ybi; Fri, 12 Jul 2019 05:28:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzFx5AOTvvonS6rFScGHlKiXKnhduFY+kqabyqRwBgv1HnY0J0SfvzxmtZShLzPdHi06FiJ X-Received: by 2002:a63:ea50:: with SMTP id l16mr10755772pgk.160.1562934511253; Fri, 12 Jul 2019 05:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562934511; cv=none; d=google.com; s=arc-20160816; b=uiprMvTh7u7gUTuvz2HYXNkAkfbvY1zXpVVuT8wtK5btZncvcGI2TbLwJH/QAkElSJ b5RdAYuSAK31hSKsXyT9WbSvNriIu+IhLiJrm8Q//w7bDdyu+SP4xAvt2SZj3N/LIjgL 0kv/N+yyOwl/QM5tDBYOo+UAv1LBBIpmrRNwTDJ6XVzbngdhrfnG1yFPJ4y/5I6TgK7M fbUVIt79ZrKDb9XuZzOQVYuGUWUPIFfoi6wBQJwCtz7QZuZc2mz09rPJB4f8GIfhkrh8 AFfLFsPtpCTXeTIItfg+CrZuFjeH5ieamEZdM0lD6f/cbn5woma9DrhVpF00RJk+LkGb 5XnA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4mPCGhVMYgXP/zUFeoPQXTskPS1Ory2xvxhUENeDF9g=; b=FPEI/g13DuydLMQMvyIEAyJQPaDIafr44xuAENj7AomqBa+l8tQePEmpBpnJf1hEkA ulbqgHo+t4W56T6rTVv+Ng8nCpwxqBTgXBH7yi7IAoi6HZ73Akfa8hYokmaYfKkUKtNe Kk20XBmtaqs2bGRoBmEx5+O9o1aqfS4pgfK5LKFVrp7EYgwWEBzXRz7lNXywjBXrmgNe IlQf0V0ZtWv9oMtNXMgsjyRMiBw0dH8ljePw98+lQXf0HHea/gjF7UV7uEjFjne/852R sjqtDP0+MAjpPBqTU/LcUnwOLGO+7L1ApCdWWcmQUPN2xF8yqDnCOErMM8/XyNWHCzzV xtwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qa62tvIH; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b28si8732765pfp.92.2019.07.12.05.28.15; Fri, 12 Jul 2019 05:28:31 -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; dkim=pass header.i=@kernel.org header.s=default header.b=qa62tvIH; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728574AbfGLM1N (ORCPT + 99 others); Fri, 12 Jul 2019 08:27:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:39364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728557AbfGLM1N (ORCPT ); Fri, 12 Jul 2019 08:27:13 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A9CFA21019; Fri, 12 Jul 2019 12:27:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934432; bh=jxuRC5RWgmFE6A1v+sw6c/9f28Z+K+sY/u9/2MPqFmA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qa62tvIHtePOIGc6agk+V3uDD1Y+Fs8vQ9Zya1xMyf0m0BEU2pQr9g8UXkG2E8ySQ BOCJ8OWXuNwF83nqTy2UZEXYv0lGRhXQ+OrWQKNF4W6j4HzD1V4vDXiI+8iM2UXh6c kjfyZg9W10RRv96Z2AeBQ0hoq6gjMeAnJYfayLwQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vitaly Kuznetsov , Paolo Bonzini , Sasha Levin Subject: [PATCH 5.1 053/138] KVM: nVMX: use correct clean fields when copying from eVMCS Date: Fri, 12 Jul 2019 14:18:37 +0200 Message-Id: <20190712121630.701445555@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121628.731888964@linuxfoundation.org> References: <20190712121628.731888964@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit f9bc5227652df4900eff12a9b8b38e9a8c7c78ea ] 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 Signed-off-by: Paolo Bonzini Signed-off-by: Sasha Levin --- 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 5fa0c17d0b41..4ca834d22169 100644 --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -1404,7 +1404,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; } @@ -1444,7 +1444,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