RFR: JDK-8202384: Introduce altserver jvm variant with speculative execution disabled
erik.joelsson at oracle.com
Fri Jun 1 20:53:52 UTC 2018
We need to add compilation flags for disabling speculative execution to
our native libraries and executables. In order to allow for users not
affected by problems with speculative execution to run a JVM at full
speed, we need to be able to ship two JVM libraries - one that is
compiled with speculative execution enabled, and one that is compiled
without. Note that this applies to the build time C++ flags, not the
compiler in the JVM itself. Luckily adding these flags to the rest of
the native libraries did not have a significant performance impact so
there is no need for making it optional there.
This patch defines flags for disabling speculative execution for GCC and
Visual Studio and applies them to all binaries except libjvm when
available in the compiler. It defines a new jvm feature
no-speculative-cti, which is used to control whether to use the flags
for libjvm. It also defines a new jvm variant "altserver" which is the
same as server, but with this new feature added.
For Oracle builds, we are changing the default for linux-x64 and
windows-x64 to build both server and altserver, giving the choice to the
user which JVM they want to use. If others would prefer this default, we
could make it default in configure as well.
The change in GensrcJFR.gmk fixes a newly introduced race that appears
when building multiple jvm variants.
More information about the hotspot-dev