WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] vmx: fix debugctl handling

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] vmx: fix debugctl handling
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 20 Mar 2008 05:40:42 -0700
Delivery-date: Thu, 20 Mar 2008 05:43:53 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1205845857 0
# Node ID 2b3ab5377dbb80b5a7ea162718cecea485c0bff2
# Parent  8cc1ed987d5f726c4a57325b03e71f4b18b52525
vmx: fix debugctl handling

I recently realized that the original way of dealing with the DebugCtl
MSR on VMX failed to make use of the dedicated guest VMCS field. This
is fixed by this patch.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmcs.c |    2 +-
 xen/arch/x86/hvm/vmx/vmx.c  |   14 ++++++++++----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff -r 8cc1ed987d5f -r 2b3ab5377dbb xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c       Tue Mar 18 13:08:30 2008 +0000
+++ b/xen/arch/x86/hvm/vmx/vmcs.c       Tue Mar 18 13:10:57 2008 +0000
@@ -870,7 +870,7 @@ void vmcs_dump_vcpu(struct vcpu *v)
     x  = (unsigned long long)vmr(TSC_OFFSET_HIGH) << 32;
     x |= (uint32_t)vmr(TSC_OFFSET);
     printk("TSC Offset = %016llx\n", x);
-    x  = (unsigned long long)vmr(GUEST_IA32_DEBUGCTL) << 32;
+    x  = (unsigned long long)vmr(GUEST_IA32_DEBUGCTL_HIGH) << 32;
     x |= (uint32_t)vmr(GUEST_IA32_DEBUGCTL);
     printk("DebugCtl=%016llx DebugExceptions=%016llx\n", x,
            (unsigned long long)vmr(GUEST_PENDING_DBG_EXCEPTIONS));
diff -r 8cc1ed987d5f -r 2b3ab5377dbb xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Tue Mar 18 13:08:30 2008 +0000
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Tue Mar 18 13:10:57 2008 +0000
@@ -1512,8 +1512,10 @@ static int vmx_msr_read_intercept(struct
         msr_content = var_range_base[index];
         break;
     case MSR_IA32_DEBUGCTLMSR:
-        if ( vmx_read_guest_msr(v, ecx, &msr_content) != 0 )
-            msr_content = 0;
+        msr_content = __vmread(GUEST_IA32_DEBUGCTL);
+#ifdef __i386__
+        msr_content |= (u64)__vmread(GUEST_IA32_DEBUGCTL_HIGH) << 32;
+#endif
         break;
     case MSR_IA32_VMX_BASIC...MSR_IA32_VMX_PROCBASED_CTLS2:
         goto gp_fault;
@@ -1732,11 +1734,15 @@ static int vmx_msr_write_intercept(struc
         }
 
         if ( (rc < 0) ||
-             (vmx_add_guest_msr(v, ecx) < 0) ||
              (vmx_add_host_load_msr(v, ecx) < 0) )
             vmx_inject_hw_exception(v, TRAP_machine_check, 0);
         else
-            vmx_write_guest_msr(v, ecx, msr_content);
+        {
+            __vmwrite(GUEST_IA32_DEBUGCTL, msr_content);
+#ifdef __i386__
+            __vmwrite(GUEST_IA32_DEBUGCTL_HIGH, msr_content >> 32);
+#endif
+        }
 
         break;
     }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] vmx: fix debugctl handling, Xen patchbot-unstable <=