From: "Willgerodt, Felix" <felix.willgerodt@intel.com>
To: "Schimpe, Christina" <christina.schimpe@intel.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: "eliz@gnu.org" <eliz@gnu.org>,
"luis.machado@arm.com" <luis.machado@arm.com>
Subject: RE: [PATCH v2 1/3] gdb: Make tagged pointer support configurable.
Date: Mon, 3 Jun 2024 07:58:20 +0000 [thread overview]
Message-ID: <MN2PR11MB456687121B350A99701E46308EFF2@MN2PR11MB4566.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20240527102423.1361410-2-christina.schimpe@intel.com>
> -----Original Message-----
> From: Schimpe, Christina <christina.schimpe@intel.com>
> Sent: Montag, 27. Mai 2024 12:24
> To: gdb-patches@sourceware.org
> Cc: Willgerodt, Felix <felix.willgerodt@intel.com>; eliz@gnu.org;
> luis.machado@arm.com
> Subject: [PATCH v2 1/3] gdb: Make tagged pointer support configurable.
>
> From: Christina Schimpe <christina.schimpe@intel.com>
>
> The gdbarch function gdbarch_remove_non_address_bits adjusts addresses
> to
> enable debugging of programs with tagged pointers on Linux, for instance for
> ARM's feature top byte ignore (TBI).
> Once the function is implemented for an architecture, it adjusts addresses for
> memory access, breakpoints and watchpoints.
>
> Linear address masking (LAM) is Intel's (R) implementation of tagged
> pointer support. It requires certain adaptions to GDB's tagged pointer
> support due to the following:
> - LAM supports address tagging for data accesses only. Thus, specifying
> breakpoints on tagged addresses is not a valid use case.
> - In contrast to the implementation for ARM's TBI, the Linux kernel supports
> tagged pointers for memory access.
>
> This patch makes GDB's tagged pointer support configurable such that it is
> possible to enable the address adjustment for a specific feature only (e.g
> memory access, breakpoints or watchpoints). This way, one can make sure
> that addresses are only adjusted when necessary. In case of LAM, this
> avoids unnecessary parsing of the /proc/<pid>/status file to get the
> untag mask.
> ---
> gdb/aarch64-linux-nat.c | 2 +-
> gdb/aarch64-linux-tdep.c | 13 ++++----
> gdb/aarch64-tdep.c | 17 +++++-----
> gdb/aarch64-tdep.h | 6 ++++
> gdb/breakpoint.c | 5 +--
> gdb/gdbarch-gen.h | 49 ++++++++++++++++++++++-------
> gdb/gdbarch.c | 66 ++++++++++++++++++++++++++++++++-------
> gdb/gdbarch_components.py | 53 ++++++++++++++++++++++++++-----
> gdb/target.c | 3 +-
> 9 files changed, 167 insertions(+), 47 deletions(-)
>
> diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
> index 8d0553f3d7c..af62d3ae1ec 100644
> --- a/gdb/aarch64-tdep.c
> +++ b/gdb/aarch64-tdep.c
> @@ -4086,10 +4086,7 @@ aarch64_stack_frame_destroyed_p (struct
> gdbarch *gdbarch, CORE_ADDR pc)
> return streq (inst.opcode->name, "ret");
> }
>
> -/* AArch64 implementation of the remove_non_address_bits gdbarch hook.
> Remove
> - non address bits from a pointer value. */
> -
> -static CORE_ADDR
> +CORE_ADDR
> aarch64_remove_non_address_bits (struct gdbarch *gdbarch, CORE_ADDR
> pointer)
Shouldn't there still be some sort of comment for this function in the c file?
At least some "see header file"? Though it seems like no function in aarch64-tdep.h
has any comment, and all comments are in aarch64-tdep.c. I would also be fine
with that for consistency. Maybe Luis can comment how he prefers it.
But I am fine with this patch. Let's see if someone else objects this split.
Reviewed-By: Felix Willgerodt <felix.willgerodt@intel.com>
Thanks,
Felix
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
next prev parent reply other threads:[~2024-06-03 7:59 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-27 10:24 [PATCH v2 0/3] Add amd64 LAM watchpoint support Schimpe, Christina
2024-05-27 10:24 ` [PATCH v2 1/3] gdb: Make tagged pointer support configurable Schimpe, Christina
2024-06-03 7:58 ` Willgerodt, Felix [this message]
2024-06-03 8:40 ` Schimpe, Christina
2024-06-03 13:29 ` Luis Machado
2024-06-03 14:13 ` Schimpe, Christina
2024-06-10 14:00 ` Luis Machado
2024-06-10 15:05 ` Schimpe, Christina
2024-06-14 9:38 ` Schimpe, Christina
2024-06-14 9:54 ` Schimpe, Christina
2024-06-14 10:09 ` Luis Machado
2024-05-27 10:24 ` [PATCH v2 2/3] LAM: Enable tagged pointer support for watchpoints Schimpe, Christina
2024-06-03 7:58 ` Willgerodt, Felix
2024-06-03 12:04 ` Schimpe, Christina
2024-06-03 12:48 ` Willgerodt, Felix
2024-06-03 14:25 ` Schimpe, Christina
2024-05-27 10:24 ` [PATCH v2 3/3] LAM: Support kernel space debugging 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=MN2PR11MB456687121B350A99701E46308EFF2@MN2PR11MB4566.namprd11.prod.outlook.com \
--to=felix.willgerodt@intel.com \
--cc=christina.schimpe@intel.com \
--cc=eliz@gnu.org \
--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