Fri, 22 Aug 2014 12:03:49 -0700
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
Summary: Require to specify UnlockExperimentalVMOptions flag together with UseRTMLocking flag on un-patched systems where CPUID allows it but is unsupported otherwise.
Reviewed-by: iveresov, fzhinkin
1.1 --- a/src/cpu/x86/vm/vm_version_x86.cpp Thu Aug 28 14:05:08 2014 -0700 1.2 +++ b/src/cpu/x86/vm/vm_version_x86.cpp Fri Aug 22 12:03:49 2014 -0700 1.3 @@ -612,6 +612,17 @@ 1.4 1.5 #if INCLUDE_RTM_OPT 1.6 if (UseRTMLocking) { 1.7 + if (is_intel_family_core()) { 1.8 + if ((_model == CPU_MODEL_HASWELL_E3) || 1.9 + (_model == CPU_MODEL_HASWELL_E7 && _stepping < 3) || 1.10 + (_model == CPU_MODEL_BROADWELL && _stepping < 4)) { 1.11 + if (!UnlockExperimentalVMOptions) { 1.12 + vm_exit_during_initialization("UseRTMLocking is only available as experimental option on this platform. It must be enabled via -XX:+UnlockExperimentalVMOptions flag."); 1.13 + } else { 1.14 + warning("UseRTMLocking is only available as experimental option on this platform."); 1.15 + } 1.16 + } 1.17 + } 1.18 if (!FLAG_IS_CMDLINE(UseRTMLocking)) { 1.19 // RTM locking should be used only for applications with 1.20 // high lock contention. For now we do not use it by default.
2.1 --- a/src/cpu/x86/vm/vm_version_x86.hpp Thu Aug 28 14:05:08 2014 -0700 2.2 +++ b/src/cpu/x86/vm/vm_version_x86.hpp Fri Aug 22 12:03:49 2014 -0700 2.3 @@ -276,7 +276,10 @@ 2.4 CPU_MODEL_WESTMERE_EX = 0x2f, 2.5 CPU_MODEL_SANDYBRIDGE = 0x2a, 2.6 CPU_MODEL_SANDYBRIDGE_EP = 0x2d, 2.7 - CPU_MODEL_IVYBRIDGE_EP = 0x3a 2.8 + CPU_MODEL_IVYBRIDGE_EP = 0x3a, 2.9 + CPU_MODEL_HASWELL_E3 = 0x3c, 2.10 + CPU_MODEL_HASWELL_E7 = 0x3f, 2.11 + CPU_MODEL_BROADWELL = 0x3d 2.12 } cpuExtendedFamily; 2.13 2.14 // cpuid information block. All info derived from executing cpuid with
3.1 --- a/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java Thu Aug 28 14:05:08 2014 -0700 3.2 +++ b/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java Fri Aug 22 12:03:49 2014 -0700 3.3 @@ -62,13 +62,16 @@ 3.4 // verify default value 3.5 CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", 3.6 TestUseRTMDeoptOptionOnSupportedConfig.DEFAULT_VALUE, 3.7 + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, 3.8 "-XX:+UseRTMLocking"); 3.9 // verify that option is off when UseRTMLocking is off 3.10 - CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", 3.11 - "false", "-XX:-UseRTMLocking", "-XX:+UseRTMDeopt"); 3.12 + CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", "false", 3.13 + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, 3.14 + "-XX:-UseRTMLocking", "-XX:+UseRTMDeopt"); 3.15 // verify that option could be turned on 3.16 - CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", 3.17 - "true", "-XX:+UseRTMLocking", "-XX:+UseRTMDeopt"); 3.18 + CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", "true", 3.19 + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, 3.20 + "-XX:+UseRTMLocking", "-XX:+UseRTMDeopt"); 3.21 } 3.22 3.23 public static void main(String args[]) throws Throwable {
4.1 --- a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java Thu Aug 28 14:05:08 2014 -0700 4.2 +++ b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java Fri Aug 22 12:03:49 2014 -0700 4.3 @@ -58,24 +58,31 @@ 4.4 new String[]{ 4.5 RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR, 4.6 unrecongnizedOption 4.7 - }, ExitCode.OK, "-XX:+UseRTMLocking" 4.8 + }, ExitCode.OK, 4.9 + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, 4.10 + "-XX:+UseRTMLocking" 4.11 ); 4.12 4.13 CommandLineOptionTest.verifySameJVMStartup(null, 4.14 new String[]{ 4.15 RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR, 4.16 unrecongnizedOption 4.17 - }, ExitCode.OK, "-XX:-UseRTMLocking" 4.18 + }, ExitCode.OK, 4.19 + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, 4.20 + "-XX:-UseRTMLocking" 4.21 ); 4.22 // verify that UseRTMLocking is of by default 4.23 CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking", 4.24 - TestUseRTMLockingOptionOnSupportedConfig.DEFAULT_VALUE); 4.25 + TestUseRTMLockingOptionOnSupportedConfig.DEFAULT_VALUE, 4.26 + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS); 4.27 // verify that we can change UseRTMLocking value 4.28 CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking", 4.29 TestUseRTMLockingOptionOnSupportedConfig.DEFAULT_VALUE, 4.30 + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, 4.31 "-XX:-UseRTMLocking"); 4.32 CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking", 4.33 - "true", "-XX:+UseRTMLocking"); 4.34 + "true", CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, 4.35 + "-XX:+UseRTMLocking"); 4.36 } 4.37 4.38 public static void main(String args[]) throws Throwable {
5.1 --- a/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java Thu Aug 28 14:05:08 2014 -0700 5.2 +++ b/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java Fri Aug 22 12:03:49 2014 -0700 5.3 @@ -53,18 +53,22 @@ 5.4 // verify that we will not get a warning 5.5 CommandLineOptionTest.verifySameJVMStartup(null, 5.6 new String[] { warningMessage }, ExitCode.OK, 5.7 + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, 5.8 "-XX:+UseRTMLocking", "-XX:-UseBiasedLocking"); 5.9 // verify that we will get a warning 5.10 CommandLineOptionTest.verifySameJVMStartup( 5.11 new String[] { warningMessage }, null, ExitCode.OK, 5.12 + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, 5.13 "-XX:+UseRTMLocking", "-XX:+UseBiasedLocking"); 5.14 // verify that UseBiasedLocking is false when we use rtm locking 5.15 CommandLineOptionTest.verifyOptionValueForSameVM("UseBiasedLocking", 5.16 - "false", "-XX:+UseRTMLocking"); 5.17 + "false", CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, 5.18 + "-XX:+UseRTMLocking"); 5.19 // verify that we can't turn on biased locking when 5.20 // using rtm locking 5.21 CommandLineOptionTest.verifyOptionValueForSameVM("UseBiasedLocking", 5.22 - "false", "-XX:+UseRTMLocking", "-XX:+UseBiasedLocking"); 5.23 + "false", CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, 5.24 + "-XX:+UseRTMLocking", "-XX:+UseBiasedLocking"); 5.25 } 5.26 5.27 public static void main(String args[]) throws Throwable {