Skip to content

Commit ecc0a99

Browse files
committed
Merge branch 'master' into remove-special
2 parents 81c5fef + 111d5e1 commit ecc0a99

File tree

151 files changed

+2541
-1091
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+2541
-1091
lines changed

make/autoconf/flags-ldflags.m4

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,10 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS],
3232
3333
# Setup the target toolchain
3434
35+
# The target dir matches the name of VM variant
36+
TARGET_JVM_VARIANT_PATH=$JVM_VARIANT_MAIN
37+
3538
# On some platforms (mac) the linker warns about non existing -L dirs.
36-
# For any of the variants server, client, minimal or zero, the dir matches the
37-
# variant name. The "main" variant should be used for linking. For the
38-
# rest, the dir is just server.
39-
if HOTSPOT_CHECK_JVM_VARIANT(server) || HOTSPOT_CHECK_JVM_VARIANT(client) \
40-
|| HOTSPOT_CHECK_JVM_VARIANT(minimal) || HOTSPOT_CHECK_JVM_VARIANT(zero); then
41-
TARGET_JVM_VARIANT_PATH=$JVM_VARIANT_MAIN
42-
else
43-
TARGET_JVM_VARIANT_PATH=server
44-
fi
4539
FLAGS_SETUP_LDFLAGS_CPU_DEP([TARGET])
4640
4741
# Setup the build toolchain

make/autoconf/hotspot.m4

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,6 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANTS],
8383
AC_MSG_ERROR([Cannot continue])
8484
fi
8585
86-
# All "special" variants share the same output directory ("server")
87-
VALID_MULTIPLE_JVM_VARIANTS="server client minimal zero"
88-
UTIL_GET_NON_MATCHING_VALUES(INVALID_MULTIPLE_VARIANTS, $JVM_VARIANTS, \
89-
$VALID_MULTIPLE_JVM_VARIANTS)
90-
if test "x$INVALID_MULTIPLE_VARIANTS" != x && \
91-
test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = xtrue; then
92-
AC_MSG_ERROR([You can only build multiple variants using these variants: '$VALID_MULTIPLE_JVM_VARIANTS'])
93-
fi
94-
9586
# The "main" variant is the one used by other libs to link against during the
9687
# build.
9788
if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xtrue"; then

make/hotspot/HotspotCommon.gmk

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,7 @@ JVM_SUPPORT_DIR := $(JVM_VARIANT_OUTPUTDIR)/support
3434
DTRACE_SUPPORT_DIR := $(JVM_SUPPORT_DIR)/dtrace
3535

3636
LIB_OUTPUTDIR := $(call FindLibDirForModule, java.base)
37-
ifneq ($(filter client minimal zero, $(JVM_VARIANT)), )
38-
JVM_VARIANT_SUBDIR := $(JVM_VARIANT)
39-
else
40-
# Use 'server' as default target directory name for all other variants.
41-
JVM_VARIANT_SUBDIR := server
42-
endif
43-
JVM_LIB_OUTPUTDIR := $(LIB_OUTPUTDIR)/$(JVM_VARIANT_SUBDIR)
37+
JVM_LIB_OUTPUTDIR := $(LIB_OUTPUTDIR)/$(JVM_VARIANT)
4438

4539
################################################################################
4640

make/modules/java.base/Copy.gmk

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,10 @@ ifeq ($(call And, $(call isTargetOs, windows) $(call isTargetCpu, x86)), true)
9595
endif
9696
DEFAULT_CFG_VARIANT ?= server
9797

98-
# Any variant other than server, client, minimal, or zero is represented as server in
99-
# the cfg file.
100-
VALID_CFG_VARIANTS := server client minimal zero
101-
CFG_VARIANTS := $(filter $(VALID_CFG_VARIANTS), $(JVM_VARIANTS)) \
102-
$(if $(filter-out $(VALID_CFG_VARIANTS), $(JVM_VARIANTS)), server)
103-
10498
# Change the order to put the default variant first if present.
10599
ORDERED_CFG_VARIANTS := \
106-
$(if $(filter $(DEFAULT_CFG_VARIANT), $(CFG_VARIANTS)), $(DEFAULT_CFG_VARIANT)) \
107-
$(filter-out $(DEFAULT_CFG_VARIANT), $(CFG_VARIANTS))
100+
$(if $(filter $(DEFAULT_CFG_VARIANT), $(JVM_VARIANTS)), $(DEFAULT_CFG_VARIANT)) \
101+
$(filter-out $(DEFAULT_CFG_VARIANT), $(JVM_VARIANTS))
108102

109103
JVMCFG := $(LIB_DST_DIR)/jvm.cfg
110104

make/modules/java.base/Lib.gmk

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,8 @@ ifeq ($(call isTargetOsType, unix), true)
156156
TARGETS += $(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig)
157157
endef
158158

159-
# The subdir is the same as the variant for client, minimal or zero, for all
160-
# others it's server.
161-
VARIANT_SUBDIRS := $(filter client minimal zero, $(JVM_VARIANTS)) \
162-
$(if $(filter-out client minimal zero, $(JVM_VARIANTS)), server)
163-
$(foreach v, $(VARIANT_SUBDIRS), $(eval $(call CreateSymlinks,$v)))
159+
# The subdir is the same as the variant
160+
$(foreach v, $(JVM_VARIANTS), $(eval $(call CreateSymlinks,$v)))
164161
endif
165162
############################################################################
166163

src/hotspot/cpu/zero/vm_version_zero.cpp

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,71 @@ void VM_Version::initialize() {
5050
FLAG_SET_DEFAULT(UseHeavyMonitors, true);
5151
}
5252

53+
if (UseAESIntrinsics) {
54+
warning("AES intrinsics are not available on this CPU");
55+
FLAG_SET_DEFAULT(UseAESIntrinsics, false);
56+
}
57+
58+
if (UseAES) {
59+
warning("AES instructions are not available on this CPU");
60+
FLAG_SET_DEFAULT(UseAES, false);
61+
}
62+
63+
if (UseAESCTRIntrinsics) {
64+
warning("AES/CTR intrinsics are not available on this CPU");
65+
FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false);
66+
}
67+
68+
if (UseFMA) {
69+
warning("FMA instructions are not available on this CPU");
70+
FLAG_SET_DEFAULT(UseFMA, false);
71+
}
72+
73+
if (UseMD5Intrinsics) {
74+
warning("MD5 intrinsics are not available on this CPU");
75+
FLAG_SET_DEFAULT(UseMD5Intrinsics, false);
76+
}
77+
78+
if (UseSHA) {
79+
warning("SHA instructions are not available on this CPU");
80+
FLAG_SET_DEFAULT(UseSHA, false);
81+
}
82+
83+
if (UseSHA1Intrinsics) {
84+
warning("Intrinsics for SHA-1 crypto hash functions not available on this CPU.");
85+
FLAG_SET_DEFAULT(UseSHA1Intrinsics, false);
86+
}
87+
88+
if (UseSHA256Intrinsics) {
89+
warning("Intrinsics for SHA-224 and SHA-256 crypto hash functions not available on this CPU.");
90+
FLAG_SET_DEFAULT(UseSHA256Intrinsics, false);
91+
}
92+
93+
if (UseSHA512Intrinsics) {
94+
warning("Intrinsics for SHA-384 and SHA-512 crypto hash functions not available on this CPU.");
95+
FLAG_SET_DEFAULT(UseSHA512Intrinsics, false);
96+
}
97+
98+
if (UseSHA3Intrinsics) {
99+
warning("Intrinsics for SHA3-224, SHA3-256, SHA3-384 and SHA3-512 crypto hash functions not available on this CPU.");
100+
FLAG_SET_DEFAULT(UseSHA3Intrinsics, false);
101+
}
102+
103+
if (UseCRC32Intrinsics) {
104+
warning("CRC32 intrinsics are not available on this CPU");
105+
FLAG_SET_DEFAULT(UseCRC32Intrinsics, false);
106+
}
107+
108+
if (UseAdler32Intrinsics) {
109+
warning("Adler32 intrinsics are not available on this CPU");
110+
FLAG_SET_DEFAULT(UseAdler32Intrinsics, false);
111+
}
112+
113+
if (UseVectorizedMismatchIntrinsic) {
114+
warning("vectorizedMismatch intrinsic is not available on this CPU.");
115+
FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false);
116+
}
117+
53118
// Not implemented
54119
UNSUPPORTED_OPTION(CriticalJNINatives);
55120
}

src/hotspot/os/aix/os_aix.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -267,18 +267,6 @@ julong os::physical_memory() {
267267
return Aix::physical_memory();
268268
}
269269

270-
// Return true if user is running as root.
271-
272-
bool os::have_special_privileges() {
273-
static bool init = false;
274-
static bool privileges = false;
275-
if (!init) {
276-
privileges = (getuid() != geteuid()) || (getgid() != getegid());
277-
init = true;
278-
}
279-
return privileges;
280-
}
281-
282270
// Helper function, emulates disclaim64 using multiple 32bit disclaims
283271
// because we cannot use disclaim64() on AS/400 and old AIX releases.
284272
static bool my_disclaim64(char* addr, size_t size) {

src/hotspot/os/bsd/os_bsd.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -179,20 +179,6 @@ julong os::physical_memory() {
179179
return Bsd::physical_memory();
180180
}
181181

182-
// Return true if user is running as root.
183-
184-
bool os::have_special_privileges() {
185-
static bool init = false;
186-
static bool privileges = false;
187-
if (!init) {
188-
privileges = (getuid() != geteuid()) || (getgid() != getegid());
189-
init = true;
190-
}
191-
return privileges;
192-
}
193-
194-
195-
196182
// Cpu architecture string
197183
#if defined(ZERO)
198184
static char cpu_arch[] = ZERO_LIBARCH;

src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@
5858
#ifndef MFD_HUGETLB
5959
#define MFD_HUGETLB 0x0004U
6060
#endif
61+
#ifndef MFD_HUGE_2MB
62+
#define MFD_HUGE_2MB 0x54000000U
63+
#endif
6164

6265
// open(2) flags
6366
#ifndef O_CLOEXEC
@@ -175,12 +178,6 @@ ZPhysicalMemoryBacking::ZPhysicalMemoryBacking(size_t max_capacity) :
175178
return;
176179
}
177180

178-
if (ZLargePages::is_explicit() && os::large_page_size() != ZGranuleSize) {
179-
log_error_p(gc)("Incompatible large page size configured " SIZE_FORMAT " (expected " SIZE_FORMAT ")",
180-
os::large_page_size(), ZGranuleSize);
181-
return;
182-
}
183-
184181
// Make sure the filesystem block size is compatible
185182
if (ZGranuleSize % _block_size != 0) {
186183
log_error_p(gc)("Filesystem backing the heap has incompatible block size (" SIZE_FORMAT ")",
@@ -199,17 +196,20 @@ ZPhysicalMemoryBacking::ZPhysicalMemoryBacking(size_t max_capacity) :
199196
}
200197

201198
int ZPhysicalMemoryBacking::create_mem_fd(const char* name) const {
199+
assert(ZGranuleSize == 2 * M, "Granule size must match MFD_HUGE_2MB");
200+
202201
// Create file name
203202
char filename[PATH_MAX];
204203
snprintf(filename, sizeof(filename), "%s%s", name, ZLargePages::is_explicit() ? ".hugetlb" : "");
205204

206205
// Create file
207-
const int extra_flags = ZLargePages::is_explicit() ? MFD_HUGETLB : 0;
206+
const int extra_flags = ZLargePages::is_explicit() ? (MFD_HUGETLB | MFD_HUGE_2MB) : 0;
208207
const int fd = ZSyscall::memfd_create(filename, MFD_CLOEXEC | extra_flags);
209208
if (fd == -1) {
210209
ZErrno err;
211210
log_debug_p(gc, init)("Failed to create memfd file (%s)",
212-
((ZLargePages::is_explicit() && err == EINVAL) ? "Hugepages not supported" : err.to_string()));
211+
(ZLargePages::is_explicit() && (err == EINVAL || err == ENODEV)) ?
212+
"Hugepages (2M) not available" : err.to_string());
213213
return -1;
214214
}
215215

@@ -445,7 +445,7 @@ ZErrno ZPhysicalMemoryBacking::fallocate_compat_mmap_tmpfs(size_t offset, size_t
445445
}
446446

447447
// Advise mapping to use transparent huge pages
448-
os::realign_memory((char*)addr, length, os::large_page_size());
448+
os::realign_memory((char*)addr, length, ZGranuleSize);
449449

450450
// Touch the mapping (safely) to make sure it's backed by memory
451451
const bool backed = safe_touch_mapping(addr, length, _block_size);

src/hotspot/os/linux/os_linux.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -308,19 +308,6 @@ bool os::Linux::get_tick_information(CPUPerfTicks* pticks, int which_logical_cpu
308308
return true;
309309
}
310310

311-
// Return true if user is running as root.
312-
313-
bool os::have_special_privileges() {
314-
static bool init = false;
315-
static bool privileges = false;
316-
if (!init) {
317-
privileges = (getuid() != geteuid()) || (getgid() != getegid());
318-
init = true;
319-
}
320-
return privileges;
321-
}
322-
323-
324311
#ifndef SYS_gettid
325312
// i386: 224, ia64: 1105, amd64: 186, sparc: 143
326313
#ifdef __ia64__

0 commit comments

Comments
 (0)