aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/aarch64/aarch64.opt
diff options
context:
space:
mode:
authorMatthew Malcomson <matthew.malcomson@arm.com>2020-07-09 09:11:58 +0100
committerMatthew Malcomson <matthew.malcomson@arm.com>2020-07-09 09:11:58 +0100
commita9ba2a9b77bec7eacaf066801f22d1c366a2bc86 (patch)
treea9c871fba0e6c6b389f025c54aac4151540aa020 /gcc/config/aarch64/aarch64.opt
parent2a39c42a42cdea4a8962b9e140b88e0051894f38 (diff)
downloadgcc-a9ba2a9b77bec7eacaf066801f22d1c366a2bc86.zip
gcc-a9ba2a9b77bec7eacaf066801f22d1c366a2bc86.tar.gz
gcc-a9ba2a9b77bec7eacaf066801f22d1c366a2bc86.tar.bz2
aarch64: New Straight Line Speculation (SLS) mitigation flags
Here we introduce the flags that will be used for straight line speculation. The new flag introduced is `-mharden-sls=`. This flag can take arguments of `none`, `all`, or a comma seperated list of one or more of `retbr` or `blr`. `none` indicates no special mitigation of the straight line speculation vulnerability. `all` requests all mitigations currently implemented. `retbr` requests that the RET and BR instructions have a speculation barrier inserted after them. `blr` requests that BLR instructions are replaced by a BL to a function stub using a BR with a speculation barrier after it. Setting this on a per-function basis using attributes or the like is not enabled, but may be in the future. gcc/ChangeLog: 2020-06-02 Matthew Malcomson <matthew.malcomson@arm.com> * config/aarch64/aarch64-protos.h (aarch64_harden_sls_retbr_p): New. (aarch64_harden_sls_blr_p): New. * config/aarch64/aarch64.c (enum aarch64_sls_hardening_type): New. (aarch64_harden_sls_retbr_p): New. (aarch64_harden_sls_blr_p): New. (aarch64_validate_sls_mitigation): New. (aarch64_override_options): Parse options for SLS mitigation. * config/aarch64/aarch64.opt (-mharden-sls): New option. * doc/invoke.texi: Document new option.
Diffstat (limited to 'gcc/config/aarch64/aarch64.opt')
-rw-r--r--gcc/config/aarch64/aarch64.opt4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/config/aarch64/aarch64.opt b/gcc/config/aarch64/aarch64.opt
index d99d14c..5170361 100644
--- a/gcc/config/aarch64/aarch64.opt
+++ b/gcc/config/aarch64/aarch64.opt
@@ -71,6 +71,10 @@ mgeneral-regs-only
Target Report RejectNegative Mask(GENERAL_REGS_ONLY) Save
Generate code which uses only the general registers.
+mharden-sls=
+Target RejectNegative Joined Var(aarch64_harden_sls_string)
+Generate code to mitigate against straight line speculation.
+
mfix-cortex-a53-835769
Target Report Var(aarch64_fix_a53_err835769) Init(2) Save
Workaround for ARM Cortex-A53 Erratum number 835769.