2018-08-23 16:31:35

by Vitaly Kuznetsov

[permalink] [raw]
Subject: [PATCH] x86/kvm/nVMX: avoid redundant double assignment of nested_run_pending

nested_run_pending is set 20 lines above and check_vmentry_prereqs()/
check_vmentry_postreqs() don't seem to be resetting it (the later, however,
checks it).

Signed-off-by: Vitaly Kuznetsov <[email protected]>
---
arch/x86/kvm/vmx.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 6c3514750d0c..8a63b8cf9458 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -14221,9 +14221,6 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu,
check_vmentry_postreqs(vcpu, vmcs12, &exit_qual))
return -EINVAL;

- if (kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING)
- vmx->nested.nested_run_pending = 1;
-
vmx->nested.dirty_vmcs12 = true;
ret = enter_vmx_non_root_mode(vcpu, NULL);
if (ret)
--
2.14.4



2018-08-23 16:31:49

by Paolo Bonzini

[permalink] [raw]
Subject: Re: [PATCH] x86/kvm/nVMX: avoid redundant double assignment of nested_run_pending

On 23/08/2018 18:24, Vitaly Kuznetsov wrote:
> nested_run_pending is set 20 lines above and check_vmentry_prereqs()/
> check_vmentry_postreqs() don't seem to be resetting it (the later, however,
> checks it).
>
> Signed-off-by: Vitaly Kuznetsov <[email protected]>
> ---
> arch/x86/kvm/vmx.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 6c3514750d0c..8a63b8cf9458 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -14221,9 +14221,6 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu,
> check_vmentry_postreqs(vcpu, vmcs12, &exit_qual))
> return -EINVAL;
>
> - if (kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING)
> - vmx->nested.nested_run_pending = 1;
> -
> vmx->nested.dirty_vmcs12 = true;
> ret = enter_vmx_non_root_mode(vcpu, NULL);
> if (ret)
>

Reviewed-by: Paolo Bonzini <[email protected]>

2018-08-23 16:48:20

by Eduardo Valentin

[permalink] [raw]
Subject: Re: [PATCH] x86/kvm/nVMX: avoid redundant double assignment of nested_run_pending

On Thu, Aug 23, 2018 at 06:24:24PM +0200, Vitaly Kuznetsov wrote:
> nested_run_pending is set 20 lines above and check_vmentry_prereqs()/
> check_vmentry_postreqs() don't seem to be resetting it (the later, however,
> checks it).
>

Reviewed-by: Eduardo Valentin <[email protected]>

> Signed-off-by: Vitaly Kuznetsov <[email protected]>
> ---
> arch/x86/kvm/vmx.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 6c3514750d0c..8a63b8cf9458 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -14221,9 +14221,6 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu,
> check_vmentry_postreqs(vcpu, vmcs12, &exit_qual))
> return -EINVAL;
>
> - if (kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING)
> - vmx->nested.nested_run_pending = 1;
> -
> vmx->nested.dirty_vmcs12 = true;
> ret = enter_vmx_non_root_mode(vcpu, NULL);
> if (ret)
> --
> 2.14.4
>
>

--
All the best,
Eduardo Valentin

2018-08-23 20:52:29

by Jim Mattson

[permalink] [raw]
Subject: Re: [PATCH] x86/kvm/nVMX: avoid redundant double assignment of nested_run_pending

On Thu, Aug 23, 2018 at 9:26 AM, Paolo Bonzini <[email protected]> wrote:
> On 23/08/2018 18:24, Vitaly Kuznetsov wrote:
>> nested_run_pending is set 20 lines above and check_vmentry_prereqs()/
>> check_vmentry_postreqs() don't seem to be resetting it (the later, however,
>> checks it).
>>
>> Signed-off-by: Vitaly Kuznetsov <[email protected]>
> Reviewed-by: Paolo Bonzini <[email protected]>
Reviewed-by: Jim Mattson <[email protected]>

2018-08-24 20:39:30

by Krish Sadhukhan

[permalink] [raw]
Subject: Re: [PATCH] x86/kvm/nVMX: avoid redundant double assignment of nested_run_pending



On 08/23/2018 09:24 AM, Vitaly Kuznetsov wrote:
> nested_run_pending is set 20 lines above and check_vmentry_prereqs()/
> check_vmentry_postreqs() don't seem to be resetting it (the later, however,
> checks it).
>
> Signed-off-by: Vitaly Kuznetsov <[email protected]>
> ---
> arch/x86/kvm/vmx.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 6c3514750d0c..8a63b8cf9458 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -14221,9 +14221,6 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu,
> check_vmentry_postreqs(vcpu, vmcs12, &exit_qual))
> return -EINVAL;
>
> - if (kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING)
> - vmx->nested.nested_run_pending = 1;
> -
> vmx->nested.dirty_vmcs12 = true;
> ret = enter_vmx_non_root_mode(vcpu, NULL);
> if (ret)
Reviewed-by: Krish Sadhukhan <[email protected]>