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

[Xen-changelog] [xen stable-4.3] VMX: fix DebugCtl MSR clearing



commit 2510d34206f0b10a8684da5611e24f4f53a23f1e
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Oct 1 15:11:46 2014 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Oct 1 15:11:46 2014 +0200

    VMX: fix DebugCtl MSR clearing
    
    The previous shortcut was wrong, as it bypassed the necessary vmwrite:
    All we really want to avoid if the guest writes zero is to add the MSR
    to the host-load list.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Kevin Tian <kevin.tian@xxxxxxxxx>
    master commit: dfa625e15f3d6c374637f2bb789e1f444c2781c3
    master date: 2014-08-22 14:29:37 +0200
---
 xen/arch/x86/hvm/vmx/vmx.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index c60fb22..bf7d8f1 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2132,8 +2132,6 @@ static int vmx_msr_write_intercept(unsigned int msr, 
uint64_t msr_content)
         int i, rc = 0;
         uint64_t supported = IA32_DEBUGCTLMSR_LBR | IA32_DEBUGCTLMSR_BTF;
 
-        if ( !msr_content )
-            break;
         if ( msr_content & ~supported )
         {
             /* Perhaps some other bits are supported in vpmu. */
@@ -2153,12 +2151,10 @@ static int vmx_msr_write_intercept(unsigned int msr, 
uint64_t msr_content)
         }
 
         if ( (rc < 0) ||
-             (vmx_add_host_load_msr(msr) < 0) )
+             (msr_content && (vmx_add_host_load_msr(msr) < 0)) )
             hvm_inject_hw_exception(TRAP_machine_check, 0);
         else
-        {
             __vmwrite(GUEST_IA32_DEBUGCTL, msr_content);
-        }
 
         break;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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