[v2,12/18] KVM: vVMX: rename label for post-enter_guest_mode consistency check
diff mbox series

Message ID 20180828160459.14093-13-sean.j.christopherson@intel.com
State New
Headers show
Series
  • KVM: nVMX: add option to perform early consistency checks via H/W
Related show

Commit Message

Sean Christopherson Aug. 28, 2018, 4:04 p.m. UTC
Rename 'fail' to 'consistency_check_vmexit_guest_mode' to make it more
obvious that it's simply a different entry point to the consitency
check VMExit path, whose purpose is unwind the updates done prior to
calling prepare_vmcs02.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 arch/x86/kvm/vmx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jim Mattson Sept. 20, 2018, 7:59 p.m. UTC | #1
On Tue, Aug 28, 2018 at 9:04 AM, Sean Christopherson
<sean.j.christopherson@intel.com> wrote:
> Rename 'fail' to 'consistency_check_vmexit_guest_mode' to make it more
> obvious that it's simply a different entry point to the consitency
> check VMExit path, whose purpose is unwind the updates done prior to
> calling prepare_vmcs02.
>
> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
> ---
>  arch/x86/kvm/vmx.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index ed0f9de50ff7..db4751c626ce 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -12616,7 +12616,7 @@ static int nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu,
>                 vcpu->arch.tsc_offset += vmcs12->tsc_offset;
>
>         if (prepare_vmcs02(vcpu, vmcs12, &exit_qual))
> -               goto fail;
> +               goto consistency_check_vmexit_guest_mode;
>
>         if (from_vmentry) {
>                 exit_reason = EXIT_REASON_MSR_LOAD_FAIL;
> @@ -12624,7 +12624,7 @@ static int nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu,
>                                                 vmcs12->vm_entry_msr_load_addr,
>                                                 vmcs12->vm_entry_msr_load_count);
>                 if (exit_qual)
> -                       goto fail;
> +                       goto consistency_check_vmexit_guest_mode;
>         } else {
>                 /*
>                  * The MMU is not initialized to point at the right entities yet and
> @@ -12644,7 +12644,7 @@ static int nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu,
>          */
>         return 0;
>
> -fail:
> +consistency_check_vmexit_guest_mode:

Perhaps vmentry_failure_vmexit or the like?

>         if (vmcs12->cpu_based_vm_exec_control & CPU_BASED_USE_TSC_OFFSETING)
>                 vcpu->arch.tsc_offset -= vmcs12->tsc_offset;
>         leave_guest_mode(vcpu);
> --
> 2.18.0
>

Patch
diff mbox series

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index ed0f9de50ff7..db4751c626ce 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -12616,7 +12616,7 @@  static int nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu,
 		vcpu->arch.tsc_offset += vmcs12->tsc_offset;
 
 	if (prepare_vmcs02(vcpu, vmcs12, &exit_qual))
-		goto fail;
+		goto consistency_check_vmexit_guest_mode;
 
 	if (from_vmentry) {
 		exit_reason = EXIT_REASON_MSR_LOAD_FAIL;
@@ -12624,7 +12624,7 @@  static int nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu,
 						vmcs12->vm_entry_msr_load_addr,
 						vmcs12->vm_entry_msr_load_count);
 		if (exit_qual)
-			goto fail;
+			goto consistency_check_vmexit_guest_mode;
 	} else {
 		/*
 		 * The MMU is not initialized to point at the right entities yet and
@@ -12644,7 +12644,7 @@  static int nested_vmx_enter_non_root_mode(struct kvm_vcpu *vcpu,
 	 */
 	return 0;
 
-fail:
+consistency_check_vmexit_guest_mode:
 	if (vmcs12->cpu_based_vm_exec_control & CPU_BASED_USE_TSC_OFFSETING)
 		vcpu->arch.tsc_offset -= vmcs12->tsc_offset;
 	leave_guest_mode(vcpu);