Page MenuHomePhabricator

[x86][lvi][seses] Use SESES at O0 for LVI mitigation
ClosedPublic

Authored by zbrid on Jun 17 2020, 11:55 AM.

Details

Summary

Use SESES as the fallback at O0 where the optimized LVI pass isn't desired due
to its effect on build times at O0.

I updated the LVI tests since this changes the code gen for the tests touched in the parent revision.

This is a follow up to the comments I made here: https://reviews.llvm.org/D80964

Hopefully we can continue the discussion here.

Diff Detail

Event Timeline

zbrid created this revision.Jun 17 2020, 11:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 17 2020, 11:55 AM
zbrid retitled this revision from [lvi][seses] Use SESES at O0 for LVI mitigation to [x86][lvi][seses] Use SESES at O0 for LVI mitigation.Jun 17 2020, 11:56 AM
zbrid marked an inline comment as done.Jun 17 2020, 11:58 AM
zbrid added inline comments.
llvm/test/CodeGen/X86/lvi-hardening-loads.ll
37

Sorry, this is totally weird and I'll look into why this happens.

zbrid edited the summary of this revision. (Show Details)Jun 17 2020, 11:59 AM
zbrid updated this revision to Diff 271791.Jun 18 2020, 11:22 AM

Add comment to clarify

Other than the inline comments, LGTM.

llvm/lib/Target/X86/X86TargetMachine.cpp
497–498

Please add a comment here to clarify that if getOptLevel() == CodeGenOpt::None then SESES will provide mitigation when LVILoadHardening is enabled.

llvm/test/CodeGen/X86/lvi-hardening-loads.ll
37

Has this been fixed?

sconstab accepted this revision.Jun 29 2020, 1:04 PM
This revision is now accepted and ready to land.Jun 29 2020, 1:04 PM
zbrid updated this revision to Diff 276123.Jul 7 2020, 10:18 AM

Add inline comment about lvi hardening falling back to seses

zbrid updated this revision to Diff 276141.Jul 7 2020, 10:53 AM
zbrid marked an inline comment as done.

Fix redundant LFENCE problem with SESES

zbrid added a comment.Jul 7 2020, 10:54 AM

Going to merge this today. I updated based on the comments.

zbrid updated this revision to Diff 276144.Jul 7 2020, 11:03 AM

Update commit message to add info about SESES change too

This revision was automatically updated to reflect the committed changes.
Harbormaster completed remote builds in B63253: Diff 276144.