public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Luis Machado <luis.machado@arm.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] [gdb/tdep] Fix gdb.base/watchpoint-unaligned.exp on aarch64
Date: Wed, 13 Mar 2024 18:12:16 +0100	[thread overview]
Message-ID: <188e8db7-c6c7-4177-aefb-fdb7a0e7edce@suse.de> (raw)
In-Reply-To: <e17e51ac-6170-43a7-9491-878c8727e7dd@arm.com>

On 3/7/24 11:50, Luis Machado wrote:
> Hi Tom,
> 
> Raising the alignment enforcement means we will cover a bigger range of addresses, potentially covering our target watchpoint/trap address,
> but I'm afraid it also means we will raise the potential for false positives, if watchpoints are placed within the alignment range.
> 

True.  I've submitted a v2 that should address that, by limiting the 
impact of the patch to regular hw watchpoints.

> Furthermore, we are not limited to 16-byte accesses. For SVE and SME we may be looking at even bigger accesses. And, more generally, the memset/memcpy
> instructions (not yet widely used) can potentially access arbitrary amounts of memory. So tweaking the alignment is only a focused fix towards the most often
> used instructions and access sizes at the moment.
> 

I don't have access atm to an SVE or SME or MOPS machine.

We can guess that those larger accesses will cause issues, but we don't 
know until we try.  For instance, in the case of the stp instruction, it 
didn't cause issues with say a RK3399 SOC, but it did with an M1 SOC, so 
just the existence of larger accesses doesn't mean there are issues.

> The more general problem of not being able to tell which particular watchpoint caused the trap remains.
>

Yes.  I think we need to file a linux kernel bug for this.  I looked for 
one and didn't find it.  My current idea for a concrete solution for 
this is that the kernel should communicate back the state of the 2 debug 
registers (control and value) for which it thinks the watchpoint 
triggered.  That should resolve any ambiguity on the user space side.

> How does the above fix behave on the overall testsuite in terms of watchpoint tests?

The v2, as the v1, fixes the test-case and doesn't cause regressions.

Thanks,
- Tom

  parent reply	other threads:[~2024-03-13 17:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20 20:54 Tom de Vries
2024-02-20 20:54 ` [PATCH 2/2] [gdb/tdep] Fix gdb.base/watch-bitfields.exp " Tom de Vries
2024-03-07 12:11   ` Luis Machado
2024-03-11 15:04     ` Tom de Vries
2024-03-11 15:12       ` Luis Machado
2024-03-12 16:19         ` Tom de Vries
2024-03-12 16:01     ` Tom de Vries
2024-03-07 10:50 ` [PATCH 1/2] [gdb/tdep] Fix gdb.base/watchpoint-unaligned.exp " Luis Machado
2024-03-07 20:19   ` Thiago Jung Bauermann
2024-03-08  1:26     ` Luis Machado
2024-03-12 16:49       ` Tom de Vries
2024-03-13 17:12   ` Tom de Vries [this message]
2024-03-14 10:19     ` Luis Machado

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=188e8db7-c6c7-4177-aefb-fdb7a0e7edce@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=luis.machado@arm.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).