All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Use hypercalls instead of accessing debug registers directly.
@ 2005-07-07 21:50 Arun Sharma
  0 siblings, 0 replies; 4+ messages in thread
From: Arun Sharma @ 2005-07-07 21:50 UTC (permalink / raw)
  To: Ian Pratt, Keir Fraser; +Cc: xen-devel

Use hypercalls instead of accessing debug registers directly.

Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>

--- 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;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] Use hypercalls instead of accessing debug registers directly.
@ 2005-07-07 23:05 Ian Pratt
  2005-07-07 23:38 ` Arun Sharma
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Pratt @ 2005-07-07 23:05 UTC (permalink / raw)
  To: Arun Sharma, Ian Pratt, Keir Fraser; +Cc: xen-devel

 

> Use hypercalls instead of accessing debug registers directly.

Is this based on measurement? If the debug registers aren't on the
critical path its probably not worth the change. If they are, they
should probably be part of a multicall.

Best,
Ian

> Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
> Signed-off-by: Arun Sharma <arun.sharma@intel.com>
> 
> --- 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;
>  
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Use hypercalls instead of accessing debug registers directly.
  2005-07-07 23:05 [PATCH] Use hypercalls instead of accessing debug registers directly Ian Pratt
@ 2005-07-07 23:38 ` Arun Sharma
  2005-07-08  8:49   ` Keir Fraser
  0 siblings, 1 reply; 4+ messages in thread
From: Arun Sharma @ 2005-07-07 23:38 UTC (permalink / raw)
  To: Ian Pratt; +Cc: Ian Pratt, xen-devel

Ian Pratt wrote:
>  
> 
> 
>>Use hypercalls instead of accessing debug registers directly.
> 
> 
> Is this based on measurement? If the debug registers aren't on the
> critical path its probably not worth the change. If they are, they
> should probably be part of a multicall.

It's not on the critical path. We probably should just emulate the 
instruction on the GP fault.

	-Arun

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Use hypercalls instead of accessing debug registers directly.
  2005-07-07 23:38 ` Arun Sharma
@ 2005-07-08  8:49   ` Keir Fraser
  0 siblings, 0 replies; 4+ messages in thread
From: Keir Fraser @ 2005-07-08  8:49 UTC (permalink / raw)
  To: Arun Sharma; +Cc: Ian Pratt, xen-devel


On 8 Jul 2005, at 00:38, Arun Sharma wrote:

>>> Use hypercalls instead of accessing debug registers directly.
>> Is this based on measurement? If the debug registers aren't on the
>> critical path its probably not worth the change. If they are, they
>> should probably be part of a multicall.
>
> It's not on the critical path. We probably should just emulate the 
> instruction on the GP fault.

I've now added the emulation.

  -- keir

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-07-08  8:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-07 23:05 [PATCH] Use hypercalls instead of accessing debug registers directly Ian Pratt
2005-07-07 23:38 ` Arun Sharma
2005-07-08  8:49   ` Keir Fraser
  -- strict thread matches above, loose matches on Subject: below --
2005-07-07 21:50 Arun Sharma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.