public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Schimpe, Christina" <christina.schimpe@intel.com>
To: "Willgerodt, Felix" <felix.willgerodt@intel.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH 2/3] LAM: Enable tagged pointer support for watchpoints.
Date: Wed, 22 May 2024 15:17:40 +0000	[thread overview]
Message-ID: <SN7PR11MB7638808230B097B8E9A78478F9EB2@SN7PR11MB7638.namprd11.prod.outlook.com> (raw)
In-Reply-To: <MN2PR11MB4566155AA48FA4A15BAFB04C8EEB2@MN2PR11MB4566.namprd11.prod.outlook.com>

> > /* Adjust watchpoint address based on the tagging mode which is currently
> >    enabled.  For amd64, we adjust the watchpoint address based on the
> >    currently active linear address masking (LAM) mode using the untag
> >    mask.  Check each time for a new mask, as LAM is enabled at runtime.
> >    Also, the LAM configuration may change when entering an enclave.
> > */
> 
> I still find that a bit long and cumbersome. Can we merge the first and second
> sentence somehow? To me they say the same thing with varying level of details.
> And I don't think we need to say "for amd64", we are in an
> amd64 file.
> 
> And I would drop the enclaves sentence, from GDB perspective it is just another
> type of change at runtime.
> 

Ok, thanks. Will write it as follows then:

Adjust watchpoint address based on the currently active linear address masking
(LAM) mode using the untag mask.  Check each time for a new mask, as LAM is
enabled at runtime.

> > > > +gdb_breakpoint [gdb_get_line_number "Breakpoint here"]
> > > > +gdb_continue_to_breakpoint "Breakpoint here"
> > > > +
> > > > +# Test hw watchpoint for tagged and untagged address with hit on
> > > > +untagged # and tagged adress.
> > > > +foreach symbol {"pi" "pi_tagged"} {
> > > > +    gdb_test "watch *${symbol}"
> > > > +    gdb_test "continue" \
> > > > +	"Continuing\\..*Hardware watchpoint \[0-9\]+.*" \
> > > > +	"run until watchpoint on ${symbol}"
> > > > +    gdb_test "continue" \
> > > > +	"Continuing\\..*Hardware watchpoint \[0-9\]+.*" \
> > > > +	"run until watchpoint on ${symbol}, 2nd hit"
> > > > +    delete_breakpoints
> > > > +}
> > >
> > > I would add a short comment on why we test hitting the watchpoint twice.
> >
> > Hm, I am not sure which information you exactly miss here.
> > Note, that this code is very similar to the code in
> > "gdb.arch/aarch64-tagged- pointer.exp"
> > They have a longer comment:
> >
> > # sp1 and p1 are untagged pointers, but sp2 and p2 are tagged pointers.
> > # Cycle through all of them to make sure the following combinations work:
> > #
> > # hw watch on untagged address, hit on untagged address.
> > # hw watch on tagged address, hit on untagged address.
> > # hw watch on untagged address, hit on tagged address.
> > # hw watch on tagged address, hit on tagged address.
> >
> > But I would have hoped that this is covered by the existent comment:
> >
> > # Test hw watchpoint for tagged and untagged address with hit on
> > untagged # and tagged address.
> >
> > What exactly do you miss?
> 
> I missed that your comment is supposed to cover that.
> You could add an "each", e.g. something like "with a hit on a tagged and
> untagged address each". I think that would already help a lot.

Ok, I will improve the comment as follows then:

Test hw watchpoint for a tagged and an untagged address with hit on a tagged
and an untagged address each.

> And should it be addresses (plural)?

Mh, I don't think so. I added "a" and "an", please see my example above.

Christina 
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Sean Fennelly, Jeffrey Schneiderman, Tiffany Doon Silva
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

  reply	other threads:[~2024-05-22 15:17 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27  7:47 [PATCH 0/3] Add amd64 LAM watchpoint support Schimpe, Christina
2024-03-27  7:47 ` [PATCH 1/3] gdb: Make tagged pointer support configurable Schimpe, Christina
2024-03-28 11:58   ` Luis Machado
2024-04-04  8:18     ` Schimpe, Christina
2024-04-04  8:50       ` Luis Machado
2024-04-24 11:10   ` Willgerodt, Felix
2024-05-17 13:40     ` Schimpe, Christina
2024-05-22 13:37       ` Willgerodt, Felix
2024-03-27  7:47 ` [PATCH 2/3] LAM: Enable tagged pointer support for watchpoints Schimpe, Christina
2024-03-27 12:37   ` Eli Zaretskii
2024-03-28 12:50   ` Luis Machado
2024-04-24 11:11   ` Willgerodt, Felix
2024-05-17 14:05     ` Schimpe, Christina
2024-05-22 13:37       ` Willgerodt, Felix
2024-05-22 15:17         ` Schimpe, Christina [this message]
2024-03-27  7:47 ` [PATCH 3/3] LAM: Support kernel space debugging Schimpe, Christina
2024-04-24 11:11   ` Willgerodt, Felix
2024-05-17 14:07     ` Schimpe, Christina
2024-06-03 16:37       ` [PING][PATCH " Schimpe, Christina
2024-04-15 11:26 ` [PING][PATCH 0/3] Add amd64 LAM watchpoint support Schimpe, Christina
2024-04-22  7:17   ` [PING*2][PATCH " Schimpe, Christina

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=SN7PR11MB7638808230B097B8E9A78478F9EB2@SN7PR11MB7638.namprd11.prod.outlook.com \
    --to=christina.schimpe@intel.com \
    --cc=felix.willgerodt@intel.com \
    --cc=gdb-patches@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).