-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pull some upstream patches related to LVI mitigations compile time #74
Pull some upstream patches related to LVI mitigations compile time #74
Conversation
…VI) mitigations Fix for the issue raised in rust-lang/rust#74632. The current heuristic for inserting LFENCEs uses a quadratic-time algorithm. This can apparently cause substantial compilation slowdowns for building Rust projects, where functions > 5000 LoC are apparently common. The updated heuristic in this patch implements a linear-time algorithm. On a set of benchmarks, the slowdown factor for the generated code was comparable (2.55x geo mean for the quadratic-time heuristic, vs. 2.58x for the linear-time heuristic). Both heuristics offer the same security properties, namely, mitigating LVI. This patch also includes some formatting fixes. Differential Revision: https://reviews.llvm.org/D84471
This function has been reduced to an identity function for some time.
The sorting is needed, because reaching defs are (logically) ordered, but are not collected in that order. This change will break up the single call to std::sort into a series of smaller sorts, each of which should use a cheaper comparison function than the original.
This improves performance of PhysicalRegisterInfo::makeRegRef.
This improves performance.
Ping for review? |
@nikic, do you have a sense of how safe these are to backport? |
@cuviper Not familiar with the code changes here, but in terms of impact this should be fine. LVI changes should only affect people explicitly opting into them (in particular SGX), and I believe that apart from LVI the only other consumer of RDF is the Hexagon target, which is rather obscure (not sure it's even supported by Rust at all). So this shouldn't change anything for standard targets. |
OK, works for me. Note for 3rd-parties: the RDF changes do affect the public API, so you probably don't want this in distro backports, for example. |
74: Stuff required for AOT optimisations. r=ptersilie a=vext01 Co-authored-by: Edd Barrett <[email protected]>
Cherry-pick:
This (partially?) addresses rust-lang/rust#74632