From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50641 invoked by alias); 3 Mar 2016 11:04:38 -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 50613 invoked by uid 89); 3 Mar 2016 11:04:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=violations, H*r:ip*10.253.24.23, H*RU:HELO, Hx-spam-relays-external:HELO X-HELO: mga09.intel.com Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 03 Mar 2016 11:04:36 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 03 Mar 2016 03:04:11 -0800 X-ExtLoop1: 1 Received: from wtedesch-mobl2.ger.corp.intel.com (HELO [172.28.205.68]) ([172.28.205.68]) by fmsmga001.fm.intel.com with ESMTP; 03 Mar 2016 03:04:09 -0800 Subject: Re: [PATCH V4 2/2] Add mpx-bnd-init-on-return set/show command for inferior calls. To: Eli Zaretskii References: <1456935689-1820-1-git-send-email-walfred.tedeschi@intel.com> <1456935689-1820-3-git-send-email-walfred.tedeschi@intel.com> <83ziug6dnw.fsf@gnu.org> Cc: palves@redhat.com, brobecker@adacore.com, gdb-patches@sourceware.org From: Walfred Tedeschi Message-ID: <56D81A29.3040007@intel.com> Date: Thu, 03 Mar 2016 11:04:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <83ziug6dnw.fsf@gnu.org> Content-Type: text/plain; charset="iso-8859-15"; format="flowed" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00045.txt.bz2 Am 3/2/2016 um 5:35 PM schrieb Eli Zaretskii: >> From: Walfred Tedeschi >> Cc: gdb-patches@sourceware.org, Walfred Tedeschi >> Date: Wed, 2 Mar 2016 17:21:29 +0100 >> >> +While the using the @command{return} bounds can propagate through >> +execution causing a boundary violation. > > This sentence needs to be rephrased. > >> +@kindex set mpx-bnd-init-on-return >> +When set to true bound registers will be set to the INIT state when >> +using the "return" command. >> +@kindex show mpx-bnd-init-on-return >> +Show the state of mpx-bnd-init-on-return. > > This last sentence should explain what is shown; just referring to the > variable name doesn't do the job. > >> + add_setshow_boolean_cmd ("mpx-bnd-init-on-return", no_class, >> + &mpx_bnd_init_on_return, _("\ >> + Set the bnd registers to INIT state when returning from a call."), _("\ >> + Show the state of the mpx-bnd-init-on-return."), > > For the 'show" part, we usually use the following wording: > > Show whether to set the bnd registers to INIT state when returning fro= m a call. > > > Thanks. > Eli, Some of your previous comment's were forgotten sorry for that. They were=20 absolutely valid. Documentation part for the new patch will be: NEWS: show mpx-bnd-init-on-return set mpx-bnd-init-on-return on i386 and amd64 In case MPX-BND-INIT-ON-RETURN is true, bound registers will be initialized when the "return" command is used. gdb.texinfo: While calling functions from the debugger, of an Intel MPX enabled program, boundary registers have to be set to the INIT state before performing the call, to avoid boundary violations while performing the call. A bound is defined to be in the INIT state when the pointer associated to that boundary can access the whole memory, in this case the register bound register associated to it has value 0, e.g. if the register associated is bnd0raw its value will be @{0x0, 0x0@}. When you use the @code{return} command, the bound registers might cause boundary violations because they were not updated for the early return from the function. To countermand that, @value{GDBN} can force initialization of the bound registers when it performs the @code{return} command. This is controlled by the following option: @table @code @kindex set mpx-bnd-init-on-return When set to true bound registers will be set to the INIT state when using the "return" command. @kindex show mpx-bnd-init-on-return Show the state of mpx-bnd-init-on-return. @end table and info for the new command: add_setshow_boolean_cmd ("mpx-bnd-init-on-return", no_class, &mpx_bnd_init_on_return, _("\ Set the bnd registers to INIT state when returning from a call."), _("\ Show whether to set the bnd registers to INIT state when returning=20 from a call."), Would that be ok with you? Thanks and regards, -Fred Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Christian Lamprechter Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928