all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Bavier <bavier@cray.com>
To: 29607@debbugs.gnu.org
Subject: [bug#29607] [PATCH] gnu: jemalloc: Fix tests for aarch64.
Date: Thu, 7 Dec 2017 21:08:06 +0000	[thread overview]
Message-ID: <CY4PR11MB17180DCEB6696D7712BBF5D4B7330@CY4PR11MB1718.namprd11.prod.outlook.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 107 bytes --]

This patch fixes the 'jemalloc' package build on aarch64.

Eric Bavier, Scientific Libraries, Cray Inc.

[-- Attachment #2: 0001-gnu-jemalloc-Fix-tests-for-aarch64.patch --]
[-- Type: application/octet-stream, Size: 4245 bytes --]

From f319e6d16624e38fa3ebf5936b3c963a7527682b Mon Sep 17 00:00:00 2001
From: Eric Bavier <bavier@cray.com>
Date: Thu, 7 Dec 2017 12:09:09 -0600
Subject: [PATCH] gnu: jemalloc: Fix tests for aarch64.

* gnu/packages/patches/jemalloc-arm-address-bits.patch: New patch.
* gnu/packages/jemalloc.scm (jemalloc)[source]: Use it.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/jemalloc.scm                          |  5 ++-
 .../patches/jemalloc-arm-address-bits.patch        | 39 ++++++++++++++++++++++
 3 files changed, 44 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/jemalloc-arm-address-bits.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 65237b3..6d03b77 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -761,6 +761,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/isl-0.11.1-aarch64-support.patch	\
   %D%/packages/patches/jacal-fix-texinfo.patch			\
   %D%/packages/patches/java-powermock-fix-java-files.patch		\
+  %D%/packages/patches/jemalloc-arm-address-bits.patch		\
   %D%/packages/patches/jbig2dec-ignore-testtest.patch		\
   %D%/packages/patches/jbig2dec-CVE-2016-9601.patch		\
   %D%/packages/patches/jbig2dec-CVE-2017-7885.patch		\
diff --git a/gnu/packages/jemalloc.scm b/gnu/packages/jemalloc.scm
index a3bd2c9..6f9a7ef 100644
--- a/gnu/packages/jemalloc.scm
+++ b/gnu/packages/jemalloc.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -23,6 +24,7 @@
   #:use-module ((guix licenses) #:select (bsd-2))
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (gnu packages)
   #:use-module (gnu packages perl)
   #:use-module (guix build-system gnu))
 
@@ -37,7 +39,8 @@
                     version "/jemalloc-" version ".tar.bz2"))
               (sha256
                (base32
-                "1sf3lzgb0y8nnyzmp4zrca3sngdxw3kfh20sna9z03jv74fph528"))))
+                "1sf3lzgb0y8nnyzmp4zrca3sngdxw3kfh20sna9z03jv74fph528"))
+	      (patches (search-patches "jemalloc-arm-address-bits.patch"))))
     (build-system gnu-build-system)
     (arguments
      `(#:phases
diff --git a/gnu/packages/patches/jemalloc-arm-address-bits.patch b/gnu/packages/patches/jemalloc-arm-address-bits.patch
new file mode 100644
index 0000000..f2ef24c
--- /dev/null
+++ b/gnu/packages/patches/jemalloc-arm-address-bits.patch
@@ -0,0 +1,39 @@
+From 8cfc9dec37b312a2686f602bbcdd102ca07cca99 Mon Sep 17 00:00:00 2001
+From: David Goldblatt <davidgoldblatt@fb.com>
+Date: Fri, 29 Sep 2017 13:54:08 -0700
+Subject: [PATCH] ARM: Don't extend bit LG_VADDR to compute high address bits.
+
+In userspace ARM on Linux, zero-ing the high bits is the correct way to do this.
+This doesn't fix the fact that we currently set LG_VADDR to 48 on ARM, when in
+fact larger virtual address sizes are coming soon.  We'll cross that bridge when
+we come to it.
+---
+ include/jemalloc/internal/rtree.h | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/include/jemalloc/internal/rtree.h b/include/jemalloc/internal/rtree.h
+index b5d4db39..4563db23 100644
+--- a/include/jemalloc/internal/rtree.h
++++ b/include/jemalloc/internal/rtree.h
+@@ -178,9 +178,21 @@ rtree_leaf_elm_bits_read(tsdn_t *tsdn, rtree_t *rtree, rtree_leaf_elm_t *elm,
+ 
+ JEMALLOC_ALWAYS_INLINE extent_t *
+ rtree_leaf_elm_bits_extent_get(uintptr_t bits) {
++#    ifdef __aarch64__
++	/*
++	 * aarch64 doesn't sign extend the highest virtual address bit to set
++	 * the higher ones.  Instead, the high bits gets zeroed.
++	 */
++	uintptr_t high_bit_mask = ((uintptr_t)1 << LG_VADDR) - 1;
++	/* Mask off the slab bit. */
++	uintptr_t low_bit_mask = ~(uintptr_t)1;
++	uintptr_t mask = high_bit_mask & low_bit_mask;
++	return (extent_t *)(bits & mask);
++#    else
+ 	/* Restore sign-extended high bits, mask slab bit. */
+ 	return (extent_t *)((uintptr_t)((intptr_t)(bits << RTREE_NHIB) >>
+ 	    RTREE_NHIB) & ~((uintptr_t)0x1));
++#    endif
+ }
+ 
+ JEMALLOC_ALWAYS_INLINE szind_t
-- 
1.8.5.6


             reply	other threads:[~2017-12-07 21:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07 21:08 Eric Bavier [this message]
2017-12-08  9:50 ` [bug#29607] [PATCH] gnu: jemalloc: Fix tests for aarch64 Ludovic Courtès
2017-12-11  3:06   ` bug#29607: " Eric Bavier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CY4PR11MB17180DCEB6696D7712BBF5D4B7330@CY4PR11MB1718.namprd11.prod.outlook.com \
    --to=bavier@cray.com \
    --cc=29607@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.