forked from openjdk/jdk15u-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
JDK 8253015 v2 #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
GlebSolovev
wants to merge
6
commits into
macos-aarch64
Choose a base branch
from
JDK-8253015-v2
base: macos-aarch64
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
JDK 8253015 v2 #20
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
edee095
8253015: Aarch64: Move linux code out from generic CPU feature detection
GlebSolovev 56c36c1
fixup! 8253015: Aarch64: Move linux code out from generic CPU feature…
GlebSolovev 1cdfe33
8255716: AArch64: Regression: JVM crashes if manually offline a core
GlebSolovev 3d971b4
8255799: AArch64: CPU_A53MAC feature may be set incorrectly
GlebSolovev a65be4c
8255975: Fix AArch64 OpenJDK build failure with gcc-5
GlebSolovev d56ead6
fixup! 8255975: Fix AArch64 OpenJDK build failure with gcc-5
GlebSolovev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,102 +24,35 @@ | |
| */ | ||
|
|
||
| #include "precompiled.hpp" | ||
| #include "asm/macroAssembler.hpp" | ||
| #include "asm/macroAssembler.inline.hpp" | ||
| #include "memory/resourceArea.hpp" | ||
| #include "runtime/arguments.hpp" | ||
| #include "runtime/globals_extension.hpp" | ||
| #include "runtime/java.hpp" | ||
| #include "runtime/os.hpp" | ||
| #include "runtime/stubCodeGenerator.hpp" | ||
| #include "runtime/vm_version.hpp" | ||
| #include "utilities/macros.hpp" | ||
|
|
||
| #include OS_HEADER_INLINE(os) | ||
|
|
||
| #include <sys/auxv.h> | ||
| #include <asm/hwcap.h> | ||
|
|
||
| #ifndef HWCAP_AES | ||
| #define HWCAP_AES (1<<3) | ||
| #endif | ||
|
|
||
| #ifndef HWCAP_PMULL | ||
| #define HWCAP_PMULL (1<<4) | ||
| #endif | ||
|
|
||
| #ifndef HWCAP_SHA1 | ||
| #define HWCAP_SHA1 (1<<5) | ||
| #endif | ||
|
|
||
| #ifndef HWCAP_SHA2 | ||
| #define HWCAP_SHA2 (1<<6) | ||
| #endif | ||
|
|
||
| #ifndef HWCAP_CRC32 | ||
| #define HWCAP_CRC32 (1<<7) | ||
| #endif | ||
|
|
||
| #ifndef HWCAP_ATOMICS | ||
| #define HWCAP_ATOMICS (1<<8) | ||
| #endif | ||
|
|
||
| int VM_Version::_cpu; | ||
| int VM_Version::_model; | ||
| int VM_Version::_model2; | ||
| int VM_Version::_variant; | ||
| int VM_Version::_revision; | ||
| int VM_Version::_stepping; | ||
| bool VM_Version::_dcpop; | ||
| VM_Version::PsrInfo VM_Version::_psr_info = { 0, }; | ||
|
|
||
| static BufferBlob* stub_blob; | ||
| static const int stub_size = 550; | ||
|
|
||
| extern "C" { | ||
| typedef void (*getPsrInfo_stub_t)(void*); | ||
| } | ||
| static getPsrInfo_stub_t getPsrInfo_stub = NULL; | ||
|
|
||
|
|
||
| class VM_Version_StubGenerator: public StubCodeGenerator { | ||
| public: | ||
|
|
||
| VM_Version_StubGenerator(CodeBuffer *c) : StubCodeGenerator(c) {} | ||
|
|
||
| address generate_getPsrInfo() { | ||
| StubCodeMark mark(this, "VM_Version", "getPsrInfo_stub"); | ||
| # define __ _masm-> | ||
| address start = __ pc(); | ||
|
|
||
| // void getPsrInfo(VM_Version::PsrInfo* psr_info); | ||
|
|
||
| address entry = __ pc(); | ||
|
|
||
| __ enter(); | ||
| int VM_Version::_zva_length; | ||
| int VM_Version::_dcache_line_size; | ||
| int VM_Version::_icache_line_size; | ||
| int VM_Version::_initial_sve_vector_length; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Это случайно попало, оно не нужно
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Спасибо, действительно, случайно! Я даже помню, как его убивал, чорт) |
||
|
|
||
| __ get_dczid_el0(rscratch1); | ||
| __ strw(rscratch1, Address(c_rarg0, in_bytes(VM_Version::dczid_el0_offset()))); | ||
|
|
||
| __ get_ctr_el0(rscratch1); | ||
| __ strw(rscratch1, Address(c_rarg0, in_bytes(VM_Version::ctr_el0_offset()))); | ||
|
|
||
| __ leave(); | ||
| __ ret(lr); | ||
|
|
||
| # undef __ | ||
|
|
||
| return start; | ||
| } | ||
| }; | ||
|
|
||
|
|
||
| void VM_Version::get_processor_features() { | ||
| void VM_Version::initialize() { | ||
| _supports_cx8 = true; | ||
| _supports_atomic_getset4 = true; | ||
| _supports_atomic_getadd4 = true; | ||
| _supports_atomic_getset8 = true; | ||
| _supports_atomic_getadd8 = true; | ||
|
|
||
| getPsrInfo_stub(&_psr_info); | ||
| get_os_cpu_info(); | ||
|
|
||
| int dcache_line = VM_Version::dcache_line_size(); | ||
|
|
||
|
|
@@ -161,44 +94,11 @@ void VM_Version::get_processor_features() { | |
| SoftwarePrefetchHintDistance &= ~7; | ||
| } | ||
|
|
||
| uint64_t auxv = getauxval(AT_HWCAP); | ||
|
|
||
| char buf[512]; | ||
|
|
||
| _features = auxv; | ||
|
|
||
| int cpu_lines = 0; | ||
| if (FILE *f = fopen("/proc/cpuinfo", "r")) { | ||
| // need a large buffer as the flags line may include lots of text | ||
| char buf[1024], *p; | ||
| while (fgets(buf, sizeof (buf), f) != NULL) { | ||
| if ((p = strchr(buf, ':')) != NULL) { | ||
| long v = strtol(p+1, NULL, 0); | ||
| if (strncmp(buf, "CPU implementer", sizeof "CPU implementer" - 1) == 0) { | ||
| _cpu = v; | ||
| cpu_lines++; | ||
| } else if (strncmp(buf, "CPU variant", sizeof "CPU variant" - 1) == 0) { | ||
| _variant = v; | ||
| } else if (strncmp(buf, "CPU part", sizeof "CPU part" - 1) == 0) { | ||
| if (_model != v) _model2 = _model; | ||
| _model = v; | ||
| } else if (strncmp(buf, "CPU revision", sizeof "CPU revision" - 1) == 0) { | ||
| _revision = v; | ||
| } else if (strncmp(buf, "flags", sizeof("flags") - 1) == 0) { | ||
| if (strstr(p+1, "dcpop")) { | ||
| _dcpop = true; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| fclose(f); | ||
| } | ||
|
|
||
| if (os::supports_map_sync()) { | ||
| // if dcpop is available publish data cache line flush size via | ||
| // generic field, otherwise let if default to zero thereby | ||
| // disabling writeback | ||
| if (_dcpop) { | ||
| if (_features & CPU_DCPOP) { | ||
| _data_cache_line_flush_size = dcache_line; | ||
| } | ||
| } | ||
|
|
@@ -273,27 +173,24 @@ void VM_Version::get_processor_features() { | |
| } | ||
|
|
||
| if (_cpu == CPU_ARM && (_model == 0xd07 || _model2 == 0xd07)) _features |= CPU_STXR_PREFETCH; | ||
| // If an olde style /proc/cpuinfo (cpu_lines == 1) then if _model is an A57 (0xd07) | ||
| // we assume the worst and assume we could be on a big little system and have | ||
| // undisclosed A53 cores which we could be swapped to at any stage | ||
| if (_cpu == CPU_ARM && cpu_lines == 1 && _model == 0xd07) _features |= CPU_A53MAC; | ||
|
|
||
| char buf[512]; | ||
| sprintf(buf, "0x%02x:0x%x:0x%03x:%d", _cpu, _variant, _model, _revision); | ||
| if (_model2) sprintf(buf+strlen(buf), "(0x%03x)", _model2); | ||
| if (auxv & HWCAP_ASIMD) strcat(buf, ", simd"); | ||
| if (auxv & HWCAP_CRC32) strcat(buf, ", crc"); | ||
| if (auxv & HWCAP_AES) strcat(buf, ", aes"); | ||
| if (auxv & HWCAP_SHA1) strcat(buf, ", sha1"); | ||
| if (auxv & HWCAP_SHA2) strcat(buf, ", sha256"); | ||
| if (auxv & HWCAP_ATOMICS) strcat(buf, ", lse"); | ||
| if (_features & CPU_ASIMD) strcat(buf, ", simd"); | ||
| if (_features & CPU_CRC32) strcat(buf, ", crc"); | ||
| if (_features & CPU_AES) strcat(buf, ", aes"); | ||
| if (_features & CPU_SHA1) strcat(buf, ", sha1"); | ||
| if (_features & CPU_SHA2) strcat(buf, ", sha256"); | ||
| if (_features & CPU_LSE) strcat(buf, ", lse"); | ||
|
|
||
| _features_string = os::strdup(buf); | ||
|
|
||
| if (FLAG_IS_DEFAULT(UseCRC32)) { | ||
| UseCRC32 = (auxv & HWCAP_CRC32) != 0; | ||
| UseCRC32 = (_features & CPU_CRC32) != 0; | ||
| } | ||
|
|
||
| if (UseCRC32 && (auxv & HWCAP_CRC32) == 0) { | ||
| if (UseCRC32 && (_features & CPU_CRC32) == 0) { | ||
| warning("UseCRC32 specified, but not supported on this CPU"); | ||
| FLAG_SET_DEFAULT(UseCRC32, false); | ||
| } | ||
|
|
@@ -307,7 +204,7 @@ void VM_Version::get_processor_features() { | |
| FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false); | ||
| } | ||
|
|
||
| if (auxv & HWCAP_ATOMICS) { | ||
| if (_features & CPU_LSE) { | ||
| if (FLAG_IS_DEFAULT(UseLSE)) | ||
| FLAG_SET_DEFAULT(UseLSE, true); | ||
| } else { | ||
|
|
@@ -317,7 +214,7 @@ void VM_Version::get_processor_features() { | |
| } | ||
| } | ||
|
|
||
| if (auxv & HWCAP_AES) { | ||
| if (_features & CPU_AES) { | ||
| UseAES = UseAES || FLAG_IS_DEFAULT(UseAES); | ||
| UseAESIntrinsics = | ||
| UseAESIntrinsics || (UseAES && FLAG_IS_DEFAULT(UseAESIntrinsics)); | ||
|
|
@@ -345,7 +242,7 @@ void VM_Version::get_processor_features() { | |
| UseCRC32Intrinsics = true; | ||
| } | ||
|
|
||
| if (auxv & HWCAP_CRC32) { | ||
| if (_features & CPU_CRC32) { | ||
| if (FLAG_IS_DEFAULT(UseCRC32CIntrinsics)) { | ||
| FLAG_SET_DEFAULT(UseCRC32CIntrinsics, true); | ||
| } | ||
|
|
@@ -358,7 +255,7 @@ void VM_Version::get_processor_features() { | |
| FLAG_SET_DEFAULT(UseFMA, true); | ||
| } | ||
|
|
||
| if (auxv & (HWCAP_SHA1 | HWCAP_SHA2)) { | ||
| if (_features & (CPU_SHA1 | CPU_SHA2)) { | ||
| if (FLAG_IS_DEFAULT(UseSHA)) { | ||
| FLAG_SET_DEFAULT(UseSHA, true); | ||
| } | ||
|
|
@@ -367,7 +264,7 @@ void VM_Version::get_processor_features() { | |
| FLAG_SET_DEFAULT(UseSHA, false); | ||
| } | ||
|
|
||
| if (UseSHA && (auxv & HWCAP_SHA1)) { | ||
| if (UseSHA && (_features & CPU_SHA1)) { | ||
| if (FLAG_IS_DEFAULT(UseSHA1Intrinsics)) { | ||
| FLAG_SET_DEFAULT(UseSHA1Intrinsics, true); | ||
| } | ||
|
|
@@ -376,7 +273,7 @@ void VM_Version::get_processor_features() { | |
| FLAG_SET_DEFAULT(UseSHA1Intrinsics, false); | ||
| } | ||
|
|
||
| if (UseSHA && (auxv & HWCAP_SHA2)) { | ||
| if (UseSHA && (_features & CPU_SHA2)) { | ||
| if (FLAG_IS_DEFAULT(UseSHA256Intrinsics)) { | ||
| FLAG_SET_DEFAULT(UseSHA256Intrinsics, true); | ||
| } | ||
|
|
@@ -394,7 +291,7 @@ void VM_Version::get_processor_features() { | |
| FLAG_SET_DEFAULT(UseSHA, false); | ||
| } | ||
|
|
||
| if (auxv & HWCAP_PMULL) { | ||
| if (_features & CPU_PMULL) { | ||
| if (FLAG_IS_DEFAULT(UseGHASHIntrinsics)) { | ||
| FLAG_SET_DEFAULT(UseGHASHIntrinsics, true); | ||
| } | ||
|
|
@@ -457,22 +354,6 @@ void VM_Version::get_processor_features() { | |
| AlignVector = AvoidUnalignedAccesses; | ||
| } | ||
| #endif | ||
| } | ||
|
|
||
| void VM_Version::initialize() { | ||
| ResourceMark rm; | ||
|
|
||
| stub_blob = BufferBlob::create("getPsrInfo_stub", stub_size); | ||
| if (stub_blob == NULL) { | ||
| vm_exit_during_initialization("Unable to allocate getPsrInfo_stub"); | ||
| } | ||
|
|
||
| CodeBuffer c(stub_blob); | ||
| VM_Version_StubGenerator g(&c); | ||
| getPsrInfo_stub = CAST_TO_FN_PTR(getPsrInfo_stub_t, | ||
| g.generate_getPsrInfo()); | ||
|
|
||
| get_processor_features(); | ||
|
|
||
| UNSUPPORTED_OPTION(CriticalJNINatives); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Выглядит как лишние include