From 4f36452b63836a672315516804c415c8d6f6dba7 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 10 Oct 2008 10:06:49 +0100 Subject: [PATCH] vmx:update DR6 on TRAP_debug VM exits. Signed-off-by: Kouya Shimura --- xen/arch/x86/hvm/vmx/vmx.c | 7 +++++++ 1 file changed, 7 insertions(+) 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; -- 2.30.2