This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v8] gdb: ADI support
- From: jose dot marchesi at oracle dot com (Jose E. Marchesi)
- To: Weimin Pan <weimin dot pan at oracle dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 23 Aug 2017 10:59:54 +0200
- Subject: Re: [PATCH v8] gdb: ADI support
- Authentication-results: sourceware.org; auth=none
- References: <1503440369-113905-1-git-send-email-weimin.pan@oracle.com>
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!