Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Walfred Tedeschi <walfred.tedeschi@intel.com>
Cc: brobecker@adacore.com, gdb-patches@sourceware.org
Subject: Re: [PATCH V2] ABI changes for MPX.
Date: Thu, 17 Dec 2015 16:35:00 -0000	[thread overview]
Message-ID: <83bn9pyqv8.fsf@gnu.org> (raw)
In-Reply-To: <1450358624-11596-1-git-send-email-walfred.tedeschi@intel.com>	(message from Walfred Tedeschi on Thu, 17 Dec 2015 14:23:44 +0100)

> From: Walfred Tedeschi <walfred.tedeschi@intel.com>
> Cc: gdb-patches@sourceware.org, Walfred Tedeschi <walfred.tedeschi@intel.com>
> Date: Thu, 17 Dec 2015 14:23:44 +0100
> 
> Code reflects what is presented in the ABI document:
> https://github.com/hjl-tools/x86-psABI/wiki/X86-psABI
> Here new class POINTER was added.  GDB code is modified to mirror
> this new class. (page 134)
> 
> When using the return command, execution of a function is aborted
> and present values are returned from that point.  That can cause
> bound violations in the MPX context.  To avoid such side-effects
> a new set variable was added "mpx-bnd-init-on-return" which controls
> the initialization of bound register when using the return command.
> 
> As bound initialization it is understood the set of the BND register
> to zero allowing the associated pointer to access the whole memory.
> 
> As default the value of "mpx-bnd-init-on-return" is set to 1.  So
> bound register are initilized when using the "return" command.

Thanks.  Review comments for the documentation parts follow:

> +      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."), _("\

I think "bnd" should be "BND", in caps.

> +Show the state of the mpx-bnd-init-on-return."),

We usually repeat here the same text as in the "Set" part, except
replace "Set" with "Show".  So something like

 Show whether BND registers are set to INIT state when returning from a call.

will be better.

> +While calling functions from the debugger, of an Intel(R) MPX enabled program,
> +boundary registers have to be initialized before performing the call, to avoid
> +boundary violations while performing the call.  A bound is defined to be

"bound" or "boundary"?  You use the latter in the previous text.

> +initialized 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@}.

Suggest to break this into 3 separate sentences, as this is too
complex for a single one.

> +It is possible to change the boundary values, if desired, by placing
> +a breakpoint at prologue's end and setting bound registers as wished.

Are we sure every reader will immediately know how to set a breakpoint
"at prologue's end"?  If not, perhaps a hint or a cross-reference to
where this is explained is in order.

> +After the call is performed bound register might be keept or not for
> +further investigations.

Typo: "keept" should be "kept".

I also don't understand what this sentence is trying to explain.  Can
you clarify?

> +While the using the @command{return} bounds can propagate through

"When", not "while".  And please delete the "the" before "using".

> +execution causing a boundary violation.
> +The behaviour of initializing bounds when using @command{return}
> +can be controlled and vizualized via the following commands:
                         ^^^^^^^^^^
Typo: should be "visualized".

> +@table @code
> +@kindex set mpx-bnd-init-on-return
> +When set to 1 bound registers will be initialized when returning from a
> +calling a program function
> +@kindex show mpx-bnd-init-on-return
> +Show the state of mpx-bnd-init-on-return.
> +@end table

I didn't quite understand the effect and the need in this variable.
Can you clarify, please?


  reply	other threads:[~2015-12-17 16:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-17 13:24 Walfred Tedeschi
2015-12-17 16:35 ` Eli Zaretskii [this message]
2015-12-17 16:44   ` Tedeschi, Walfred
2015-12-18 15:11     ` Eli Zaretskii
2015-12-18 17:24       ` Joel Brobecker
2015-12-19  8:16         ` Eli Zaretskii
2015-12-18 17:19 ` Joel Brobecker

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=83bn9pyqv8.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=walfred.tedeschi@intel.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