public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
To: "H.J. Lu" <hjl.tools@gmail.com>, gcc-patches@gcc.gnu.org
Cc: nd@arm.com, Uros Bizjak <ubizjak@gmail.com>
Subject: Re: RFC: [PATCH] x86: Add -mzero-caller-saved-regs=[skip|used|all]
Date: Thu, 27 Sep 2018 13:10:00 -0000	[thread overview]
Message-ID: <b6629ac7-15be-d871-aa31-9a547f61edd9@arm.com> (raw)
In-Reply-To: <20180926181029.GA20898@intel.com>

On 26/09/18 19:10, H.J. Lu wrote:
> Add -mzero-caller-saved-regs=[skip|used|all] command-line option and
> zero_caller_saved_regs("skip|used|all") function attribue:
> 
> 1. -mzero-caller-saved-regs=skip and zero_caller_saved_regs("skip")
> 
> Don't zero caller-saved integer registers upon function return.
> 
> 2. -mzero-caller-saved-regs=used and zero_caller_saved_regs("used")
> 
> Zero used caller-saved integer registers upon function return.
> 
> 3. -mzero-caller-saved-regs=all and zero_caller_saved_regs("all")
> 
> Zero all caller-saved integer registers upon function return.
> 
> Tested on i686 and x86-64 with bootstrapping GCC trunk and
> -mzero-caller-saved-regs=used as well as -mzero-caller-saved-regs=all
> enabled by default.
> 

from this description and the documentation it's
not clear to me what this tries to achieve.

is it trying to prevent information leak?
or some pcs hack the caller may rely on?

if it's for information leak then i'd expect such
attribute to be used on crypto code.. however i'd
expect crypto code to use simd registers as well,
so integer only cleaning needs explanation.

  parent reply	other threads:[~2018-09-27 13:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26 18:11 H.J. Lu
2018-09-27 11:01 ` Richard Biener
2018-09-27 13:08   ` H.J. Lu
2018-09-27 13:10 ` Szabolcs Nagy [this message]
2018-09-27 13:41   ` H.J. Lu
2018-09-27 15:13     ` Richard Biener
2018-09-27 19:41       ` H.J. Lu
2018-10-31 21:53       ` PATCH] x86: Add -mzero-caller-saved-regs=[skip|used-gpr|all-gpr|used|all] H.J. Lu
2018-11-29 23:16         ` PING [PATCH] " H.J. Lu
2018-12-21 13:23           ` PING^2 " H.J. Lu
2018-09-27 14:04 ` RFC: [PATCH] x86: Add -mzero-caller-saved-regs=[skip|used|all] Rich Felker
2018-09-27 20:07   ` H.J. Lu
2018-09-27 19:29 ` Florian Weimer
2018-09-27 19:51   ` H.J. Lu

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=b6629ac7-15be-d871-aa31-9a547f61edd9@arm.com \
    --to=szabolcs.nagy@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=nd@arm.com \
    --cc=ubizjak@gmail.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).