From: jose.marchesi@oracle.com (Jose E. Marchesi)
To: Weimin Pan <weimin.pan@oracle.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v8] gdb: ADI support
Date: Wed, 23 Aug 2017 17:29:00 -0000 [thread overview]
Message-ID: <87tw0ytcq7.fsf@oracle.com> (raw)
In-Reply-To: <87fuciacc5.fsf@oracle.com> (Jose E. Marchesi's message of "Wed, 23 Aug 2017 10:59:54 +0200")
The M7 processor supports an Application Data Integrity (ADI) feature
that detects invalid data accesses. When software allocates data, it
chooses a 4-bit version number, sets the version in the upper 4 bits
of the 64-bit pointer to that data, and stores the 4-bit version in
every cacheline of the object. Hardware saves the latter in spare
bits in the cache and memory hierarchy. On each load and store, the
processor compares the upper 4 VA (virtual address) bits to the
cacheline's version. If there is a mismatch, the processor generates
a version mismatch trap which can be either precise or disrupting.
The trap is an error condition which the kernel delivers to the process
as a SIGSEGV signal.
The upper 4 bits of the VA represent a version and are not part of the
true address. The processor clears these bits and sign extends bit 59
to generate the true address.
Note that 32-bit applications cannot use ADI.
This patch adds ADI support in gdb which allows the user to examine
current version tags and assign new version tags in the program.
It also catches and reports precise or disrupting memory corruption
traps.
Tested in sparc64-linux-gnu. No regressions.
I just committed this on your behalf, as approved by Yao.
Salud!
Ugh, Sergio's builder found that the patch breaks the build of the
sparc64 target in 32-bit hosts:
<https://gdb-build.sergiodj.net/builders/Ubuntu-AArch32-native-gdbserver-m32/builds/1185/steps/compile%20gdb/logs/stdio>
Seems like the `blksize' field in the struct `adi_stat_t' is defined as
unsigned long, which doesn't correspond to CORE_ADDR in these hosts.
Weimin, can you please take a look and submit a fix for this? You can
reproduce the problem building with -m32 in sparc64.
prev parent reply other threads:[~2017-08-23 17:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-22 22:31 Weimin Pan
2017-08-23 9:02 ` Jose E. Marchesi
2017-08-23 17:29 ` Jose E. Marchesi [this message]
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=87tw0ytcq7.fsf@oracle.com \
--to=jose.marchesi@oracle.com \
--cc=gdb-patches@sourceware.org \
--cc=weimin.pan@oracle.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