[PATCH v8] gdb: ADI support

Jose E. Marchesi jose.marchesi@oracle.com
Wed Aug 23 17:29:00 GMT 2017


           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.



More information about the Gdb-patches mailing list