commit mozjs17 for openSUSE:Factory
Hello community, here is the log from the commit of package mozjs17 for openSUSE:Factory checked in at 2016-07-01 09:51:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mozjs17 (Old) and /work/SRC/openSUSE:Factory/.mozjs17.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "mozjs17" Changes: -------- --- /work/SRC/openSUSE:Factory/mozjs17/mozjs17.changes 2015-12-03 13:26:28.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.mozjs17.new/mozjs17.changes 2016-07-01 09:51:22.000000000 +0200 @@ -1,0 +2,12 @@ +Mon Jun 13 15:38:33 UTC 2016 - agraf@suse.com + +- Use upstream version to fix the 48 bit address space + problem (bsc#984126) + +------------------------------------------------------------------- +Fri Jun 10 13:28:12 UTC 2016 - agraf@suse.com + +- Fix 48 virtual address space systems (bsc#984126) + (mozjs-support-48bit-va.patch) + +------------------------------------------------------------------- New: ---- mozjs-support-48bit-va.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mozjs17.spec ++++++ --- /var/tmp/diff_new_pack.pquCrL/_old 2016-07-01 09:51:23.000000000 +0200 +++ /var/tmp/diff_new_pack.pquCrL/_new 2016-07-01 09:51:23.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package mozjs17 # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # 2013 Wolfgang Rosenauer # # All modifications and additions to the file contributed by third parties @@ -34,6 +34,7 @@ Patch3: mozbug746112-no-decommit-on-large-pages.patch Patch4: no_defined_array.patch Patch5: aarch64-64k-page.patch +Patch6: mozjs-support-48bit-va.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf213 BuildRequires: gcc-c++ @@ -79,6 +80,7 @@ %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 %build # no need to add build time to binaries ++++++ mozjs-support-48bit-va.patch ++++++ # HG changeset patch # User Zheng Xu <zheng.xu@linaro.org> # Date 1464657720 -7200 # Node ID dfaafbaaa2919a033c4c0abdd5830f4ea413bed6 # Parent 499f16ca85ec48d1896a1633730715f32bd62140 Bug 1143022 - Manually mmap on arm64 to ensure high 17 bits are clear. r=ehoogeveen There might be 48-bit VA on arm64 depending on kernel configuration. Manually mmap heap memory to align with the assumption made by JS engine. Index: mozjs17.0.0/js/src/gc/Memory.cpp =================================================================== --- mozjs17.0.0.orig/js/src/gc/Memory.cpp +++ mozjs17.0.0/js/src/gc/Memory.cpp @@ -309,6 +309,53 @@ InitMemorySubsystem() #endif } + +#if defined(__aarch64__) +#define USE_SAFE_MMAP +#endif + +#ifdef USE_SAFE_MMAP +static void *safe_mmap(size_t length, int prot, int flags, int fd, off_t offset) +{ + /* + * There might be similar virtual address issue on arm64 which depends on + * hardware and kernel configurations. But the work around is slightly + * different due to the different mmap behavior. + */ + const uintptr_t start = UINT64_C(0x0000070000000000); + const uintptr_t end = UINT64_C(0x0000800000000000); + const uintptr_t step = ChunkSize; + /* + * Optimization options if there are too many retries in practice: + * 1. Examine /proc/self/maps to find an available address. This file is + * not always available, however. In addition, even if we examine + * /proc/self/maps, we may still need to retry several times due to + * racing with other threads. + * 2. Use a global/static variable with lock to track the addresses we have + * allocated or tried. + */ + uintptr_t hint; + void* region = MAP_FAILED; + for (hint = start; region == MAP_FAILED && hint + length <= end; hint += step) { + region = mmap((void*)hint, length, prot, flags, fd, offset); + if (region != MAP_FAILED) { + if ((uintptr_t(region) + (length - 1)) & 0xffff800000000000) { + if (munmap(region, length)) { + MOZ_ASSERT(errno == ENOMEM); + } + region = MAP_FAILED; + } + } + } + return region == MAP_FAILED ? NULL : region; +} +#else +static void *safe_mmap(size_t length, int prot, int flags, int fd, off_t offset) +{ + return mmap(NULL, length, prot, flags, fd, offset); +} +#endif + void * MapAlignedPages(size_t size, size_t alignment) { @@ -322,12 +369,12 @@ MapAlignedPages(size_t size, size_t alig /* Special case: If we want page alignment, no further work is needed. */ if (alignment == PageSize) { - return mmap(NULL, size, prot, flags, -1, 0); + return safe_mmap(size, prot, flags, -1, 0); } /* Overallocate and unmap the region's edges. */ size_t reqSize = Min(size + 2 * alignment, 2 * size); - void *region = mmap(NULL, reqSize, prot, flags, -1, 0); + void *region = safe_mmap(reqSize, prot, flags, -1, 0); if (region == MAP_FAILED) return NULL;
participants (1)
-
root@hilbert.suse.de