Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08 - V3

2017-09-08 Thread Jeff Law
On 08/23/2017 10:39 AM, Richard Biener wrote: > On August 23, 2017 6:36:32 PM GMT+02:00, Jeff Law wrote: >> On 08/23/2017 03:07 AM, Richard Biener wrote: >> > Both -fstack-clash-protection and -fstack-check cannot be turned > off per function. This means they would need

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08 - V3

2017-08-23 Thread Richard Biener
On August 23, 2017 6:36:32 PM GMT+02:00, Jeff Law wrote: >On 08/23/2017 03:07 AM, Richard Biener wrote: > Both -fstack-clash-protection and -fstack-check cannot be turned off per function. This means they would need merging in >lto-wrapper. The alternative is to

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08 - V3

2017-08-23 Thread Richard Biener
On Tue, Aug 22, 2017 at 5:52 PM, Jeff Law wrote: > On 08/18/2017 08:01 AM, Richard Biener wrote: >> On Mon, Jul 31, 2017 at 7:35 AM, Jeff Law wrote: >>> This patch introduces the stack clash protection options >>> >>> Changes since V2: >>> >>> Adds two new

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08 - V3

2017-08-22 Thread Jeff Law
On 08/22/2017 10:26 AM, David Malcolm wrote: >> Thanks. I settled on the %< %> style. None of the other warnings in >> that area use either. Otherwise I would have just selected whatever >> was >> most commonly used in that code. > > A nit that don't seem to have been mentioned: the patch

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08 - V3

2017-08-22 Thread David Malcolm
On Tue, 2017-08-22 at 09:35 -0600, Jeff Law wrote: > On 08/19/2017 12:22 PM, Martin Sebor wrote: > > On 07/30/2017 11:35 PM, Jeff Law wrote: > > > This patch introduces the stack clash protection options > > > > > > Changes since V2: > > > > > > Adds two new params. The first controls the size

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08 - V3

2017-08-22 Thread Jeff Law
On 08/18/2017 08:01 AM, Richard Biener wrote: > On Mon, Jul 31, 2017 at 7:35 AM, Jeff Law wrote: >> This patch introduces the stack clash protection options >> >> Changes since V2: >> >> Adds two new params. The first controls the size of the guard area. >> This controls the

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08 - V3

2017-08-22 Thread Jeff Law
On 08/19/2017 12:22 PM, Martin Sebor wrote: > On 07/30/2017 11:35 PM, Jeff Law wrote: >> This patch introduces the stack clash protection options >> >> Changes since V2: >> >> Adds two new params. The first controls the size of the guard area. >> This controls the threshold for when a function

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08 - V3

2017-08-19 Thread Martin Sebor
On 07/30/2017 11:35 PM, Jeff Law wrote: This patch introduces the stack clash protection options Changes since V2: Adds two new params. The first controls the size of the guard area. This controls the threshold for when a function prologue requires probes. The second controls the probing

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08 - V3

2017-08-18 Thread Richard Biener
On Mon, Jul 31, 2017 at 7:35 AM, Jeff Law wrote: > This patch introduces the stack clash protection options > > Changes since V2: > > Adds two new params. The first controls the size of the guard area. > This controls the threshold for when a function prologue requires > probes.

[PATCH][RFA/RFC] Stack clash mitigation patch 01/08 - V3

2017-07-30 Thread Jeff Law
This patch introduces the stack clash protection options Changes since V2: Adds two new params. The first controls the size of the guard area. This controls the threshold for when a function prologue requires probes. The second controls the probing interval -- ie, once probes are needed, how

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08 V2

2017-07-24 Thread Jeff Law
On 07/24/2017 02:57 AM, Segher Boessenkool wrote: >> Sadly, there's no way short of listing them and keeping that list >> up-to-date over time by hand. If we want to do that, I would suggest >> we note the processors with full support as well as those with partial >> support using the

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08 V2

2017-07-24 Thread Segher Boessenkool
On Fri, Jul 21, 2017 at 11:36:05AM -0600, Jeff Law wrote: > On 07/20/2017 07:23 AM, Segher Boessenkool wrote: > > On Tue, Jul 18, 2017 at 11:17:19PM -0600, Jeff Law wrote: > > I think the documentation for the new option should say this only > > provides partial protection on targets that do not

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08 V2

2017-07-21 Thread Jeff Law
On 07/20/2017 07:23 AM, Segher Boessenkool wrote: > Hi Jeff, > > On Tue, Jul 18, 2017 at 11:17:19PM -0600, Jeff Law wrote: >> >> The biggest change in this update to patch 01/08 is moving of stack >> clash protection out of -fstack-check= and into its own option, >> -fstack-clash-protection. I

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08 V2

2017-07-20 Thread Segher Boessenkool
Hi Jeff, On Tue, Jul 18, 2017 at 11:17:19PM -0600, Jeff Law wrote: > > The biggest change in this update to patch 01/08 is moving of stack > clash protection out of -fstack-check= and into its own option, > -fstack-clash-protection. I believe other issues raised by reviewers > have been

[PATCH][RFA/RFC] Stack clash mitigation patch 01/08 V2

2017-07-18 Thread Jeff Law
The biggest change in this update to patch 01/08 is moving of stack clash protection out of -fstack-check= and into its own option, -fstack-clash-protection. I believe other issues raised by reviewers have been addressed as well. -- This patch introduces a new option -fstack-clash-protection

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08

2017-07-14 Thread Jeff Law
On 07/14/2017 10:34 AM, Segher Boessenkool wrote: > On Thu, Jul 13, 2017 at 10:35:55PM -0600, Jeff Law wrote: There's -fstack-check and -fstack-clash-protection. I think with the direction we're going they are fundamentally incompatible because neither the compiler nor kernel do

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08

2017-07-14 Thread Segher Boessenkool
On Thu, Jul 13, 2017 at 10:35:55PM -0600, Jeff Law wrote: > >> There's -fstack-check and -fstack-clash-protection. I think with the > >> direction we're going they are fundamentally incompatible because > >> neither the compiler nor kernel do anything to guarantee enough stack is > >> available

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08

2017-07-14 Thread Jeff Law
On 07/14/2017 01:40 AM, Jakub Jelinek wrote: > On Thu, Jul 13, 2017 at 04:32:02PM -0500, Segher Boessenkool wrote: >> I don't think it should be inside -fstack-check at all. Sure, the >> mechanisms implementing it overlap a bit (more on some targets, less >> on others), but how will a user ask

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08

2017-07-14 Thread Jakub Jelinek
On Thu, Jul 13, 2017 at 04:32:02PM -0500, Segher Boessenkool wrote: > I don't think it should be inside -fstack-check at all. Sure, the > mechanisms implementing it overlap a bit (more on some targets, less > on others), but how will a user ask for clash protection _and_ for > stack checking?

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08

2017-07-13 Thread Jeff Law
On 07/13/2017 06:37 PM, David Malcolm wrote: > On Tue, 2017-07-11 at 15:19 -0600, Jeff Law wrote: > > [...] > >> diff --git a/gcc/opts.c b/gcc/opts.c >> index 7460c2b..61f5bb0 100644 >> --- a/gcc/opts.c >> +++ b/gcc/opts.c >> @@ -2243,6 +2243,19 @@ common_handle_option (struct gcc_options >>

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08

2017-07-13 Thread Jeff Law
On 07/13/2017 05:37 PM, Segher Boessenkool wrote: > On Thu, Jul 13, 2017 at 04:38:00PM -0600, Jeff Law wrote: >> On 07/13/2017 03:32 PM, Segher Boessenkool wrote: > -fstack-check=clash is itself not such a super name either. It's not > checking stack, and it isn't clashing: it just does a

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08

2017-07-13 Thread David Malcolm
On Tue, 2017-07-11 at 15:19 -0600, Jeff Law wrote: [...] > diff --git a/gcc/opts.c b/gcc/opts.c > index 7460c2b..61f5bb0 100644 > --- a/gcc/opts.c > +++ b/gcc/opts.c > @@ -2243,6 +2243,19 @@ common_handle_option (struct gcc_options > *opts, > opts->x_flag_stack_check =

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08

2017-07-13 Thread Segher Boessenkool
On Thu, Jul 13, 2017 at 04:38:00PM -0600, Jeff Law wrote: > On 07/13/2017 03:32 PM, Segher Boessenkool wrote: > >>> -fstack-check=clash is itself not such a super name either. It's not > >>> checking stack, and it isn't clashing: it just does a store to every > >>> page the stack will touch

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08

2017-07-13 Thread Jeff Law
On 07/13/2017 03:32 PM, Segher Boessenkool wrote: > Hi again, > > On Wed, Jul 12, 2017 at 09:56:09PM -0600, Jeff Law wrote: FWIW -fstack-check=specific is dreadfully named. I haven't tried to address that. >>> >>> -fstack-check=clash is itself not such a super name either. It's not

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08

2017-07-13 Thread Segher Boessenkool
Hi again, On Wed, Jul 12, 2017 at 09:56:09PM -0600, Jeff Law wrote: > >> FWIW -fstack-check=specific is dreadfully named. I haven't tried to > >> address that. > > > > -fstack-check=clash is itself not such a super name either. It's not > > checking stack, and it isn't clashing: it just does a

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08

2017-07-12 Thread Jeff Law
On 07/12/2017 06:31 PM, Segher Boessenkool wrote: > Hi! > > On Tue, Jul 11, 2017 at 03:19:57PM -0600, Jeff Law wrote: >> It introduces a new style of stack probing -fstack-check=clash, >> including documentation of the new option, how it differs from >> -fstack-check=specific, etc. >> >> FWIW

Re: [PATCH][RFA/RFC] Stack clash mitigation patch 01/08

2017-07-12 Thread Segher Boessenkool
Hi! On Tue, Jul 11, 2017 at 03:19:57PM -0600, Jeff Law wrote: > It introduces a new style of stack probing -fstack-check=clash, > including documentation of the new option, how it differs from > -fstack-check=specific, etc. > > FWIW -fstack-check=specific is dreadfully named. I haven't tried to

[PATCH][RFA/RFC] Stack clash mitigation patch 01/08

2017-07-11 Thread Jeff Law
This is the first patch in the stack-clash mitigation patches. It introduces a new style of stack probing -fstack-check=clash, including documentation of the new option, how it differs from -fstack-check=specific, etc. FWIW -fstack-check=specific is dreadfully named. I haven't tried to address