This is an archive of the discontinued LLVM Phabricator instance.

[X86][CET] Changing -fcf-protection behavior to comply with gcc (LLVM part)
ClosedPublic

Authored by mike.dvoretsky on May 15 2018, 7:43 AM.

Details

Summary

This patch aims to match the changes introduced in gcc by https://gcc.gnu.org/ml/gcc-cvs/2018-04/msg00534.html. The IBT feature definition is removed, with the IBT instructions being freely available on all X86 targets. The shadow stack instructions are also being made freely available, and the use of all these CET instructions is controlled by the module flags derived from the -fcf-protection clang option. The hasSHSTK option remains since clang uses it to determine availability of shadow stack instruction intrinsics, but it is no longer directly used.

Comes with a clang patch (D46881).

Diff Detail

Repository
rL LLVM

Event Timeline

mike.dvoretsky created this revision.May 15 2018, 7:43 AM

Do we need to do something for the FIXMEs?

Replaced FIXMEs with more appropriate cautionary comments. They do not need to be addressed directly by any patches, so much as they served to warn about using the instructions carelessly now that there is no longer a simple way to restrict their usage.

LGTM if you remove that one FIXME that's still in there.

llvm/lib/Target/X86/X86InstrControl.td
329 ↗(On Diff #147004)

Please replace this FIXME before commit.

craig.topper accepted this revision.May 16 2018, 10:46 AM
This revision is now accepted and ready to land.May 16 2018, 10:46 AM

Removed the missed FIXME.

rja accepted this revision.May 17 2018, 1:17 AM
rja added a subscriber: rja.

LG