Home » Java » Core Java » JEP 342: The JVM and Spectre

About Dustin Marx

Dustin Marx

JEP 342: The JVM and Spectre

JEP 342 (“Limit Speculative Execution”) has transitioned from “Draft” state to “Candidate” state, but it has not yet been targeted to a specific JDK release (see graphic for steps in JEP process). Jesper Wilhelmsson has written that JEP 342 “covers the initial work to make use of new C++ compiler options to limit speculative execution in native code in the JDK.” JEP 342’s “Summary” succinctly describes its purpose, “Help developers and deployers defend against speculative-execution (‘Spectre’) vulnerabilities by providing a means to limit speculative execution, and enable further mitigations to be implemented in future releases.”

JEP 342 aims to provide a “distinct, alternate JVM in the JDK that is compiled with” C++ “compiler options that limit the extent to which the CPU can do speculative execution” and which “can be selected at launch time.” The JEP states that the plan is to “include a distinct, alternate JVM in the JDK that is compiled with these options and can be selected at launch time.” The JEP 342 text describes the specific C++ compilers and options affected by this JEP:

JEP 342 describes the default execution of the java launcher to continue to be as it is today (nothing to avoid speculative execution), but with the availability of a command-line flag [-nonspeculative] to disable speculative execution. The decision was made to avoid always prohibiting speculative execution because it should “be up to the end user to decide whether to limit speculative execution.” The ability to choose is important because, as the JEP states, the impact of “limiting speculative execution … can be significant for the C and C++ code in the HotSpot JVM, but it is negligible for the C and C++ code outside of the JVM.” It is worth noting here that the “non-JVM code” will always be compiled with the new C++ options addressing speculative execution given that there is very little performance impact in those areas.

Spectre has been one of multiple threats to software applications and it’s nice to see new possibilities for dealing with these threats potentially coming to the JVM.

Published on Java Code Geeks with permission by Dustin Marx, partner at our JCG program. See the original article here: JEP 342: The JVM and Spectre

Opinions expressed by Java Code Geeks contributors are their own.

(0 rating, 0 votes)
You need to be a registered member to rate this.
Start the discussion Views Tweet it!
Do you want to know how to develop your skillset to become a Java Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. JPA Mini Book
2. JVM Troubleshooting Guide
3. JUnit Tutorial for Unit Testing
4. Java Annotations Tutorial
5. Java Interview Questions
6. Spring Interview Questions
7. Android UI Design
and many more ....
I agree to the Terms and Privacy Policy

Leave a Reply

avatar

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
Notify of