[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] [HVM][VMX] Added flag_dr_dirty to hvm vcpu struct. If this flag is set,
# 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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |