Skip to content
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

Open
wants to merge 6 commits into
base: macos-aarch64
Choose a base branch
from
Open

JDK 8253015 v2 #20

wants to merge 6 commits into from

Conversation

GlebSolovev
Copy link

@GlebSolovev GlebSolovev commented Nov 24, 2021

Ссылка на первую версию этого пулл реквеста, где мы обсудили, по-моему, все кроме graal-а: #18

Переношу этот рефакторинг кода: openjdk/jdk#154, ему как раз соответствует JDK 8253015.
Что и почему я при переносе изменил:

Вместе с основным бэкпортом рефакторинга кода переношу еще 3 коммита, исправляющих в нем ошибки:

int VM_Version::_zva_length;
int VM_Version::_dcache_line_size;
int VM_Version::_icache_line_size;
int VM_Version::_initial_sve_vector_length;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это случайно попало, оно не нужно

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Спасибо, действительно, случайно! Я даже помню, как его убивал, чорт)

Copy link
Member

@AntonKozlov AntonKozlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Круто! Реально сложный бекпорт попался. Всё хорошо по большей части 👍

Comment on lines +27 to +28
#include "runtime/arguments.hpp"
#include "runtime/globals_extension.hpp"
Copy link
Member

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>
Copy link
Member

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
Copy link
Member

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"));
Copy link
Member

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)

Comment on lines +66 to +75
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");
Copy link
Member

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, который повсеместно используется в хостпоте. Кажется лучше использовать его.

@AntonKozlov
Copy link
Member

Конфликты в edee095 отмечены в стиле по умолчанию. Реально удобнее работать с diff3 стилем. Глеб, на будущее добавь пожалуйста конфигурацию в git:

https://github.com/azul-research/macos-aarch64/blob/master/README.md#%D0%BD%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B9%D0%BA%D0%B0

(параграф добавил только что :))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants