This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: [PATCH] x86: Add -mzero-caller-saved-regs=[skip|used|all]
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>, gcc-patches at gcc dot gnu dot org
- Cc: nd at arm dot com, Uros Bizjak <ubizjak at gmail dot com>
- Date: Thu, 27 Sep 2018 14:08:29 +0100
- Subject: Re: RFC: [PATCH] x86: Add -mzero-caller-saved-regs=[skip|used|all]
- References: <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.