提交 df845d7b 编写于 作者: K kvn

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
上级 67575a56
...@@ -612,6 +612,17 @@ void VM_Version::get_processor_features() { ...@@ -612,6 +612,17 @@ void VM_Version::get_processor_features() {
#if INCLUDE_RTM_OPT #if INCLUDE_RTM_OPT
if (UseRTMLocking) { if (UseRTMLocking) {
if (is_intel_family_core()) {
if ((_model == CPU_MODEL_HASWELL_E3) ||
(_model == CPU_MODEL_HASWELL_E7 && _stepping < 3) ||
(_model == CPU_MODEL_BROADWELL && _stepping < 4)) {
if (!UnlockExperimentalVMOptions) {
vm_exit_during_initialization("UseRTMLocking is only available as experimental option on this platform. It must be enabled via -XX:+UnlockExperimentalVMOptions flag.");
} else {
warning("UseRTMLocking is only available as experimental option on this platform.");
}
}
}
if (!FLAG_IS_CMDLINE(UseRTMLocking)) { if (!FLAG_IS_CMDLINE(UseRTMLocking)) {
// RTM locking should be used only for applications with // RTM locking should be used only for applications with
// high lock contention. For now we do not use it by default. // high lock contention. For now we do not use it by default.
......
...@@ -276,7 +276,10 @@ protected: ...@@ -276,7 +276,10 @@ protected:
CPU_MODEL_WESTMERE_EX = 0x2f, CPU_MODEL_WESTMERE_EX = 0x2f,
CPU_MODEL_SANDYBRIDGE = 0x2a, CPU_MODEL_SANDYBRIDGE = 0x2a,
CPU_MODEL_SANDYBRIDGE_EP = 0x2d, CPU_MODEL_SANDYBRIDGE_EP = 0x2d,
CPU_MODEL_IVYBRIDGE_EP = 0x3a CPU_MODEL_IVYBRIDGE_EP = 0x3a,
CPU_MODEL_HASWELL_E3 = 0x3c,
CPU_MODEL_HASWELL_E7 = 0x3f,
CPU_MODEL_BROADWELL = 0x3d
} cpuExtendedFamily; } cpuExtendedFamily;
// cpuid information block. All info derived from executing cpuid with // cpuid information block. All info derived from executing cpuid with
......
...@@ -62,13 +62,16 @@ public class TestUseRTMDeoptOptionOnSupportedConfig ...@@ -62,13 +62,16 @@ public class TestUseRTMDeoptOptionOnSupportedConfig
// verify default value // verify default value
CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt",
TestUseRTMDeoptOptionOnSupportedConfig.DEFAULT_VALUE, TestUseRTMDeoptOptionOnSupportedConfig.DEFAULT_VALUE,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:+UseRTMLocking"); "-XX:+UseRTMLocking");
// verify that option is off when UseRTMLocking is off // verify that option is off when UseRTMLocking is off
CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", "false",
"false", "-XX:-UseRTMLocking", "-XX:+UseRTMDeopt"); CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:-UseRTMLocking", "-XX:+UseRTMDeopt");
// verify that option could be turned on // verify that option could be turned on
CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", "true",
"true", "-XX:+UseRTMLocking", "-XX:+UseRTMDeopt"); CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:+UseRTMLocking", "-XX:+UseRTMDeopt");
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
......
...@@ -58,24 +58,31 @@ public class TestUseRTMLockingOptionOnSupportedConfig ...@@ -58,24 +58,31 @@ public class TestUseRTMLockingOptionOnSupportedConfig
new String[]{ new String[]{
RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR, RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR,
unrecongnizedOption unrecongnizedOption
}, ExitCode.OK, "-XX:+UseRTMLocking" }, ExitCode.OK,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:+UseRTMLocking"
); );
CommandLineOptionTest.verifySameJVMStartup(null, CommandLineOptionTest.verifySameJVMStartup(null,
new String[]{ new String[]{
RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR, RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR,
unrecongnizedOption unrecongnizedOption
}, ExitCode.OK, "-XX:-UseRTMLocking" }, ExitCode.OK,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:-UseRTMLocking"
); );
// verify that UseRTMLocking is of by default // verify that UseRTMLocking is of by default
CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking", CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking",
TestUseRTMLockingOptionOnSupportedConfig.DEFAULT_VALUE); TestUseRTMLockingOptionOnSupportedConfig.DEFAULT_VALUE,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS);
// verify that we can change UseRTMLocking value // verify that we can change UseRTMLocking value
CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking", CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking",
TestUseRTMLockingOptionOnSupportedConfig.DEFAULT_VALUE, TestUseRTMLockingOptionOnSupportedConfig.DEFAULT_VALUE,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:-UseRTMLocking"); "-XX:-UseRTMLocking");
CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking", CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking",
"true", "-XX:+UseRTMLocking"); "true", CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:+UseRTMLocking");
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
......
...@@ -53,18 +53,22 @@ public class TestUseRTMLockingOptionWithBiasedLocking ...@@ -53,18 +53,22 @@ public class TestUseRTMLockingOptionWithBiasedLocking
// verify that we will not get a warning // verify that we will not get a warning
CommandLineOptionTest.verifySameJVMStartup(null, CommandLineOptionTest.verifySameJVMStartup(null,
new String[] { warningMessage }, ExitCode.OK, new String[] { warningMessage }, ExitCode.OK,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:+UseRTMLocking", "-XX:-UseBiasedLocking"); "-XX:+UseRTMLocking", "-XX:-UseBiasedLocking");
// verify that we will get a warning // verify that we will get a warning
CommandLineOptionTest.verifySameJVMStartup( CommandLineOptionTest.verifySameJVMStartup(
new String[] { warningMessage }, null, ExitCode.OK, new String[] { warningMessage }, null, ExitCode.OK,
CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:+UseRTMLocking", "-XX:+UseBiasedLocking"); "-XX:+UseRTMLocking", "-XX:+UseBiasedLocking");
// verify that UseBiasedLocking is false when we use rtm locking // verify that UseBiasedLocking is false when we use rtm locking
CommandLineOptionTest.verifyOptionValueForSameVM("UseBiasedLocking", CommandLineOptionTest.verifyOptionValueForSameVM("UseBiasedLocking",
"false", "-XX:+UseRTMLocking"); "false", CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:+UseRTMLocking");
// verify that we can't turn on biased locking when // verify that we can't turn on biased locking when
// using rtm locking // using rtm locking
CommandLineOptionTest.verifyOptionValueForSameVM("UseBiasedLocking", CommandLineOptionTest.verifyOptionValueForSameVM("UseBiasedLocking",
"false", "-XX:+UseRTMLocking", "-XX:+UseBiasedLocking"); "false", CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS,
"-XX:+UseRTMLocking", "-XX:+UseBiasedLocking");
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册