kdb
[Top] [All Lists]

Re: About KDB global and local hardware breakpoint support in IA32.

To: "Zhang, Sonic" <sonic.zhang@xxxxxxxxx>
Subject: Re: About KDB global and local hardware breakpoint support in IA32.
From: Keith Owens <kaos@xxxxxxx>
Date: Thu, 13 Feb 2003 21:01:31 +1100
Cc: "KDB (E-mail)" <kdb@xxxxxxxxxxx>
In-reply-to: Your message of "Thu, 13 Feb 2003 15:59:45 +0800." <957BD1C2BF3CD411B6C500A0C944CA2602FB049B@xxxxxxxxxxxxxxxxxxxxx>
Sender: kdb-bounce@xxxxxxxxxxx
On Thu, 13 Feb 2003 15:59:45 +0800, 
"Zhang, Sonic" <sonic.zhang@xxxxxxxxx> wrote:
>       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.

Where do you get that from?  kdb_bp_install_local() is

void
kdb_bp_install_local(struct pt_regs *regs)
{
        int i;

        for(i=0; i<KDB_MAXBPT; i++) {
                if (KDB_DEBUG(BP)) {
                        kdb_printf("kdb_bp_install_local bp %d bp_enabled %d 
bp_global %d cpu %d bp_cpu %d\n",
                                i, kdb_breakpoints[i].bp_enabled, 
kdb_breakpoints[i].bp_global,
                                smp_processor_id(), kdb_breakpoints[i].bp_cpu);
                }
                if (kdb_breakpoints[i].bp_enabled
                 && kdb_breakpoints[i].bp_cpu == smp_processor_id()
                 && !kdb_breakpoints[i].bp_global){
                        kdba_installbp(regs, &kdb_breakpoints[i]);
                }
        }
}

That function is called for each cpu as it leaves kdb.  It only
installs local breakpoints for the current cpu.

kdb_bp() has
        if (hardware && !global) {
                bp->bp_global = 0;
                bp->bp_cpu = smp_processor_id();
        }
marking local breakpoints by their cpu number.


<Prev in Thread] Current Thread [Next in Thread>