KVM Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] KVM: nVMX: use correct clean fields when copying from eVMCS
@ 2019-06-13 11:35 Vitaly Kuznetsov
  2019-06-13 16:29 ` Radim Krčmář
  0 siblings, 1 reply; 2+ messages in thread
From: Vitaly Kuznetsov @ 2019-06-13 11:35 UTC (permalink / raw)
  To: kvm; +Cc: linux-kernel, Paolo Bonzini, Radim Krčmář

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 <vkuznets@redhat.com>
---
 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: nVMX: use correct clean fields when copying from eVMCS
  2019-06-13 11:35 [PATCH] KVM: nVMX: use correct clean fields when copying from eVMCS Vitaly Kuznetsov
@ 2019-06-13 16:29 ` Radim Krčmář
  0 siblings, 0 replies; 2+ messages in thread
From: Radim Krčmář @ 2019-06-13 16:29 UTC (permalink / raw)
  To: Vitaly Kuznetsov; +Cc: kvm, linux-kernel, Paolo Bonzini

2019-06-13 13:35+0200, Vitaly Kuznetsov:
> 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 <vkuznets@redhat.com>
> ---

Reviewed-by: Radim Krčmář <rkrcmar@redhat.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-13 11:35 [PATCH] KVM: nVMX: use correct clean fields when copying from eVMCS Vitaly Kuznetsov
2019-06-13 16:29 ` Radim Krčmář

KVM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kvm/0 kvm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kvm kvm/ https://lore.kernel.org/kvm \
		kvm@vger.kernel.org kvm@archiver.kernel.org
	public-inbox-index kvm


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.kvm


AGPL code for this site: git clone https://public-inbox.org/ public-inbox