lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0F1B54C89D5F954D8535DB252AF412FA0553E3A0@chinexm1.ad.analog.com>
Date:	Mon, 28 Dec 2009 18:17:22 +0800
From:	"Zhang, Sonic" <Sonic.Zhang@...log.com>
To:	"Mike Frysinger" <vapier.adi@...il.com>,
	"Jason Wessel" <jason.wessel@...driver.com>
CC:	<linux-kernel@...r.kernel.org>,
	<kgdb-bugreport@...ts.sourceforge.net>, <kdb@....sgi.com>,
	<mingo@...e.hu>
Subject: RE: [PATCH 09/37] kgdb,blackfin: Add in kgdb_arch_set_pc for blackfin

A little update.

GDB uses field BFIN_PC as the resume address from debugging mode. But, field pc in struct pt_regs is where kernel resumes from an interrupt. So, BFIN_PC is actually retx when do kernel debugging.


Sonic 


--- trunk/arch/blackfin/kernel/kgdb.c	2009-12-28 09:27:27 UTC (rev 8085)
+++ trunk/arch/blackfin/kernel/kgdb.c	2009-12-28 10:08:30 UTC (rev 8086)
@@ -79,7 +79,7 @@
 	gdb_regs[BFIN_RETX] = regs->retx;
 	gdb_regs[BFIN_RETN] = regs->retn;
 	gdb_regs[BFIN_RETE] = regs->rete;
-	gdb_regs[BFIN_PC] = regs->pc;
+	gdb_regs[BFIN_PC] = regs->retx;
 	gdb_regs[BFIN_CC] = 0;
 	gdb_regs[BFIN_EXTRA1] = 0;
 	gdb_regs[BFIN_EXTRA2] = 0;
@@ -150,7 +150,7 @@
 	regs->retx = gdb_regs[BFIN_PC];
 	regs->retn = gdb_regs[BFIN_RETN];
 	regs->rete = gdb_regs[BFIN_RETE];
-	regs->pc = gdb_regs[BFIN_PC];
+	regs->pc = gdb_regs[BFIN_RETI];
 
 #if 0				/* can't change these */
 	regs->astat = gdb_regs[BFIN_ASTAT];




-----Original Message-----
From: Mike Frysinger [mailto:vapier.adi@...il.com] 
Sent: Sunday, December 27, 2009 5:12 AM
To: Jason Wessel
Cc: linux-kernel@...r.kernel.org; kgdb-bugreport@...ts.sourceforge.net; kdb@....sgi.com; mingo@...e.hu; Zhang, Sonic
Subject: Re: [PATCH 09/37] kgdb,blackfin: Add in kgdb_arch_set_pc for blackfin

On Wed, Dec 23, 2009 at 16:19, Jason Wessel wrote:
> The new debug core api requires all architectures that use to debug 
> core to implement a function to set the program counter.
>
> CC: Mike Frysinger <vapier@...too.org>
> Signed-off-by: Jason Wessel <jason.wessel@...driver.com>
> ---
>  arch/blackfin/kernel/kgdb.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/arch/blackfin/kernel/kgdb.c b/arch/blackfin/kernel/kgdb.c 
> index f1036b6..5965188 100644
> --- a/arch/blackfin/kernel/kgdb.c
> +++ b/arch/blackfin/kernel/kgdb.c
> @@ -644,6 +644,11 @@ int kgdb_arch_remove_breakpoint(unsigned long 
> addr, char *bundle)
>        return bfin_probe_kernel_write((char *)addr, bundle, 
> BREAK_INSTR_SIZE);
>  }
>
> +void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip) {
> +       regs->retx = ip;
> +}
> +
>  int kgdb_arch_init(void)
>  {
>        kgdb_single_step = 0;

Sonic should be able to check this.  our pc handling seems a little wonky atm:

arch/blackfin/kernel/kgdb.c:
void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs) { ...
    gdb_regs[BFIN_RETI] = regs->pc;
    gdb_regs[BFIN_RETX] = regs->retx;
    gdb_regs[BFIN_PC] = regs->pc;
...
}
...
void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs) { ...
    regs->pc = gdb_regs[BFIN_PC];
    regs->retx = gdb_regs[BFIN_PC];
    /* nothing for BFIN_RETI */
...
}
-mike
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ