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] [HVM][VMX] Added flag_dr_dirty to hvm vcp

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [HVM][VMX] Added flag_dr_dirty to hvm vcpu struct. If this flag is set,
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 27 Jun 2006 10:02:01 +0000
Delivery-date: Tue, 27 Jun 2006 03:04:19 -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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 5610d916ad1be231bd6b6c7ae26665374623a90c
# Parent  81bfa15a071e64093e31ab50106504b2429163df
[HVM][VMX] Added flag_dr_dirty to hvm vcpu struct.  If this flag is set,
save the debug registers, clear the flag, and remove guest access to
debug registers.
Signed-off-by: George Dunlap <dunlapg@xxxxxxxxx>
Signed-off-by: Nitin Kamble <nitin.a.kamble@xxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmx.c     |   21 +++++++++++++++++++++
 xen/include/asm-x86/hvm/vcpu.h |    3 +++
 2 files changed, 24 insertions(+)

diff -r 81bfa15a071e -r 5610d916ad1b xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Tue Jun 27 09:48:23 2006 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Tue Jun 27 09:51:18 2006 +0100
@@ -359,6 +359,26 @@ static inline int long_mode_do_msr_write
 
 #define loaddebug(_v,_reg) \
     __asm__ __volatile__ ("mov %0,%%db" #_reg : : "r" ((_v)->debugreg[_reg]))
+#define savedebug(_v,_reg) \
+    __asm__ __volatile__ ("mov %%db" #_reg ",%0" : : "r" 
((_v)->debugreg[_reg]))
+
+static inline void vmx_save_dr(struct vcpu *v)
+{
+    if ( v->arch.hvm_vcpu.flag_dr_dirty )
+    {
+        savedebug(&v->arch.guest_context, 0);
+        savedebug(&v->arch.guest_context, 1);
+        savedebug(&v->arch.guest_context, 2);
+        savedebug(&v->arch.guest_context, 3);
+        savedebug(&v->arch.guest_context, 6);
+        
+        v->arch.hvm_vcpu.flag_dr_dirty = 0;
+
+        v->arch.hvm_vcpu.u.vmx.exec_control |= CPU_BASED_MOV_DR_EXITING;
+        __vmwrite(CPU_BASED_VM_EXEC_CONTROL,
+                  v->arch.hvm_vcpu.u.vmx.exec_control);
+    }
+}
 
 static inline void __restore_debug_registers(struct vcpu *v)
 {
@@ -409,6 +429,7 @@ static void vmx_ctxt_switch_from(struct 
     vmx_freeze_time(v);
     vmx_save_segments(v);
     vmx_load_msrs();
+    vmx_save_dr(v);
 }
 
 static void vmx_ctxt_switch_to(struct vcpu *v)
diff -r 81bfa15a071e -r 5610d916ad1b xen/include/asm-x86/hvm/vcpu.h
--- a/xen/include/asm-x86/hvm/vcpu.h    Tue Jun 27 09:48:23 2006 +0100
+++ b/xen/include/asm-x86/hvm/vcpu.h    Tue Jun 27 09:51:18 2006 +0100
@@ -38,6 +38,9 @@ struct hvm_vcpu {
     /* For AP startup */
     unsigned long   init_sipi_sipi_state;
 
+    /* Flags */
+    int   flag_dr_dirty;
+
     union {
         struct arch_vmx_struct vmx;
         struct arch_svm_struct svm;

_______________________________________________
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] [HVM][VMX] Added flag_dr_dirty to hvm vcpu struct. If this flag is set,, Xen patchbot-unstable <=