public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Walfred Tedeschi <walfred.tedeschi@intel.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: palves@redhat.com, brobecker@adacore.com, gdb-patches@sourceware.org
Subject: Re: [PATCH V4 2/2] Add mpx-bnd-init-on-return set/show command for inferior calls.
Date: Thu, 03 Mar 2016 11:04:00 -0000	[thread overview]
Message-ID: <56D81A29.3040007@intel.com> (raw)
In-Reply-To: <83ziug6dnw.fsf@gnu.org>

Am 3/2/2016 um 5:35 PM schrieb Eli Zaretskii:
>> From: Walfred Tedeschi <walfred.tedeschi@intel.com>
>> Cc: gdb-patches@sourceware.org, Walfred Tedeschi <walfred.tedeschi@intel.com>
>> 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 from a call.
>
>
> Thanks.
>
Eli,

Some of your previous comment's were forgotten sorry for that. They were 
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 
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

  reply	other threads:[~2016-03-03 11:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-02 16:21 [PATCH V4 0/2] BND register initialization Walfred Tedeschi
2016-03-02 16:21 ` [PATCH V4 2/2] Add mpx-bnd-init-on-return set/show command for inferior calls Walfred Tedeschi
2016-03-02 16:35   ` Eli Zaretskii
2016-03-03 11:04     ` Walfred Tedeschi [this message]
2016-03-03 20:34       ` Eli Zaretskii
2016-03-02 16:21 ` [PATCH V4 1/2] Initialize bnd register before performing " Walfred Tedeschi
2016-03-16 14:57   ` Luis Machado

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56D81A29.3040007@intel.com \
    --to=walfred.tedeschi@intel.com \
    --cc=brobecker@adacore.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).