From: David Gibson <dwg@au1.ibm.com>
To: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Cc: linuxppc-dev list <Linuxppc-dev@ozlabs.org>,
Sergio Durigan Junior <sergiodj@br.ibm.com>,
Torez Smith <torez@us.ibm.com>,
Thiago Jung Bauermann <bauerman@br.ibm.com>
Subject: Re: [RFC:PATCH 01/03] powerpc: Extended ptrace interface
Date: Fri, 11 Dec 2009 11:44:34 +1100 [thread overview]
Message-ID: <20091211004434.GA8852@yookeroo> (raw)
In-Reply-To: <20091210155715.6697.92627.sendpatchset@norville.austin.ibm.com>
On Thu, Dec 10, 2009 at 01:57:15PM -0200, Dave Kleikamp wrote:
> powerpc: Extended ptrace interface
>
> From: Torez Smith <lnxtorez@linux.vnet.ibm.com>
>
> Add a new extended ptrace interface so that user-space has a single
> interface for powerpc, without having to know the specific layout
> of the debug registers.
> Implement:
> PPC_PTRACE_GETHWDEBUGINFO
> PPC_PTRACE_SETHWDEBUG
> PPC_PTRACE_DELHWDEBUG
>
> Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
> Signed-off-by: Torez Smith <lnxtorez@linux.vnet.ibm.com>
Apart from the data breakpoint alignment for 32-bit systems, all the
comments below are trivial nits, so:
Acked-by: David Gibson <dwg@au1.ibm.com>
[snip]
> +/*
> + * Trigger Type
> + */
> +#define PPC_BREAKPOINT_TRIGGER_EXECUTE 0x1
> +#define PPC_BREAKPOINT_TRIGGER_READ 0x2
> +#define PPC_BREAKPOINT_TRIGGER_WRITE 0x4
> +#define PPC_BREAKPOINT_TRIGGER_RW 0x6
For a little extra safety, I'd tend towards defining the RW constant
in terms of the READ and WRITE constants.
> +
> +/*
> + * Address Mode
> + */
> +#define PPC_BREAKPOINT_MODE_EXACT 0x0
> +#define PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE 0x1
> +#define PPC_BREAKPOINT_MODE_RANGE_EXCLUSIVE 0x2
> +#define PPC_BREAKPOINT_MODE_MASK 0x3
> +
> +/*
> + * Condition Mode
> + */
> +#define PPC_BREAKPOINT_CONDITION_NONE 0x0
> +#define PPC_BREAKPOINT_CONDITION_AND 0x1
> +#define PPC_BREAKPOINT_CONDITION_EXACT 0x1
And likewuse define EXACT in terms of AND.
> +#define PPC_BREAKPOINT_CONDITION_OR 0x2
> +#define PPC_BREAKPOINT_CONDITION_AND_OR 0x3
> +#define PPC_BREAKPOINT_CONDITION_BE_ALL 0x00ff0000
> +#define PPC_BREAKPOINT_CONDITION_BE_SHIFT 16
> +#define PPC_BREAKPOINT_CONDITION_BE(n) \
> + (1<<((n)+PPC_BREAKPOINT_CONDITION_BE_SHIFT))
[snip]
> + case PPC_PTRACE_GETHWDBGINFO: {
> + struct ppc_debug_info dbginfo;
> +
> + dbginfo.version = 1;
> + dbginfo.num_instruction_bps = 0;
> + dbginfo.num_data_bps = 1;
> + dbginfo.num_condition_regs = 0;
> +#ifdef CONFIG_PPC64
> + dbginfo.data_bp_alignment = 8;
> +#else
> + dbginfo.data_bp_alignment = 0;
Uh.. this looks wrong. Surely it should be 4.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
next prev parent reply other threads:[~2009-12-11 0:44 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-10 15:57 [RFC:PATCH 00/03] powerpc: Expose BookE debug registers through extended ptrace interface Dave Kleikamp
2009-12-10 15:57 ` [RFC:PATCH 01/03] powerpc: Extended " Dave Kleikamp
2009-12-11 0:44 ` David Gibson [this message]
2009-12-11 2:51 ` Kumar Gala
2009-12-10 15:57 ` [RFC:PATCH 02/03] powerpc: Add definitions for Debug Registers on BookE Platforms Dave Kleikamp
2009-12-10 17:07 ` Josh Boyer
2010-01-18 22:07 ` Dave Kleikamp
2009-12-11 0:53 ` David Gibson
2009-12-11 1:31 ` Dave Kleikamp
2010-01-18 22:10 ` Dave Kleikamp
2009-12-11 2:41 ` Kumar Gala
2009-12-11 3:28 ` David Gibson
2009-12-11 14:35 ` Kumar Gala
2009-12-14 1:16 ` David Gibson
2009-12-10 15:57 ` [RFC:PATCH 03/03] powerpc: Add support for BookE Debug Reg. traps, exceptions and ptrace Dave Kleikamp
2009-12-10 17:27 ` Josh Boyer
2009-12-10 17:41 ` Josh Boyer
2009-12-10 18:05 ` Dave Kleikamp
2009-12-11 2:50 ` Kumar Gala
2010-01-18 22:18 ` Dave Kleikamp
2009-12-11 3:26 ` David Gibson
2010-01-18 22:31 ` Dave Kleikamp
2009-12-11 2:23 ` [RFC:PATCH 00/03] powerpc: Expose BookE debug registers through extended ptrace interface Kumar Gala
2009-12-11 2:27 ` Dave Kleikamp
2009-12-11 20:07 ` Thiago Jung Bauermann
2009-12-11 20:51 ` Kumar Gala
2010-01-18 22:34 ` Dave Kleikamp
2010-02-03 2:03 ` Dave Kleikamp
2009-12-11 2:24 ` Kumar Gala
2009-12-11 2:29 ` Dave Kleikamp
2009-12-11 2:32 ` Kumar Gala
2009-12-12 4:18 ` Benjamin Herrenschmidt
2009-12-11 2:45 ` Kumar Gala
2010-01-18 22:41 ` Dave Kleikamp
-- strict thread matches above, loose matches on Subject: below --
2010-01-18 21:57 Dave Kleikamp
2010-01-18 21:57 ` [RFC:PATCH 01/03] powerpc: Extended " Dave Kleikamp
2010-01-21 2:47 ` Michael Neuling
2010-02-01 5:08 ` Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091211004434.GA8852@yookeroo \
--to=dwg@au1.ibm.com \
--cc=Linuxppc-dev@ozlabs.org \
--cc=bauerman@br.ibm.com \
--cc=sergiodj@br.ibm.com \
--cc=shaggy@linux.vnet.ibm.com \
--cc=torez@us.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.