This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: "Kumar, Venkataramanan" <Venkataramanan dot Kumar at amd dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "Dharmakan, Rohit arul raj" <Rohitarulraj dot Dharmakan at amd dot com>, "Nagarajan, Muthu kumar raj" <Muthukumarraj dot Nagarajan at amd dot com>, "Uros Bizjak (ubizjak at gmail dot com)" <ubizjak at gmail dot com>
- Date: Sun, 14 Jan 2018 11:40:21 +0100
- Subject: Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre
- Authentication-results: sourceware.org; auth=none
- References: <20180114033707.6297-1-hjl.tools@gmail.com> <BN6PR12MB1729C261DED83CBEAF968E648F150@BN6PR12MB1729.namprd12.prod.outlook.com>
> Hi HJ,
>
> > -----Original Message-----
> > From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> > owner@gcc.gnu.org] On Behalf Of H.J. Lu
> > Sent: Sunday, January 14, 2018 9:07 AM
> > To: gcc-patches@gcc.gnu.org
> > Subject: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre
> >
> > This set of patches for GCC 8 mitigates variant #2 of the speculative
> > execution vulnerabilities on x86 processors identified by CVE-2017-5715, aka
> > Spectre. They convert indirect branches and function returns to call and
> > return thunks to avoid speculative execution via indirect call, jmp and ret.
> >
> > H.J. Lu (5):
> > x86: Add -mindirect-branch=
> > x86: Add -mfunction-return=
> > x86: Add -mindirect-branch-register
> > x86: Add 'V' register operand modifier
> > x86: Disallow -mindirect-branch=/-mfunction-return= with
> > -mcmodel=large
>
> Current set of patches don't seem to have any option to generate "lfence" as the loop filler in "retpoline", which is required by AMD.
> Can you please clarify the plan. We would like to get this checked-in GCC 8.
Since thunks are output as strings, it is easy to add the option
on the top of patch #1 of the series. I do not fully understand
the reason for choosing pause over lfence for Intel, but if we need
to do both, we need to have command line option (and possibly attribute).
What would be reasonable name for it?
Honza