Skip to contentSkip to conversation

Use hypercalls instead of accessing debug registers directly.

PATCH New Arun Sharma 1 participant 1 message Jul 7, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use hypercalls instead of accessing debug registers directly.

Use hypercalls instead of accessing debug registers directly.

linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/traps.c +3 -2
@@ -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;