From: Kouya Shimura Subject: [PATCH] export debug status to debugger Date: Fri, 10 Oct 2008 17:24:52 +0900 Message-ID: <7kzllcrh63.fsf@pingu.sky.yk.fujitsu.co.jp> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="+SiYN90NmW" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --+SiYN90NmW Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit VMX does not update DR6 on VM exits. It's inconvenient for debugging a domain. Signed-off-by: Kouya Shimura --+SiYN90NmW Content-Type: text/x-patch Content-Disposition: inline; filename="vmx_dr6.patch" Content-Transfer-Encoding: 7bit diff -r e66cecb66b1e xen/arch/x86/hvm/vmx/vmx.c --- a/xen/arch/x86/hvm/vmx/vmx.c Wed Oct 08 14:00:58 2008 +0100 +++ b/xen/arch/x86/hvm/vmx/vmx.c Sat May 10 17:03:18 2008 +0900 @@ -2109,6 +2109,13 @@ asmlinkage void vmx_vmexit_handler(struc 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; --+SiYN90NmW Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --+SiYN90NmW--