-
Notifications
You must be signed in to change notification settings - Fork 42
8385359: [CRaC] aarch64: c7g.medium <-> c8g.medium FAIL: vector length #331
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
base: crac
Are you sure you want to change the base?
Changes from all commits
b14c031
8c52894
d985dad
e08bde7
fa57bb5
a46f297
b46ded6
d5f84fa
15449dd
0f62afa
b86c5ff
768aae4
588ee21
52d526c
cb71018
8db9bc7
cbb0746
be48727
09f983f
5e060d9
5ea5d93
9e5927d
205080e
c3d3644
7c8c827
000138b
7eb8b88
fc737cc
4c4a201
0340e76
32cf9c8
416e168
c1253a6
297ce42
d417007
8b6f0af
6473fb2
667defa
a78f4a3
28104d1
77a7638
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,6 +63,7 @@ | |
| GLIBC_UNSUPPORTED(A53MAC ); \ | ||
| GLIBC_UNSUPPORTED(ECV ); \ | ||
| GLIBC_UNSUPPORTED(WFXT ); \ | ||
| GLIBC_UNSUPPORTED(SVE256 ); \ | ||
| GLIBC_UNSUPPORTED(NOTPACA ); \ | ||
| /**/ | ||
| #include "runtime/abstract_vm_version.inline.hpp" | ||
|
|
@@ -930,3 +931,56 @@ void VM_Version::CPUFeatures_apply_arch(VM_Features &parsed, VM_Features &missin | |
| missing.clear_feature(CPU_PACA); | ||
| missing.clear_feature(CPU_NOTPACA); | ||
| } | ||
|
|
||
| bool VM_Version::process_image_cpu_features(const VM_Features *image_featuresp) { | ||
| int want; | ||
| if (image_featuresp == nullptr) { | ||
| // Cleanup after a failed restore. | ||
| want = supports_feature(CPU_SVE256) ? 32 : 16; | ||
| } else { | ||
| const VM_Features &image_features = *image_featuresp; | ||
| bool image_supports_sve256 = image_features.supports_feature(CPU_SVE256); | ||
| if (image_supports_sve256 && !_cpu_features.supports_feature(CPU_SVE256)) { | ||
| if (!Abstract_VM_Version::should_check_cpu_features()) { | ||
| return true; | ||
| } | ||
| ResourceMark rm; | ||
|
Collaborator
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.
|
||
| VM_Features sve256; | ||
| sve256.set_feature(CPU_SVE256); | ||
| VM_Features use = image_features & _cpu_features; | ||
| log_error(crac)("The image has -XX:CPUFeatures=%s with CPU_SVE256=%s, this CPU has CPUFeatures=%s not supporting CPU_SVE256, try using -XX:CPUFeatures=%s on checkpoint.", | ||
| image_features.print_numbers(), sve256.print_numbers(), _cpu_features.print_numbers(), use.print_numbers()); | ||
| return false; | ||
| } | ||
| want = image_supports_sve256 ? 32 : 16; | ||
| } | ||
| if (set_maximum_sve_vector_length(want) == want) { | ||
| return true; | ||
| } | ||
| if (!_cpu_features.supports_feature(CPU_SVE)) { | ||
| guarantee(want == 16, "CPU_SVE256 cannot be present without CPU_SVE"); | ||
| return true; | ||
| } | ||
| // Always call PR_SVE_SET_VL, we do not know who did execute this JVM. | ||
| errno = 0; | ||
| int got = set_and_get_current_sve_vector_length(want); | ||
| if (got != want) { | ||
| ResourceMark rm; | ||
| VM_Features sve256; | ||
| sve256.set_feature(CPU_SVE256); | ||
| if (image_featuresp != nullptr) { | ||
| const VM_Features &image_features = *image_featuresp; | ||
| log_error(crac)("The image has -XX:CPUFeatures=%s with CPU_SVE256=%s %s, this CPU has CPUFeatures=%s but PR_SVE_SET_VL reports %d: %s", | ||
| image_features.print_numbers(), sve256.print_numbers(), | ||
| want == 32 ? "set" : "unset", | ||
| _cpu_features.print_numbers(), got, os::strerror(errno)); | ||
| } else { | ||
| log_error(crac)("Cannot restore this JVM's CPUFeatures=%s with CPU_SVE256=%s %s, this CPU has CPUFeatures=%s but PR_SVE_SET_VL reports %d: %s", | ||
| _features.print_numbers(), sve256.print_numbers(), | ||
| want == 32 ? "set" : "unset", | ||
| _cpu_features.print_numbers(), got, os::strerror(errno)); | ||
| } | ||
| return false; | ||
| } | ||
| return true; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,7 +57,7 @@ class VM_Version: public Abstract_VM_Version { | |
| static void check_virtualizations(); | ||
| struct VM_Features: public Zero_Features {}; | ||
| static bool cpu_features_binary(VM_Features *data) { return false; } | ||
| static bool check_cpu_features_skip() { return true; } | ||
| static bool can_use_cpu_features() { return false; } | ||
|
Collaborator
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. The two new methods and |
||
|
|
||
| // Override Abstract_VM_Version implementation | ||
| static void print_platform_virtualization_info(outputStream*); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,7 @@ | |
| */ | ||
|
|
||
| #include "memory/resourceArea.hpp" | ||
| #include "runtime/globals_extension.hpp" | ||
| #include "runtime/java.hpp" | ||
| #include "runtime/os.hpp" | ||
| #include "runtime/os.inline.hpp" | ||
|
|
@@ -120,9 +121,17 @@ int VM_Version::get_current_sve_vector_length() { | |
| return prctl(PR_SVE_GET_VL); | ||
| } | ||
|
|
||
| static int maximum_sve_vector_length = INT_MAX; | ||
|
|
||
| int VM_Version::set_maximum_sve_vector_length(int length) { | ||
| int retval = maximum_sve_vector_length; | ||
| maximum_sve_vector_length = length; | ||
| return retval; | ||
| } | ||
|
|
||
| int VM_Version::set_and_get_current_sve_vector_length(int length) { | ||
| assert(VM_Version::supports_sve(), "should not call this"); | ||
| int new_length = prctl(PR_SVE_SET_VL, length); | ||
| assert(_cpu_features.supports_feature(CPU_SVE), "should not call this"); | ||
| int new_length = prctl(PR_SVE_SET_VL, MIN2(length, maximum_sve_vector_length)); | ||
| return new_length; | ||
| } | ||
|
|
||
|
|
@@ -163,6 +172,10 @@ void VM_Version::get_os_cpu_info() { | |
| update_feature(auxv2, CPU_WFXT, HWCAP2_WFXT ); | ||
| update_feature(~auxv, CPU_NOTPACA, HWCAP_PACA ); | ||
|
|
||
| if (supports_sve() && get_current_sve_vector_length() == 32) { | ||
| set_feature(CPU_SVE256); | ||
| } | ||
|
Comment on lines
+175
to
+177
Collaborator
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. The rest of the code seems to assume that
Collaborator
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. AI also complains about smaller sizes, resending verbatim:
|
||
|
|
||
| uint64_t ctr_el0; | ||
| uint64_t dczid_el0; | ||
| __asm__ ( | ||
|
|
@@ -226,6 +239,20 @@ void VM_Version::check_os_cpu_info() { | |
| // GLIBC_TUNABLES=glibc.cpu.hwcaps is unsupported on aarch64 | ||
| vm_exit_during_initialization(err_msg("LSE (%s) cannot be disabled via -XX:CPUFeatures on aarch64.", lse.print_numbers())); | ||
| } | ||
| if (FLAG_IS_DEFAULT(CPUFeatures)) { | ||
| assert(_cpu_features.supports_feature(CPU_SVE256) == _features.supports_feature(CPU_SVE256), "CPU_SVE256 is not changed"); | ||
| } else if (_cpu_features.supports_feature(CPU_SVE256) && !_features.supports_feature(CPU_SVE256)) { | ||
| maximum_sve_vector_length = 16; | ||
| int got = set_and_get_current_sve_vector_length(maximum_sve_vector_length); | ||
| if (got != maximum_sve_vector_length) { | ||
| stringStream ss; | ||
| VM_Features sve256; | ||
| sve256.set_feature(VM_Feature_Flag::CPU_SVE256); | ||
| ss.print("Specified -XX:CPUFeatures=%s have unset CPU_SVE256=%s, this CPU has CPUFeatures=%s but it cannot be disabled as PR_SVE_SET_VL reports %d: %m", | ||
| _features.print_numbers(), sve256.print_numbers(), _cpu_features.print_numbers(), got); | ||
|
Collaborator
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.
There are other usages of it without the mark, but they are pre-existing. |
||
| vm_exit_during_initialization(ss.base()); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| static bool read_fully(const char *fname, char *buf, size_t buflen) { | ||
|
|
||
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.
want_sve_vector_length