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] x86 vmx: Ensure debug-mode intercept for

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86 vmx: Ensure debug-mode intercept for int3 and debug exceptions are
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 15 May 2009 11:05:22 -0700
Delivery-date: Fri, 15 May 2009 11:05:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 1242207584 -3600
# Node ID 7d552e56d105786838ac027f3625486c9c2ea449
# Parent  07fbc48553e8024032a9f4764fd26afdafc4ce28
x86 vmx: Ensure debug-mode intercept for int3 and debug exceptions are
reinstated when resetting EXCEPTION_BIRTMAP entry in VMCS after
exiting real mode.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmcs.c       |   12 +-----------
 xen/arch/x86/hvm/vmx/vmx.c        |   19 +++++++++++++++++++
 xen/include/asm-x86/hvm/vmx/vmx.h |    1 +
 3 files changed, 21 insertions(+), 11 deletions(-)

diff -r 07fbc48553e8 -r 7d552e56d105 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c       Wed May 13 10:28:35 2009 +0100
+++ b/xen/arch/x86/hvm/vmx/vmcs.c       Wed May 13 10:39:44 2009 +0100
@@ -912,18 +912,8 @@ void vmx_do_resume(struct vcpu *v)
     debug_state = v->domain->debugger_attached;
     if ( unlikely(v->arch.hvm_vcpu.debug_state_latch != debug_state) )
     {
-        unsigned long intercepts = __vmread(EXCEPTION_BITMAP);
-        unsigned long mask = 1u << TRAP_int3;
-
-        if ( !cpu_has_monitor_trap_flag )
-            mask |= 1u << TRAP_debug;
-
         v->arch.hvm_vcpu.debug_state_latch = debug_state;
-        if ( debug_state )
-            intercepts |= mask;
-        else
-            intercepts &= ~mask;
-        __vmwrite(EXCEPTION_BITMAP, intercepts);
+        vmx_update_debug_state(v);
     }
 
     hvm_do_resume(v);
diff -r 07fbc48553e8 -r 7d552e56d105 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Wed May 13 10:28:35 2009 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Wed May 13 10:39:44 2009 +0100
@@ -1035,6 +1035,24 @@ static void vmx_update_host_cr3(struct v
     vmx_vmcs_exit(v);
 }
 
+void vmx_update_debug_state(struct vcpu *v)
+{
+    unsigned long intercepts, mask;
+
+    ASSERT(v == current);
+
+    mask = 1u << TRAP_int3;
+    if ( !cpu_has_monitor_trap_flag )
+        mask |= 1u << TRAP_debug;
+
+    intercepts = __vmread(EXCEPTION_BITMAP);
+    if ( v->arch.hvm_vcpu.debug_state_latch )
+        intercepts |= mask;
+    else
+        intercepts &= ~mask;
+    __vmwrite(EXCEPTION_BITMAP, intercepts);
+}
+
 static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
 {
     vmx_vmcs_enter(v);
@@ -1107,6 +1125,7 @@ static void vmx_update_guest_cr(struct v
                           | (paging_mode_hap(v->domain) ?
                              0 : (1U << TRAP_page_fault))
                           | (1U << TRAP_no_device));
+                vmx_update_debug_state(v);
             }
         }
 
diff -r 07fbc48553e8 -r 7d552e56d105 xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h Wed May 13 10:28:35 2009 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h Wed May 13 10:39:44 2009 +0100
@@ -60,6 +60,7 @@ void vmx_do_resume(struct vcpu *);
 void vmx_do_resume(struct vcpu *);
 void vmx_vlapic_msr_changed(struct vcpu *v);
 void vmx_realmode(struct cpu_user_regs *regs);
+void vmx_update_debug_state(struct vcpu *v);
 
 /*
  * Exit Reasons

_______________________________________________
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] x86 vmx: Ensure debug-mode intercept for int3 and debug exceptions are, Xen patchbot-unstable <=