About KDB global and local hardware breakpoint support in IA32.

Zhang, Sonic sonic.zhang at intel.com
Wed Feb 12 23:59:45 PST 2003


Hi,

	I have read the code of KDB global and local hardware breakpoint
support. I find that although KDB command bpha and bph are provided for
global and local hardware breakpoints, their functions are not implemented
for IA32. 

	Current implementation in kdb-v3.0-2.4.20 sees a local breakpoint as
an equivalence of a global breakpoint. All CPUs share the same data
structure for hardware debug registers. And each CPU sets its debug register
for a hardware breakpoint, no matter whether it is a local one of the other
CPUs. So I tried to improve this feature to distinguish local and global
hardware breakpoints. Now, the user can create different local hardware
breakpoints for different CPUs. The global hardware breakpoints are still
dealt with in each CPUs.

	KDB_MAXHARDBPT <= Max hardware breakpoints <= KDB_MAXHARDBPT *
NR_CPUS

/*
 * Table describing processor architecture hardware
 * breakpoint registers.
 */
- kdbhard_bp_t	kdb_hardbreaks[KDB_MAXHARDBPT];
+ kdbhard_bp_t	kdb_hardbreaks[KDB_MAXHARDBPT][NR_CPUS];


	Besides, I think the name of routines "kdb_bp_install_global()",
"kdb_bp_install_local()", "kdb_bp_remove_global()" and
"kdb_bp_remove_local()" are not coincide with their functions in "kdb()".
The "global" routines actually only install or remove debug instruction,
such as "int3", while the "local" ones only deal with CPU specific debug
registers. So, I changed string "local" into "dbreg" and string "global"
into "dbinst". I also changed a little of their logic.

	Do you have any ideas about my consideration? I have tested my patch
on a server with 2 PIII CPUs basically.

	Please refer to the attachments. It works with kernel 2.4.20 and
kdb-v3.0-2.4.20.

	Thank you.


*************************************
Sonic Zhang
  
Software Engineer
Intel China Software Lab

Tel: 021-52574545-1667 
iNet: 8-752-1667 
*************************************
 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdb-smphdr-v3.0-2.4.20-i386-1.patch
Type: application/octet-stream
Size: 4957 bytes
Desc: not available
Url : http://oss.sgi.com/pipermail/kdb/attachments/20030213/efa1d87a/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdb-smphdr-v3.0-2.4.20-common-1.patch
Type: application/octet-stream
Size: 7771 bytes
Desc: not available
Url : http://oss.sgi.com/pipermail/kdb/attachments/20030213/efa1d87a/attachment-0001.obj 


More information about the kdb mailing list