From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25329 invoked by alias); 23 Aug 2017 09:02:45 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 50499 invoked by uid 89); 23 Aug 2017 09:00:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=no version=3.3.2 spammy=salud X-HELO: userp1040.oracle.com Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 Aug 2017 09:00:09 +0000 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v7N8xxEr024510 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 23 Aug 2017 09:00:00 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v7N8xxqj010748 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 23 Aug 2017 08:59:59 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v7N8xwT7001006 for ; Wed, 23 Aug 2017 08:59:59 GMT Received: from termi.oracle.com (/85.180.184.26) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 23 Aug 2017 01:59:58 -0700 From: jose.marchesi@oracle.com (Jose E. Marchesi) To: Weimin Pan Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v8] gdb: ADI support References: <1503440369-113905-1-git-send-email-weimin.pan@oracle.com> Date: Wed, 23 Aug 2017 09:02:00 -0000 In-Reply-To: <1503440369-113905-1-git-send-email-weimin.pan@oracle.com> (Weimin Pan's message of "Tue, 22 Aug 2017 17:19:29 -0500") Message-ID: <87fuciacc5.fsf@oracle.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2017-08/txt/msg00432.txt.bz2 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!