From 847ba6becbaa24e2073d8cc83cc055da68e046d4 Mon Sep 17 00:00:00 2001 From: Fei Yang Date: Tue, 26 Feb 2019 10:52:31 +0800 Subject: [PATCH] 8219698: aarch64: SIGILL triggered when specifying unsupported hardware features Reviewed-by: aph --- src/hotspot/cpu/aarch64/vm_version_aarch64.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp index feab72fc9ec..9962617d035 100644 --- a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp @@ -258,8 +258,10 @@ void VM_Version::get_processor_features() { if (FLAG_IS_DEFAULT(UseCRC32)) { UseCRC32 = (auxv & HWCAP_CRC32) != 0; } + if (UseCRC32 && (auxv & HWCAP_CRC32) == 0) { warning("UseCRC32 specified, but not supported on this CPU"); + FLAG_SET_DEFAULT(UseCRC32, false); } if (FLAG_IS_DEFAULT(UseAdler32Intrinsics)) { @@ -277,6 +279,7 @@ void VM_Version::get_processor_features() { } else { if (UseLSE) { warning("UseLSE specified, but not supported on this CPU"); + FLAG_SET_DEFAULT(UseLSE, false); } } @@ -291,9 +294,11 @@ void VM_Version::get_processor_features() { } else { if (UseAES) { warning("UseAES specified, but not supported on this CPU"); + FLAG_SET_DEFAULT(UseAES, false); } if (UseAESIntrinsics) { warning("UseAESIntrinsics specified, but not supported on this CPU"); + FLAG_SET_DEFAULT(UseAESIntrinsics, false); } }