-
Notifications
You must be signed in to change notification settings - Fork 0
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
JDK 8253015 v2 #20
base: macos-aarch64
Are you sure you want to change the base?
JDK 8253015 v2 #20
Conversation
Backport ec9bee68660acd6abf0b4dd4023ae69514542256
Backport 36998b006d6a9ee8145004778534d1f35a55e068
Backport 2c8f4e202bd7e5b78edb32580b8a836660493d9c
Backport da48003abd2e88ad0d435c01a7c17073e1a61569
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Это случайно попало, оно не нужно
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.
Спасибо, действительно, случайно! Я даже помню, как его убивал, чорт)
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 "runtime/arguments.hpp" | ||
#include "runtime/globals_extension.hpp" |
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
@@ -27,3 +27,101 @@ | |||
#include "runtime/os.hpp" | |||
#include "runtime/vm_version.hpp" | |||
|
|||
#include <asm/hwcap.h> | |||
#include <sys/auxv.h> | |||
#include <sys/prctl.h> |
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 <sys/prctl.h>
|
||
boolean isDcZvaProhibited = true; | ||
int zvaLength = 0; | ||
if (GraalHotSpotVMConfig.JDK >= 16) { // TODO: fix GraalHotSpotVMConfig.JDK >= 16 |
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.
Тут получается надо добавить проверку на JDK_UPDATE
из src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigAccess.java
т.е. JDK >= 16 || (JDK >= 15 && JDK_UPDATE >= xxx
А xxx
можно посмотреть в make/autoconf/version-numbers:
DEFAULT_VERSION_UPDATE=6
Надо бы убедиться, что значение действительно сюда проходит и используется как надо.
Насколько я вижу, использование грааля включается -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler
(https://openjdk.java.net/jeps/317), плюс -Xcomp
триггерит компиляцию каждого встреченного java метода. И тогда можно добавить отладочную печать прямо сюда.
@@ -705,7 +705,10 @@ public int threadTlabPfTopOffset() { | |||
// ARMv8-A architecture reference manual D12.2.35 Data Cache Zero ID register says: | |||
// * BS, bits [3:0] indicate log2 of the DC ZVA block size in (4-byte) words. | |||
// * DZP, bit [4] of indicates whether use of DC ZVA instruction is prohibited. | |||
public final int psrInfoDczidValue = getFieldValue("VM_Version::_psr_info.dczid_el0", Integer.class, "uint32_t", 0x10, (JVMCI ? jvmciGE(JVMCI_19_3_b04) : JDK >= 14) && osArch.equals("aarch64")); | |||
public final int psrInfoDczidValue = getFieldValue("VM_Version::_psr_info.dczid_el0", Integer.class, "uint32_t", 0x10, | |||
(JVMCI ? jvmciGE(JVMCI_19_3_b04) : (JDK == 14 || JDK == 15)) && osArch.equals("aarch64")); |
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.
JDK == 15
должно теперь видимо превратиться в (JDK == 15 && JDK_UPDATE < xxx)
static_assert(CPU_FP == HWCAP_FP, "Flag CPU_FP must follow Linux HWCAP"); | ||
static_assert(CPU_ASIMD == HWCAP_ASIMD, "Flag CPU_ASIMD must follow Linux HWCAP"); | ||
static_assert(CPU_EVTSTRM == HWCAP_EVTSTRM, "Flag CPU_EVTSTRM must follow Linux HWCAP"); | ||
static_assert(CPU_AES == HWCAP_AES, "Flag CPU_AES must follow Linux HWCAP"); | ||
static_assert(CPU_PMULL == HWCAP_PMULL, "Flag CPU_PMULL must follow Linux HWCAP"); | ||
static_assert(CPU_SHA1 == HWCAP_SHA1, "Flag CPU_SHA1 must follow Linux HWCAP"); | ||
static_assert(CPU_SHA2 == HWCAP_SHA2, "Flag CPU_SHA2 must follow Linux HWCAP"); | ||
static_assert(CPU_CRC32 == HWCAP_CRC32, "Flag CPU_CRC32 must follow Linux HWCAP"); | ||
static_assert(CPU_LSE == HWCAP_ATOMICS, "Flag CPU_LSE must follow Linux HWCAP"); | ||
static_assert(CPU_DCPOP == HWCAP_DCPOP, "Flag CPU_DCPOP must follow Linux HWCAP"); |
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.
А надо как-то запускать configure особо? у меня ругается на нашем кросс-компайлере
/home/anton/proj/jdk15u-dev/src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp:65:3: error: identifier 'static_assert' is a keyword in C++11 [-Werror=c++11-compat]
А в
#define STATIC_ASSERT(Cond) \ |
STATIC_ASSERT
, который повсеместно используется в хостпоте. Кажется лучше использовать его.
Конфликты в edee095 отмечены в стиле по умолчанию. Реально удобнее работать с diff3 стилем. Глеб, на будущее добавь пожалуйста конфигурацию в git: (параграф добавил только что :)) |
Ссылка на первую версию этого пулл реквеста, где мы обсудили, по-моему, все кроме graal-а: #18
Переношу этот рефакторинг кода: openjdk/jdk#154, ему как раз соответствует JDK 8253015.
Что и почему я при переносе изменил:
убрал все, что касалось SVE: его поддержка появилась только в jdk 16
убрал MD5 Intrinsics, так как они тоже появились только в jdk 16
убрал SHA512, так как его поддержали тоже только в jdk 16
добавил комментарии с
TODO
к изменениям в graal-e, в которых проверялось условиеJDK >= 16
TODO
психологическая помощьВместе с основным бэкпортом рефакторинга кода переношу еще 3 коммита, исправляющих в нем ошибки:
guarantee(cpu_lines == os::processor_count(), "core count should be consistent");
и связанных с нею идейно штук:static_assert
-ов: 8255975: Fix AArch64 OpenJDK build failure with gcc-5 openjdk/jdk#1088