On Thu, Nov 29, 2018 at 3:14 PM H.J. Lu <hjl.to...@gmail.com> wrote: > > On Wed, Oct 31, 2018 at 12:42 PM H.J. Lu <hjl.to...@gmail.com> wrote: > > > > On Thu, Sep 27, 2018 at 7:58 AM Richard Biener > > <richard.guent...@gmail.com> wrote: > > > > > > On Thu, Sep 27, 2018 at 3:16 PM H.J. Lu <hjl.to...@gmail.com> wrote: > > > > > > > > On Thu, Sep 27, 2018 at 6:08 AM, Szabolcs Nagy <szabolcs.n...@arm.com> > > > > wrote: > > > > > 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. > > > > > > > > The target usage is in Linux kernel. > > > > > > Maybe still somehow encode that in the option since it otherwise raises > > > expectations that are not met? > > > -mzero-call-clobbered-regs=used-int|all-int|skip|used-simd|used-fp,etc.? > > > and sorry() on unimplemented ones? Or simply zero also non-integer > > > regs the same way? I suppose > > > there isn't sth like vzeroupper that zeros all SIMD regs and completely? > > > > > > > Here is the updated patch to zero caller-saved vector registers. I don't > > mind a different option name if it is preferred. I may be able to create > > some generic utility functions which can be used by other backends. But > > actual implementation must be target specific. > > > > Any comments? > > PING. > > https://gcc.gnu.org/ml/gcc-patches/2018-10/msg02079.html >
PING. -- H.J.