diff mbox series

[1/7] KVM: nVMX: Prepend "nested_" to check_vmentry_{pre,post}reqs()

Message ID 20181117010154.10629-2-krish.sadhukhan@oracle.com (mailing list archive)
State New, archived
Headers show
Series [1/7] KVM: nVMX: Prepend "nested_" to check_vmentry_{pre,post}reqs() | expand

Commit Message

Krish Sadhukhan Nov. 17, 2018, 1:01 a.m. UTC
.. as they are used only in nested context.

Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Reviewed-by: Liran Alon <liran.alon@oracle.com>
Reviewed-by: Mihai Carabas <mihai.carabas@oracle.com>
Reviewed-by: Mark Kanda <mark.kanda@oracle.com>
---
 arch/x86/kvm/vmx.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Sean Christopherson Nov. 26, 2018, 4:55 p.m. UTC | #1
On Fri, Nov 16, 2018 at 08:01:48PM -0500, Krish Sadhukhan wrote:
> .. as they are used only in nested context.
> 
> Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
> Reviewed-by: Liran Alon <liran.alon@oracle.com>
> Reviewed-by: Mihai Carabas <mihai.carabas@oracle.com>
> Reviewed-by: Mark Kanda <mark.kanda@oracle.com>
> ---
>  arch/x86/kvm/vmx.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index e665aa7..411fcd2 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -12380,7 +12380,7 @@ static int nested_vmx_check_nmi_controls(struct vmcs12 *vmcs12)
>  	return 0;
>  }
>  
> -static int check_vmentry_prereqs(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
> +static int nested_check_vmentry_prereqs(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)

Probably worth putting a newline before vmcs12.

>  {
>  	struct vcpu_vmx *vmx = to_vmx(vcpu);
>  
> @@ -12542,7 +12542,7 @@ static int nested_vmx_check_vmcs_link_ptr(struct kvm_vcpu *vcpu,
>  	return r;
>  }
>  
> -static int check_vmentry_postreqs(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12,
> +static int nested_check_vmentry_postreqs(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12,
>  				  u32 *exit_qual)

If you put the newline between vcpu and vmcs12 you can squeak into 80
chars and maintain alignment, e.g.: 

static int nested_check_vmentry_postreqs(struct kvm_vcpu *vcpu,
					 struct vmcs12 *vmcs12, u32 *exit_qual)

>  {
>  	bool ia32e;
> @@ -12746,7 +12746,7 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch)
>  		goto out;
>  	}
>  
> -	ret = check_vmentry_prereqs(vcpu, vmcs12);
> +	ret = nested_check_vmentry_prereqs(vcpu, vmcs12);
>  	if (ret) {
>  		nested_vmx_failValid(vcpu, ret);
>  		goto out;
> @@ -12761,7 +12761,7 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch)
>  	 */
>  	skip_emulated_instruction(vcpu);
>  
> -	ret = check_vmentry_postreqs(vcpu, vmcs12, &exit_qual);
> +	ret = nested_check_vmentry_postreqs(vcpu, vmcs12, &exit_qual);
>  	if (ret) {
>  		nested_vmx_entry_failure(vcpu, vmcs12,
>  					 EXIT_REASON_INVALID_STATE, exit_qual);
> @@ -14085,8 +14085,8 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu,
>  			return -EINVAL;
>  	}
>  
> -	if (check_vmentry_prereqs(vcpu, vmcs12) ||
> -	    check_vmentry_postreqs(vcpu, vmcs12, &exit_qual))
> +	if (nested_check_vmentry_prereqs(vcpu, vmcs12) ||
> +	    nested_check_vmentry_postreqs(vcpu, vmcs12, &exit_qual))
>  		return -EINVAL;
>  
>  	vmx->nested.dirty_vmcs12 = true;
> -- 
> 2.9.5
>
diff mbox series

Patch

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index e665aa7..411fcd2 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -12380,7 +12380,7 @@  static int nested_vmx_check_nmi_controls(struct vmcs12 *vmcs12)
 	return 0;
 }
 
-static int check_vmentry_prereqs(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
+static int nested_check_vmentry_prereqs(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
 {
 	struct vcpu_vmx *vmx = to_vmx(vcpu);
 
@@ -12542,7 +12542,7 @@  static int nested_vmx_check_vmcs_link_ptr(struct kvm_vcpu *vcpu,
 	return r;
 }
 
-static int check_vmentry_postreqs(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12,
+static int nested_check_vmentry_postreqs(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12,
 				  u32 *exit_qual)
 {
 	bool ia32e;
@@ -12746,7 +12746,7 @@  static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch)
 		goto out;
 	}
 
-	ret = check_vmentry_prereqs(vcpu, vmcs12);
+	ret = nested_check_vmentry_prereqs(vcpu, vmcs12);
 	if (ret) {
 		nested_vmx_failValid(vcpu, ret);
 		goto out;
@@ -12761,7 +12761,7 @@  static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch)
 	 */
 	skip_emulated_instruction(vcpu);
 
-	ret = check_vmentry_postreqs(vcpu, vmcs12, &exit_qual);
+	ret = nested_check_vmentry_postreqs(vcpu, vmcs12, &exit_qual);
 	if (ret) {
 		nested_vmx_entry_failure(vcpu, vmcs12,
 					 EXIT_REASON_INVALID_STATE, exit_qual);
@@ -14085,8 +14085,8 @@  static int vmx_set_nested_state(struct kvm_vcpu *vcpu,
 			return -EINVAL;
 	}
 
-	if (check_vmentry_prereqs(vcpu, vmcs12) ||
-	    check_vmentry_postreqs(vcpu, vmcs12, &exit_qual))
+	if (nested_check_vmentry_prereqs(vcpu, vmcs12) ||
+	    nested_check_vmentry_postreqs(vcpu, vmcs12, &exit_qual))
 		return -EINVAL;
 
 	vmx->nested.dirty_vmcs12 = true;