[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging] x86/vvmx: Fixes to VMWRITE emulation



commit 68a15d6bd84ad3e66f997940accaf9485352e604
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Thu Nov 1 17:37:48 2018 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Fri Nov 23 13:46:59 2018 +0000

    x86/vvmx: Fixes to VMWRITE emulation
    
     * Don't assume that decode_vmx_inst() always returns X86EMUL_EXCEPTION.
     * The okay boolean is never written, making the else case dead.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Reviewed-by: Sergey Dyasli <sergey.dyasli@xxxxxxxxxx>
    Acked-by: Kevin Tian <kevin.tian@xxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vvmx.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index 5daab82dc0..41c4e2fb82 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1872,11 +1872,12 @@ static int nvmx_handle_vmwrite(struct cpu_user_regs 
*regs)
     struct vmx_inst_decoded decode;
     unsigned long operand; 
     u64 vmcs_encoding;
-    bool_t okay = 1;
     enum vmx_insn_errno err;
+    int rc;
 
-    if ( decode_vmx_inst(regs, &decode, &operand) != X86EMUL_OKAY )
-        return X86EMUL_EXCEPTION;
+    rc = decode_vmx_inst(regs, &decode, &operand);
+    if ( rc != X86EMUL_OKAY )
+        return rc;
 
     if ( !vvmcx_valid(v) )
     {
@@ -1905,10 +1906,7 @@ static int nvmx_handle_vmwrite(struct cpu_user_regs 
*regs)
         break;
     }
 
-    if ( okay )
-        vmsucceed(regs);
-    else
-        vmfail_valid(regs, VMX_INSN_UNSUPPORTED_VMCS_COMPONENT);
+    vmsucceed(regs);
 
     return X86EMUL_OKAY;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.