Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Gustavo Romero <gustavo.romero@linaro.org>
To: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Cc: gdb-patches@sourceware.org, luis.machado@arm.com
Subject: Re: [PATCH v2 1/4] gdb: aarch64: Remove MTE address checking from get_memtag
Date: Thu, 4 Apr 2024 02:15:27 -0300	[thread overview]
Message-ID: <c2251339-173c-5e09-41e7-2668ec2614cd@linaro.org> (raw)
In-Reply-To: <87h6go8rn7.fsf@linaro.org>

Hi Thiago,

On 3/29/24 9:55 PM, Thiago Jung Bauermann wrote:
> Thiago Jung Bauermann <thiago.bauermann@linaro.org> writes:
> 
>> Gustavo Romero <gustavo.romero@linaro.org> writes:
>>
>>> This commit removes aarch64_linux_tagged_address_p from
>>> aarch64_linux_get_memtag. aarch64_linux_tagged_address_p checks if an
>>> address is tagged (MTE) or not.
>>>
>>> The check is redundant because aarch64_linux_get_memtag is always called
>>> from the upper layers (i.e. from printcmd.c via gdbarch hook
>>> gdbarch_get_memtag) after either gdbarch_tagged_address_p (that already
>>> points to aarch64_linux_tagged_address_p) has been called or
>>> after should_validate_memtags (that calls gdbarch_tagged_address_p at
>>> the end) has been called, so the address is already checked. Hence:
>>>
>>> a) in print_command_1, aarch64_linux_get_memtag (via gdbarch_get_memtag
>>> hook) is called but only after should_validate_memtags, which calls
>>> gdbarch_tagged_address_p;
>>>
>>> b) in do_examine, aarch64_linux_get_memtag is also called only after
>>> gdbarch_tagged_address_p is directly called;
>>>
>>> c) in memory_tag_check_command, gdbarch_get_memtag is called -- tags
>>> matching or not -- after the initial check via direct call to
>>> gdbarch_tagged_address_p;
>>>
>>> d) in memory_tag_print_tag_command, address is checked directly via
>>> gdbarch_tagged_address_p before gdbarch_get_memtag is called.
>>
>> In cases c) and d), gdbarch_get_memtag gets called even if
>> gdbarch_tagged_address_p returns false, so won't this commit change the
>> behaviour of those functions in that case? I don't know enough about MTE
>> to be sure.
> 
> I just realised that in cases c) and d) an error will be thrown by
> show_addr_not_tagged if gdbarch_tagged_address_p returns false, so
> gdbarch_get_memtag doesn't get called in that case and my concern isn't
> valid. Sorry about that.

Yeah. No worries, I also missed that show_addr_not_tagged throws an error
the first time I read this part, it looked like just printing function :)


> Reviewed-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>

Thanks for the review.


Cheers,
Gustavo

  reply	other threads:[~2024-04-04  5:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28 22:48 [PATCH v2 0/4] Add another way to check for MTE-tagged addresses on remote targets Gustavo Romero
2024-03-28 22:48 ` [PATCH v2 1/4] gdb: aarch64: Remove MTE address checking from get_memtag Gustavo Romero
2024-03-30  0:37   ` Thiago Jung Bauermann
2024-03-30  0:55     ` Thiago Jung Bauermann
2024-04-04  5:15       ` Gustavo Romero [this message]
2024-03-28 22:48 ` [PATCH v2 2/4] gdb: aarch64: Move MTE address check out of set_memtag Gustavo Romero
2024-03-30  0:47   ` Thiago Jung Bauermann
2024-04-04  5:25     ` Gustavo Romero
2024-04-06  1:55       ` Thiago Jung Bauermann
2024-03-28 22:48 ` [PATCH v2 3/4] gdb: aarch64: Remove MTE address checking from memtag_matches_p Gustavo Romero
2024-03-30  2:53   ` Thiago Jung Bauermann
2024-03-28 22:48 ` [PATCH v2 4/4] gdb: Add new remote packet to check if address is tagged Gustavo Romero
2024-03-29 23:35   ` Thiago Jung Bauermann
2024-04-04  5:32     ` Gustavo Romero
2024-03-30  3:08   ` Thiago Jung Bauermann
2024-04-03 14:04     ` Luis Machado
2024-04-03 16:39       ` Gustavo Romero
2024-04-03 11:51 ` [PATCH v2 0/4] Add another way to check for MTE-tagged addresses on remote targets Luis Machado
2024-04-03 14:29   ` Gustavo Romero
2024-04-03 14:39     ` Luis Machado
2024-04-04  5:35       ` Gustavo Romero

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=c2251339-173c-5e09-41e7-2668ec2614cd@linaro.org \
    --to=gustavo.romero@linaro.org \
    --cc=gdb-patches@sourceware.org \
    --cc=luis.machado@arm.com \
    --cc=thiago.bauermann@linaro.org \
    /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