From: "Willgerodt, Felix" <felix.willgerodt@intel.com>
To: "Schimpe, Christina" <christina.schimpe@intel.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH v4 2/2] LAM: Enable tagged pointer support for watchpoints.
Date: Thu, 4 Jul 2024 12:37:54 +0000 [thread overview]
Message-ID: <MN2PR11MB45668966AF681E29EB9D800C8EDE2@MN2PR11MB4566.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20240704101736.3074236-3-christina.schimpe@intel.com>
> -----Original Message-----
> From: Schimpe, Christina <christina.schimpe@intel.com>
> Sent: Donnerstag, 4. Juli 2024 12:18
> To: gdb-patches@sourceware.org
> Cc: Willgerodt, Felix <felix.willgerodt@intel.com>; luis.machado@arm.com
> Subject: [PATCH v4 2/2] LAM: Enable tagged pointer support for watchpoints.
>
> From: Christina Schimpe <christina.schimpe@intel.com>
>
> The Intel (R) linear address masking (LAM) feature modifies the checking
> applied to 64-bit linear addresses. With this so-called "modified
> canonicality check" the processor masks the metadata bits in a pointer
> before using it as a linear address. LAM supports two different modes that
> differ regarding which pointer bits are masked and can be used for
> metadata: LAM 48 resulting in a LAM width of 15 and LAM 57 resulting in a
> LAM width of 6.
>
> This patch adjusts watchpoint addresses based on the currently enabled
> LAM mode using the untag mask provided in the /proc/<pid>/status file.
> As LAM can be enabled at runtime or as the configuration may change
> when entering an enclave, GDB checks enablement state each time a watchpoint
> is updated.
>
> In contrast to the patch implemented for ARM's Top Byte Ignore "Clear
> non-significant bits of address on memory access", it is not necessary to
> adjust addresses before they are passed to the target layer cache, as
> for LAM tagged pointers are supported by the system call to read memory.
> Additionally, LAM applies only to addresses used for data accesses.
> Thus, it is sufficient to mask addresses used for watchpoints.
>
> The following examples are based on a LAM57 enabled program.
> Before this patch tagged pointers were not supported for watchpoints:
> ~~~
> (gdb) print pi_tagged
> $2 = (int *) 0x10007ffffffffe004
> (gdb) watch *pi_tagged
> Hardware watchpoint 2: *pi_tagged
> (gdb) c
> Continuing.
> Couldn't write debug register: Invalid argument.
> ~~~~
>
> Once LAM 48 or LAM 57 is enabled for the current program, GDB can now
> specify watchpoints for tagged addresses with LAM width 15 or 6,
> respectively.
> ---
> gdb/NEWS | 2 +
> gdb/amd64-linux-tdep.c | 64 ++++++++++++++++++++++++++++
> gdb/testsuite/gdb.arch/amd64-lam.c | 49 +++++++++++++++++++++
> gdb/testsuite/gdb.arch/amd64-lam.exp | 46 ++++++++++++++++++++
> gdb/testsuite/lib/gdb.exp | 63 +++++++++++++++++++++++++++
> 5 files changed, 224 insertions(+)
> create mode 100755 gdb/testsuite/gdb.arch/amd64-lam.c
> create mode 100644 gdb/testsuite/gdb.arch/amd64-lam.exp
Approved-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-07-04 12:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-04 10:17 [PATCH v4 0/2] Add amd64 LAM watchpoint support Schimpe, Christina
2024-07-04 10:17 ` [PATCH v4 1/2] gdb: Make tagged pointer support configurable Schimpe, Christina
2024-07-04 10:17 ` [PATCH v4 2/2] LAM: Enable tagged pointer support for watchpoints Schimpe, Christina
2024-07-04 12:37 ` Willgerodt, Felix [this message]
2024-07-04 12:52 ` Eli Zaretskii
2024-07-04 13:05 ` Schimpe, Christina
2024-07-04 13:15 ` Schimpe, Christina
2024-07-04 14:06 ` Eli Zaretskii
2024-07-05 8:53 ` Schimpe, Christina
2024-07-05 10:47 ` Eli Zaretskii
2024-07-08 8:52 ` Schimpe, Christina
2024-07-08 11:42 ` Eli Zaretskii
2024-07-08 14:25 ` Schimpe, Christina
2024-07-08 14:53 ` Eli Zaretskii
2024-07-08 14:57 ` Schimpe, Christina
2024-07-04 14:02 ` Eli Zaretskii
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=MN2PR11MB45668966AF681E29EB9D800C8EDE2@MN2PR11MB4566.namprd11.prod.outlook.com \
--to=felix.willgerodt@intel.com \
--cc=christina.schimpe@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