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

Attachment: kdb-smphdr-v3.0-2.4.20-i386-1.patch
Description: Binary data

Attachment: kdb-smphdr-v3.0-2.4.20-common-1.patch
Description: Binary data

Reply via email to