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: Uros Bizjak <ubizjak at gmail dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, "Kumar, Venkataramanan" <Venkataramanan dot Kumar at amd dot com>, "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>
- Date: Sun, 14 Jan 2018 13:42:41 +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> <20180114104020.GB62416@kam.mff.cuni.cz> <CAFULd4bfSNj9jUr3+Q-tac4peMhPhf2qzRoPhz42F4MHgVbr5g@mail.gmail.com>
> On Sun, Jan 14, 2018 at 11:40 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> >> 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?
>
> Looking at the kernel patch [1], the loop filler should be
> "pause;lfence" sequence, and should be universally accepted for Intel
> and AMD targets.
>
> [1] https://www.spinics.net/lists/kernel/msg2697507.html
Yep, I would say we should go with pause;lfence now and see if we want to add argument
eventually.
HJ, does it sound OK?
Honza
>
> Uros.