On 08/18/2017 08:05 AM, Richard Biener wrote: > On Mon, Jul 31, 2017 at 7:38 AM, Jeff Law <l...@redhat.com> wrote: >> >> This patch introduces generic mechanisms to protect the dynamically >> allocated stack space against stack-clash attacks. >> >> Changes since V2: >> >> Dynamic allocations can be emitted as unrolled inlined probes or with a >> rotated loop. Blockage insns are also properly emitted for the dynamic >> area probes and the dynamic area probing now supports targets that may >> make optimistic assumptions in their prologues. Finally it uses the new >> param to control the probing interval. >> >> Tests were updated to explicitly specify the guard and probing interval. >> New test to check inline/unrolled probes as well as rotated loop. >> >> >> >> * explow.c: Include "params.h". >> (anti_adjust_stack_and_probe_stack_clash): New function. >> (get_stack_check_protect): Likewise. >> (compute_stack_clash_protection_loop_data): Likewise. >> (emit_stack_clash_protection_loop_start): Likewise. >> (emit_stack_clash_protection_loop_end): Likewise. >> (allocate_dynamic_stack_space): Use get_stack_check_protect. >> Use anti_adjust_stack_and_probe_stack_clash. >> * explow.h (compute_stack_clash_protection_loop_data): Prototype. >> (emit_stack_clash_protection_loop_start): Likewise. >> (emit_stack_clash_protection_loop_end): Likewise. >> * rtl.h (get_stack_check_protect): Prototype. >> * defaults.h (STACK_CLASH_PROTECTION_NEEDS_FINAL_DYNAMIC_PROBE): >> Define new default. >> * doc/tm.texi.in (STACK_CLASH_PROTECTION_NEEDS_FINAL_DYNAMIC_PROBE): >> Define. > > Please make this a hook instead of a target macro. Will do. I should have known better :-)
> > Besides this it looks good (I trust you on the RTL details). THanks. Jeff