This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Add clang command line support for -mharden-sls=
ClosedPublic

Authored by kristof.beyls on Jun 8 2020, 8:17 AM.

Details

Summary

The accepted options to -mharden-sls= are:

  • all: enable all mitigations against Straight Line Speculation that are implemented.
  • none: disable all mitigations against Straight Line Speculation.
  • retbr: enable the mitigation against Straight Line Speculation for RET and BR instructions.
  • blr: enable the mitigation against Straight Line Speculation for BLR instructions.

Diff Detail

Event Timeline

kristof.beyls created this revision.Jun 8 2020, 8:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2020, 8:17 AM
ostannard accepted this revision.Jun 8 2020, 9:50 AM

LGTM, inline comment could be done as a follow-up patch given that this is time-sensitive (recently published security vulnerability).

clang/lib/Driver/ToolChains/Arch/AArch64.cpp
229

Could this be a range-based for loop?

This revision is now accepted and ready to land.Jun 8 2020, 9:50 AM
This revision was automatically updated to reflect the committed changes.
kristof.beyls marked 2 inline comments as done.Jun 19 2020, 2:07 AM
kristof.beyls added inline comments.
clang/lib/Driver/ToolChains/Arch/AArch64.cpp
229

Yep, thanks for the suggestion. I've changed that before committing this.

The convention is to use err_drv_unsupported_option_argument instead of adding a new diagnostic kind.

Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2022, 4:51 PM