Re: [Patch 2/3] aarch64: Introduce SLS mitigation for RET and BR instructions

2020-07-08 Thread Richard Sandiford
Matthew Malcomson writes: > With suggestions applied. > Testing with `-mabi=ilp32` found a bug around the trampoline > initialisation where the new larger size of the trampoline caused a > different execution path of `emit_block_move` which ICE'd on the > pre-existing `ptr_mode` address. OK, than

Re: [Patch 2/3] aarch64: Introduce SLS mitigation for RET and BR instructions

2020-07-03 Thread Matthew Malcomson
With suggestions applied. Testing with `-mabi=ilp32` found a bug around the trampoline initialisation where the new larger size of the trampoline caused a different execution path of `emit_block_move` which ICE'd on the pre-existing `ptr_mode` address. Commit Message -- Instructions followin

Re: [Patch 2/3] aarch64: Introduce SLS mitigation for RET and BR instructions

2020-06-23 Thread Matthew Malcomson
On 23/06/2020 17:56, Richard Sandiford wrote: Matthew Malcomson writes: On 23/06/2020 17:17, Richard Sandiford wrote: Matthew Malcomson writes: --- a/gcc/config/aarch64/aarch64-protos.h +/* Ensure there are no BR or RET instructions which are not directly followed + by a speculation barrie

Re: [Patch 2/3] aarch64: Introduce SLS mitigation for RET and BR instructions

2020-06-23 Thread Richard Sandiford
Matthew Malcomson writes: > On 23/06/2020 17:17, Richard Sandiford wrote: >> Matthew Malcomson writes: >>> --- a/gcc/config/aarch64/aarch64-protos.h >>> +/* Ensure there are no BR or RET instructions which are not directly >>> followed >>> + by a speculation barrier. */ >>> +/* { dg-final { s

Re: [Patch 2/3] aarch64: Introduce SLS mitigation for RET and BR instructions

2020-06-23 Thread Matthew Malcomson
On 23/06/2020 17:17, Richard Sandiford wrote: Matthew Malcomson writes: --- a/gcc/config/aarch64/aarch64-protos.h +/* Ensure there are no BR or RET instructions which are not directly followed + by a speculation barrier. */ +/* { dg-final { scan-assembler-not "\t(br|ret|retaa|retab)\tx\[0-9

Re: [Patch 2/3] aarch64: Introduce SLS mitigation for RET and BR instructions

2020-06-23 Thread Richard Sandiford
Matthew Malcomson writes: > --- a/gcc/config/aarch64/aarch64-protos.h > +++ b/gcc/config/aarch64/aarch64-protos.h > @@ -780,6 +780,7 @@ extern const atomic_ool_names aarch64_ool_ldeor_names; > > tree aarch64_resolve_overloaded_builtin_general (location_t, tree, void *); > > +const char * aarc

[Patch 2/3] aarch64: Introduce SLS mitigation for RET and BR instructions

2020-06-08 Thread Matthew Malcomson
Instructions following RET or BR are not necessarily executed. In order to avoid speculation past RET and BR we can simply append a speculation barrier. Since these speculation barriers will not be architecturally executed, they are not expected to add a high performance penalty. The speculation