diff mbox

kvm: nVMX: Restore exit qual for VM-entry failure due to MSR loading

Message ID 20180530230002.123712-1-jmattson@google.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jim Mattson May 30, 2018, 11 p.m. UTC
This exit qualification was inadvertently dropped when the two
VM-entry failure blocks were coalesced.

Fixes: e79f245ddec1 ("X86/KVM: Properly update 'tsc_offset' to represent the running guest")
Signed-off-by: Jim Mattson <jmattson@google.com>
---
 arch/x86/kvm/vmx.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Krish Sadhukhan May 31, 2018, 1:10 a.m. UTC | #1
On 05/30/2018 04:00 PM, Jim Mattson wrote:
> This exit qualification was inadvertently dropped when the two
> VM-entry failure blocks were coalesced.
>
> Fixes: e79f245ddec1 ("X86/KVM: Properly update 'tsc_offset' to represent the running guest")
> Signed-off-by: Jim Mattson <jmattson@google.com>
> ---
>   arch/x86/kvm/vmx.c | 9 ++++-----
>   1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index e50beb76d846e..fe5fe5787ea8b 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -11612,7 +11612,6 @@ static int enter_vmx_non_root_mode(struct kvm_vcpu *vcpu)
>   {
>   	struct vcpu_vmx *vmx = to_vmx(vcpu);
>   	struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
> -	u32 msr_entry_idx;
>   	u32 exit_qual;
>   	int r;
>   
> @@ -11634,10 +11633,10 @@ static int enter_vmx_non_root_mode(struct kvm_vcpu *vcpu)
>   	nested_get_vmcs12_pages(vcpu, vmcs12);
>   
>   	r = EXIT_REASON_MSR_LOAD_FAIL;
> -	msr_entry_idx = nested_vmx_load_msr(vcpu,
> -					    vmcs12->vm_entry_msr_load_addr,
> -					    vmcs12->vm_entry_msr_load_count);
> -	if (msr_entry_idx)
> +	exit_qual = nested_vmx_load_msr(vcpu,
> +					vmcs12->vm_entry_msr_load_addr,
> +					vmcs12->vm_entry_msr_load_count);
> +	if (exit_qual)
>   		goto fail;
>   
>   	/*
Reviewed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
David Hildenbrand June 7, 2018, 10:41 a.m. UTC | #2
On 31.05.2018 01:00, Jim Mattson wrote:
> This exit qualification was inadvertently dropped when the two
> VM-entry failure blocks were coalesced.
> 
> Fixes: e79f245ddec1 ("X86/KVM: Properly update 'tsc_offset' to represent the running guest")
> Signed-off-by: Jim Mattson <jmattson@google.com>
> ---
>  arch/x86/kvm/vmx.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index e50beb76d846e..fe5fe5787ea8b 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -11612,7 +11612,6 @@ static int enter_vmx_non_root_mode(struct kvm_vcpu *vcpu)
>  {
>  	struct vcpu_vmx *vmx = to_vmx(vcpu);
>  	struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
> -	u32 msr_entry_idx;
>  	u32 exit_qual;
>  	int r;
>  
> @@ -11634,10 +11633,10 @@ static int enter_vmx_non_root_mode(struct kvm_vcpu *vcpu)
>  	nested_get_vmcs12_pages(vcpu, vmcs12);
>  
>  	r = EXIT_REASON_MSR_LOAD_FAIL;
> -	msr_entry_idx = nested_vmx_load_msr(vcpu,
> -					    vmcs12->vm_entry_msr_load_addr,
> -					    vmcs12->vm_entry_msr_load_count);
> -	if (msr_entry_idx)
> +	exit_qual = nested_vmx_load_msr(vcpu,
> +					vmcs12->vm_entry_msr_load_addr,
> +					vmcs12->vm_entry_msr_load_count);
> +	if (exit_qual)
>  		goto fail;
>  
>  	/*
> 

Reviewed-by: David Hildenbrand <david@redhat.com>
diff mbox

Patch

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index e50beb76d846e..fe5fe5787ea8b 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -11612,7 +11612,6 @@  static int enter_vmx_non_root_mode(struct kvm_vcpu *vcpu)
 {
 	struct vcpu_vmx *vmx = to_vmx(vcpu);
 	struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
-	u32 msr_entry_idx;
 	u32 exit_qual;
 	int r;
 
@@ -11634,10 +11633,10 @@  static int enter_vmx_non_root_mode(struct kvm_vcpu *vcpu)
 	nested_get_vmcs12_pages(vcpu, vmcs12);
 
 	r = EXIT_REASON_MSR_LOAD_FAIL;
-	msr_entry_idx = nested_vmx_load_msr(vcpu,
-					    vmcs12->vm_entry_msr_load_addr,
-					    vmcs12->vm_entry_msr_load_count);
-	if (msr_entry_idx)
+	exit_qual = nested_vmx_load_msr(vcpu,
+					vmcs12->vm_entry_msr_load_addr,
+					vmcs12->vm_entry_msr_load_count);
+	if (exit_qual)
 		goto fail;
 
 	/*