This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gdb: ADI support


On 14.6.2017 02:05, Weimin Pan wrote:
>    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.
> 
> gdb/ChangeLog:
> 2017-06-13  Weimin Pan  <weimin.pan@oracle.com>
> 
> 	* sparc64-tdep.h: (adi_normalize_address): New export.
> 	* sparc64-adi-tdep.c: New file.
> 	* Makefile.in (ALLDEPFILES): Add sparc64-adi-tdep.c.
> 	* configure.tgt: Add sparc64-adi-tdep.o.
> 	* sparc64-linux-nat.c:
> 	(sparc64_linux_watchpoint_addr_within_range): New function.
> 	(_initialize_sparc64_linux_nat): Register sparc64_linux_watchpoint_addr_within_range.
> 	* sparc64-linux-tdep.c: Include <adi.h>.
> 	(sparc64_linux_handle_segmentation_fault): New function.
> 	(sparc64_linux_init_abi): Register sparc64_linux_handle_segmentation_fault
> 	* sparc64-tdep.c: (sparc64_pstate_type): Replace PID1 with MCDE.
> gdb/doc/ChangeLog:
> 2017-06-13  Weimin Pan  <weimin.pan@oracle.com>
> 	* gdb.texinfo (Architectures): Add new Sparc64 section to document ADI support.

Please note that the patch has been reviewed internally by other Oracle
folks, mainly from the functional point of view. We would be glad to
have more eyeballs reviewing the patch, especially from the formal point
of view.

I.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]