From: Keir Fraser Date: Fri, 10 Oct 2008 09:06:49 +0000 (+0100) Subject: vmx:update DR6 on TRAP_debug VM exits. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14090^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4f36452b63;p=xen.git vmx:update DR6 on TRAP_debug VM exits. Signed-off-by: Kouya Shimura --- diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index ce320dbc54..6059af04b4 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -2109,6 +2109,13 @@ asmlinkage void vmx_vmexit_handler(struct cpu_user_regs *regs) switch ( vector ) { case TRAP_debug: + /* + * Updates DR6 where debugger can peek (See 3B 23.2.1, + * Table 23-1, "Exit Qualification for Debug Exceptions"). + */ + exit_qualification = __vmread(EXIT_QUALIFICATION); + write_debugreg(6, exit_qualification | 0xffff0ff0); + /* fall through */ case TRAP_int3: if ( !v->domain->debugger_attached ) goto exit_and_crash;