From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arun Sharma Subject: [PATCH] Use hypercalls instead of accessing debug registers directly. Date: Thu, 7 Jul 2005 14:50:23 -0700 Message-ID: <20050707215023.GA30422@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Pratt , Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Use hypercalls instead of accessing debug registers directly. Signed-off-by: Jun Nakajima Signed-off-by: Arun Sharma --- a/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/traps.c Wed Jul 6 23:44:28 2005 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/traps.c Thu Jul 7 14:38:19 2005 @@ -666,7 +666,7 @@ } #endif - asm("movq %%db6,%0" : "=r" (condition)); + condition = HYPERVISOR_get_debugreg(6); if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code, SIGTRAP) == NOTIFY_STOP) { @@ -714,7 +714,8 @@ info.si_addr = (void __user *)regs->rip; force_sig_info(SIGTRAP, &info, tsk); clear_dr7: - asm volatile("movq %0,%%db7"::"r"(0UL)); + HYPERVISOR_set_debugreg(7, 0); + notify_die(DIE_DEBUG, "debug", regs, condition, 1, SIGTRAP); return regs;