From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6701 invoked by alias); 28 Nov 2013 10:54:52 -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 6689 invoked by uid 89); 28 Nov 2013 10:54:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=AWL,BAYES_50,RDNS_NONE,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mga01.intel.com Received: from Unknown (HELO mga01.intel.com) (192.55.52.88) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 28 Nov 2013 10:54:50 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 28 Nov 2013 02:54:25 -0800 X-ExtLoop1: 1 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 28 Nov 2013 02:54:05 -0800 Received: from ulvlx001.iul.intel.com (ulvlx001.iul.intel.com [172.28.207.17]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id rASAs4xD024063; Thu, 28 Nov 2013 10:54:04 GMT Received: from ulvlx001.iul.intel.com (localhost [127.0.0.1]) by ulvlx001.iul.intel.com with ESMTP id rASAs4hu010863; Thu, 28 Nov 2013 11:54:04 +0100 Received: (from wtedesch@localhost) by ulvlx001.iul.intel.com with œ id rASAs4tA010859; Thu, 28 Nov 2013 11:54:04 +0100 From: Walfred Tedeschi To: palves@redhat.com, eliz@gnu.org Cc: gdb-patches@sourceware.org, Walfred Tedeschi Subject: [PATCH v2 1/1] Documentation for MPX. Date: Thu, 28 Nov 2013 12:21:00 -0000 Message-Id: <1385636042-10592-1-git-send-email-walfred.tedeschi@intel.com> X-IsSubscribed: yes X-SW-Source: 2013-11/txt/msg00878.txt.bz2 Hello Eli and Pedro, I tried to cover all feedback you gave me. Concerning the footnote I have reduced it to avoid early confusion, the topic will be explained anyhow later. Thanks a lot for your review, -Fred Pedro: I am just back from christmas as you can see. :-) 2013-11-28 Walfred Tedeschi * NEWS: Add section for Intel(R) Architecture Instructions Extesions mentioning MPX. doc/ * gdb.texinfo (i386 Features): Add MPX feature registers. (x86 Specific featuresx86 Architecture-specific Issues): Adds a subsubsection for MPX and describes the display of the boundary registers. --- gdb/NEWS | 2 ++ gdb/doc/gdb.texinfo | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/gdb/NEWS b/gdb/NEWS index 9fc3638..fdb33d4 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -5558,3 +5558,5 @@ GDB now handles cross debugging. If you are remotely debugging between two different machines, type ``./configure host -target=targ''. Host is the machine where GDB will run; targ is the machine where the program that you are debugging will run. + + * GDB now supports access to Intel(R) MPX registers on GNU/Linux. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index d854f46..7eacba2 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -21363,6 +21363,40 @@ be returned in a register. @kindex show struct-convention Show the current setting of the convention to return @code{struct}s from functions. + +@cindex Intel(R) Memory Protection Extensions (MPX). +@subsubsection Intel(R) @dfn{Memory Protection Extensions} (MPX). + +@item bnd0raw..bnd3raw and bnd0@dots{}bnd3 registers display. +Memory Protection Extension (MPX) adds the bound registers @samp{BND0} +@footnote{The register named with capital letters represent the architecture +registers.} through @samp{BND3}. Bound registers store a pair of 64-bit values +which are the lower bound and upper bound. Bounds are effective addresses or +memory locations. The upper bounds are architecturally represented in 1's +complement form. A bound having lower bound = 0, and upper bound = 0 +(1's complement of all bits set) will allow access to the entire address space. + +Architecture registers @samp{BND0} through @samp{BND3} are +represented in @value{GDBN} as @samp{bnd0raw} through @samp{bnd3raw}. +Pseudo registers @samp{bnd0} through @samp{bnd3} display the upper bound +performing the complement of one operation on the upper bound value, i.e.@ +when upper bound in @samp{bnd0raw} is 0 in the @value{GDBN} @samp{bnd0} it will +be @code{0xfff@dots{}}. In this sense it can also be noted that the upper bounds are +inclusive. + +As an example, assume that the register BND0 holds bounds for a pointer having +access allowed for the range between 0x32 and 0x71. The values present on +bnd0raw and bnd registers are presented as follows: + +@smallexample + bnd0raw = @{0x32, 0xffffffff8e@} + bnd0 = @{lbound = 0x32, ubound = 0x71@} : size 64 +@end smallexample + +This way the raw value can be accessed via bnd0raw@dots{}bnd3raw. Any change +on bnd0@dots{}bnd3 or bnd0raw@dots{}bnd3raw is reflect on its counterpart. When the +bnd0@dots{}bnd3 registers are displayed via Python, the display includes the memory size, +in bits, accessible to the pointer. @end table @node Alpha @@ -43138,6 +43172,16 @@ describe the upper 128 bits of @sc{ymm} registers: @samp{ymm0h} through @samp{ymm15h} for amd64 @end itemize +The @samp{org.gnu.gdb.i386.mpx} is an optional feature representing Intel(R) +Memory Protection Extension (MPX). It should describe the following registers: + +@itemize @minus +@item +@samp{bnd0raw} through @samp{bnd3raw} for i386 and amd64. +@item +@samp{bndcfgu} and @samp{bndstatus} for i386 and amd64. +@end itemize + The @samp{org.gnu.gdb.i386.linux} feature is optional. It should describe a single register, @samp{orig_eax}. -- 1.8.1.2