Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Ulrich Weigand via Gdb-patches <gdb-patches@sourceware.org>
To: Rogerio Alves <rcardoso@linux.ibm.com>
Cc: pedromfc@linux.ibm.com, gdb-patches@sourceware.org
Subject: Re: [PATCH v1] [powerpc] Remove 512 bytes region limit if using 2nd DAWR.
Date: Tue, 10 Nov 2020 11:21:59 +0100	[thread overview]
Message-ID: <20201110102159.GA23382@oc3748833570.ibm.com> (raw)
In-Reply-To: <916089d8-f003-6e23-2180-8d96d7b3ce6b@linux.ibm.com>

On Mon, Nov 09, 2020 at 10:08:09AM -0300, Rogerio Alves wrote:
> On 11/9/20 7:24 AM, Ulrich Weigand wrote:
> > On Sun, Nov 08, 2020 at 11:12:04PM -0300, Rogerio Alves wrote:
> >> Power 10 introduces the 2nd DAWR (second watchpoint) and also removed
> >> a restriction that limit the watch region to 512 bytes.
> >>
> >> 2020-11-08  Rogerio A. Cardoso  <rcardoso@linux.ibm.com>
> >>
> >> gdb/
> >>
> >> * ppc-linux-nat.c: (PPC_DEBUG_FEATURE_DATA_BP_ARCH_31): New define.
> >> (region_ok_for_hw_watchpoint): Check if 2nd DAWR is avaliable before set
> >> region.
> > 
> > This doesn't look correct, the patch not only removes the alignment
> > requirement but actually removes support for 512 bytes ranges itself!
> > 
> 
> The patch doesn't remove the support. If we are using the second 
> watchpoint (PPC_DEBUG_FEATURE_DATA_BP_ARCH_31) we don't limit the 
> region_size to 512 (region_size = 512) instead we use 
> hwdebug_info.data_bp_alignment right? Isn't region_size that create a 
> 512-byte bondary?

hwdebug_info.data_bp_alignment is the required *alignment*, which
remains 8 for Power10.

I think the problem is that until now, the maximum size was always
equal to the required alignment (on Power8: alignment 8, size 8;
on Power9: alignment 512, size 512), but on Power10 they are now
different: alignment 8, size 512.

> > I think for P10 we need to continue to allow watched ranges up to
> > 512 bytes in size, but they only need to be 8 byte aligned now and
> > may cross a 512-byte boundary.
> > 
> 
> Since the else case is region_size = hwdebug_info.data_bp_alignment;
> I guess this is what it do unless I am missing something here.

We'll probably have to use two different variables for size and
alignment now, update the test accordingly, and set the values as
above.

Given the size and alignment value, and given a range start address,
the maximum allowable end can be found by rounding the start address
*down* to the required alignment, and then adding the maximum size.

For example, if we have a start address of 0x1234, then the maximum
end address on P9 is 0x1400, but on P10 it would be 0x1430.

(With your patch as-is, it would reset to the P8 values, where the
maximum end address is only 0x1238.)

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

      reply	other threads:[~2020-11-10 10:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09  2:12 Rogerio Alves via Gdb-patches
2020-11-09 10:24 ` Ulrich Weigand via Gdb-patches
2020-11-09 13:08   ` Rogerio Alves via Gdb-patches
2020-11-10 10:21     ` Ulrich Weigand via Gdb-patches [this message]

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=20201110102159.GA23382@oc3748833570.ibm.com \
    --to=gdb-patches@sourceware.org \
    --cc=pedromfc@linux.ibm.com \
    --cc=rcardoso@linux.ibm.com \
    --cc=uweigand@de.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