public inbox for linuxppc-dev@ozlabs.org
 help / color / mirror / Atom feed
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 02/03] powerpc: Add definitions for Debug Registers on BookE Platforms
Date: Fri, 11 Dec 2009 11:53:44 +1100	[thread overview]
Message-ID: <20091211005344.GB8852@yookeroo> (raw)
In-Reply-To: <20091210155721.6697.40863.sendpatchset@norville.austin.ibm.com>

On Thu, Dec 10, 2009 at 01:57:21PM -0200, Dave Kleikamp wrote:
> powerpc: Add definitions for Debug Registers on BookE Platforms
> 
> From: Torez Smith <lnxtorez@linux.vnet.ibm.com>
> 
> This patch adds additional definitions for BookE Debug Registers
> to the reg_booke.h header file.
> 
> Signed-off-by: Torez Smith  <lnxtorez@linux.vnet.ibm.com>
> Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>

As with patch 1/3, none of the comments below is anything that
couldn't be fixed up after merging.  So,

Acked-by: David Gibson <dwg@au1.ibm.com>

> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Thiago Jung Bauermann <bauerman@br.ibm.com>
> Cc: Sergio Durigan Junior <sergiodj@br.ibm.com>
> Cc: David Gibson <dwg@au1.ibm.com>
> Cc: linuxppc-dev list <Linuxppc-dev@ozlabs.org>
> ---
> 
>  arch/powerpc/include/asm/processor.h |   30 +++++-
>  arch/powerpc/include/asm/reg_booke.h |  176 +++++++++++++++++++++++++++++-----
>  2 files changed, 178 insertions(+), 28 deletions(-)

[snip]
> +	/*
> +	 * The following will contain addresses used by debug applications
> +	 * to help trace and trap on particular address locations.
> +	 * The bits in the Debug Control Registers above help define which
> +	 * of the following registers will contain valid data and/or addresses.
> +	 */
> +	unsigned long	iac1;
> +	unsigned long	iac2;
> +	unsigned long	iac3;
> +	unsigned long	iac4;
> +	unsigned long	dac1;
> +	unsigned long	dac2;
> +	unsigned long	dvc1;
> +	unsigned long	dvc2;

I think you'd make the logic in patch 3 substantially easier, if you
defined these as
	unsigned long iac[4];
	unsigned long dac[2];
	unsigned long dvc[2];
instead of as individual structure members.

[snip]
> +#define DBCR0_USER_DEBUG	(DBCR0_IDM | DBCR0_ICMP | DBCR0_IAC1 | \
> +				 DBCR0_IAC2 | DBCR0_IAC3 | DBCR0_IAC4)
> +#define DBCR0_BASE_REG_VALUE	0

These constants are left over from when the interface allowed
more-or-less direct access to the debug regs.  I don't think the
USER_DEBUG constant is used at all any more, and the BASE_REG_VALUE is
just used in the load_default function, and might as well be inline
there.

[snip]
> +
> +#define dbcr_iac_range(task)	((task)->thread.dbcr0)

Hrm, I think the way these macros work to do the 40x vs. BookE
abstration is kind of ugly.  But an unequivocally better way doesn't
immediately occur to me.

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

  parent reply	other threads:[~2009-12-11  0:53 UTC|newest]

Thread overview: 35+ 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
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 [this message]
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:59 ` [RFC:PATCH 02/03] powerpc: Add definitions for Debug Registers on BookE Platforms Dave Kleikamp

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=20091211005344.GB8852@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox