Hello community,

here is the log from the commit of package libhugetlbfs for openSUSE:Factory 
checked in at 2014-04-09 18:47:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libhugetlbfs (Old)
 and      /work/SRC/openSUSE:Factory/.libhugetlbfs.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libhugetlbfs"

Changes:
--------
--- /work/SRC/openSUSE:Factory/libhugetlbfs/libhugetlbfs.changes        
2014-02-11 11:19:57.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.libhugetlbfs.new/libhugetlbfs.changes   
2014-04-09 18:47:36.000000000 +0200
@@ -1,0 +2,18 @@
+Wed Mar 26 12:37:06 UTC 2014 - dmuel...@suse.com
+
+- update to 2.17:
+ * PPC segement alignment restrictions can be disabled
+ * Added Aarch64 support
+ * Allow compiler overrides for 64 and 32 bit builds
+ * hugeadm now handles /etc/mtab being a simlink properly
+
+  * ppc64 fixes
+- remove libhugetlbfs.ia64-libdir.patch:
+  ia64 is no longer supported by openSUSE
+- add ignore-perl-modules.diff: do not install perl modules, unused
+  and are installed in the wrong place to be found anyway
+- add ARM support
+- add disable-rw-on-non-ldscripts.diff: Skip rw tests
+- Do not install tests anymore
+
+-------------------------------------------------------------------

Old:
----
  libhugetlbfs-2.16.tar.gz
  libhugetlbfs.ia64-libdir.patch

New:
----
  disable-rw-on-non-ldscripts.diff
  ignore-perl-modules.diff
  libhugetlbfs-2.17.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libhugetlbfs.spec ++++++
--- /var/tmp/diff_new_pack.ljDpYp/_old  2014-04-09 18:47:37.000000000 +0200
+++ /var/tmp/diff_new_pack.ljDpYp/_new  2014-04-09 18:47:37.000000000 +0200
@@ -16,7 +16,6 @@
 #
 
 
-
 Name:           libhugetlbfs
 
 %if 0%{?suse_version} > 1140
@@ -32,16 +31,13 @@
 Obsoletes:      libhugetlbfs-64bit
 %endif
 #
-Version:        2.16
+Version:        2.17
 Release:        0
 Url:            http://libhugetlbfs.sourceforge.net/
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 %define my_make_flags V=1 CFLAGS="$RPM_OPT_FLAGS -fPIC" BUILDTYPE=NATIVEONLY 
PREFIX=/usr LIBDIR32=%{_libdir} DESTDIR=$RPM_BUILD_ROOT
-Source0:        libhugetlbfs-%{version}.tar.gz
+Source0:        
http://downloads.sourceforge.net/project/libhugetlbfs/libhugetlbfs/%{version}/libhugetlbfs-%{version}.tar.gz
 Source1:        baselibs.conf
-# Sources have no support for arm (and they depend on the architecture)
-ExcludeArch:    %arm
-Patch1:         libhugetlbfs.ia64-libdir.patch
 Patch2:         libhugetlbfs.s390.patch
 Patch4:         libhugetlbfs.tests-malloc.patch
 Patch7:         libhugetlbfs_ia64_fix_missing_test.patch
@@ -50,6 +46,8 @@
 Patch10:        libhugetlbfs.ppc64le.step2.patch
 Patch11:        libhugetlbfs.ppc64le.step3.patch
 Patch12:        libhugetlbfs.ppc64le.step4.patch
+Patch13:        ignore-perl-modules.diff
+Patch14:        disable-rw-on-non-ldscripts.diff
 
 %description
 The libhugetlbfs package interacts with the Linux hugetlbfs to
@@ -65,7 +63,6 @@
 
 %prep
 %setup -q
-%patch1 -p1
 %patch2 -p1
 %patch4 -p1
 %patch7 -p1
@@ -74,26 +71,22 @@
 %patch10 -p1
 %patch11 -p1
 %patch12 -p1
+%patch13
+%patch14
 
 %build
 make %{my_make_flags}
 
 %install
-tests=install-tests
-make %{my_make_flags} install $tests
+make %{my_make_flags} install
 make \
 %ifarch sparc sparcv9
        CC32="gcc" CC64="" NATIVEONLY=1 \
 %endif
-       %{my_make_flags} install $tests
+       %{my_make_flags} install
 mkdir -p $RPM_BUILD_ROOT/usr/include
 cp -avL hugetlbfs.h $RPM_BUILD_ROOT/usr/include
 chmod 644 $RPM_BUILD_ROOT%{_libdir}/*.a
-for file in $RPM_BUILD_ROOT/%_libdir/libhugetlbfs/tests/*/*; do
-  strip $file || :
-done
-# Do not pack in a 268MB file..
-rm $RPM_BUILD_ROOT/%_libdir/libhugetlbfs/tests/obj32/linkhuge_rw || :
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -106,14 +99,6 @@
 %{_mandir}/man*/*.gz
 %{_libdir}/libhugetlbfs_privutils.so
 %{_libdir}/libhugetlbfs.so
-%dir %{_libdir}/libhugetlbfs
-%{_libdir}/libhugetlbfs/*
-# ToDo: What are these for...
-%dir /usr/lib/perl5/TLBC
-/usr/lib/perl5/TLBC/DataCollect.pm
-/usr/lib/perl5/TLBC/OpCollect.pm
-/usr/lib/perl5/TLBC/Report.pm
-/usr/lib/perl5/TLBC/PerfCollect.pm
 
 %files libhugetlb-devel
 %defattr(-, root, root)

++++++ disable-rw-on-non-ldscripts.diff ++++++
--- tests/Makefile
+++ tests/Makefile
@@ -46,7 +46,7 @@
 TESTS += $(LDSCRIPT_TESTS) $(HUGELINK_TESTS) $(HUGELINK_TESTS:%=xB.%) \
        $(HUGELINK_TESTS:%=xBDT.%) $(HUGELINK_RW_TESTS)
 else
-TESTS += $(LDSCRIPT_TESTS) $(HUGELINK_TESTS) $(HUGELINK_RW_TESTS)
+TESTS += $(LDSCRIPT_TESTS) $(HUGELINK_TESTS)
 endif
 
 else
@@ -55,7 +55,7 @@
 TESTS += $(LDSCRIPT_TESTS) $(HUGELINK_TESTS) $(HUGELINK_TESTS:%=xB.%) \
        $(HUGELINK_TESTS:%=xBDT.%)
 else
-TESTS += $(LDSCRIPT_TESTS) $(HUGELINK_TESTS) $(HUGELINK_RW_TESTS)
+TESTS += $(LDSCRIPT_TESTS) $(HUGELINK_TESTS)
 endif
 
 endif
++++++ ignore-perl-modules.diff ++++++
We don't need them, and they're not installed in a directory
where they can be found anyway..

--- Makefile
+++ Makefile
@@ -442,7 +442,7 @@
        for x in $(INSTALL_BIN); do \
                $(INSTALL) -m 755 $(BIN_OBJ_DIR)/$$x $(DESTDIR)$(EXEDIR); done
 
-install-stat: install-perlmod
+install-stat:
        @$(VECHO) INSTALL_SCRIPT $(DESTDIR)$(EXEDIR)
        $(INSTALL) -d $(DESTDIR)$(EXEDIR)
        for x in $(INSTALL_SCRIPT); do \
++++++ libhugetlbfs-2.16.tar.gz -> libhugetlbfs-2.17.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libhugetlbfs-2.16/Makefile 
new/libhugetlbfs-2.17/Makefile
--- old/libhugetlbfs-2.16/Makefile      2013-03-10 03:59:52.000000000 +0100
+++ new/libhugetlbfs-2.17/Makefile      2013-10-22 03:07:56.000000000 +0200
@@ -30,61 +30,68 @@
 LDFLAGS += -Wl,-z,noexecstack -ldl
 CFLAGS ?= -O2 -g
 CFLAGS += -Wall -fPIC
-CPPFLAGS += -D__LIBHUGETLBFS__
+CPPFLAGS += -D__LIBHUGETLBFS__ -DPPC_NO_SEGMENTS
 
 ARCH = $(shell uname -m | sed -e s/i.86/i386/)
+CC = gcc
 
 CUSTOM_LDSCRIPTS = yes
 
-ifeq ($(ARCH),ppc64)
-CC64 = gcc -m64
+ifeq ($(ARCH),powerpc64)
+CC64 = $(CC) -m64
 ELF64 = elf64ppc
 TMPLIB64 = lib64
 TMPLIB32 = lib
 ifneq ($(BUILDTYPE),NATIVEONLY)
-CC32 = gcc -m32
+CC32 = $(CC) -m32
 ELF32 = elf32ppclinux
 endif
 else
-ifeq ($(ARCH),ppc)
-CC32 = gcc -m32
+ifeq ($(ARCH),powerpc)
+CC32 = $(CC) -m32
 ELF32 = elf32ppclinux
 TMPLIB32 = lib
 else
 ifeq ($(ARCH),armv7l)
-CC32 = gcc
+CC32 = $(CC)
 TMPLIB32 = lib
 ELF32 += armelf_linux_eabi
 CUSTOM_LDSCRIPTS = no
 else
+ifeq ($(ARCH),aarch64)
+CC64 = gcc
+ELF64 = aarch64elf
+TMPLIB64 = lib64
+CUSTOM_LDSCRIPTS = no
+else
 ifeq ($(ARCH),i386)
-CC32 = gcc
+CC32 = $(CC)
 ELF32 = elf_i386
 TMPLIB32 = lib
 else
 ifeq ($(ARCH),x86_64)
-CC64 = gcc -m64
+CC64 = $(CC) -m64
 ELF64 = elf_x86_64
 TMPLIB64 = lib64
 TMPLIB32 = lib
 ifneq ($(BUILDTYPE),NATIVEONLY)
-CC32 = gcc -m32
+CC32 = $(CC) -m32
 ELF32 = elf_i386
 endif
 else
 ifeq ($(ARCH),ia64)
-CC64 = gcc
+CC64 = $(CC)
 TMPLIB64 = lib64
 CFLAGS += -DNO_ELFLINK
 else
 ifeq ($(ARCH),sparc64)
-CC64 = gcc -m64
+CC64 = $(CC) -m64
 TMPLIB64 = lib64
 CFLAGS += -DNO_ELFLINK
 else
 ifeq ($(ARCH),s390x)
-CC64 = gcc -m64
-CC32 = gcc -m31
+CC64 = $(CC) -m64
+CC32 = $(CC) -m31
 ELF32 = elf_s390
 ELF64 = elf64_s390
 TMPLIB64 = lib64
@@ -100,6 +107,7 @@
 endif
 endif
 endif
+endif
 
 ifdef CC32
 OBJDIRS += obj32
@@ -164,7 +172,11 @@
 BINDIR = $(PREFIX)/share/libhugetlbfs
 EXEDIR = $(PREFIX)/bin
 DOCDIR = $(PREFIX)/share/doc/libhugetlbfs
+ifdef CC32
 PMDIR = $(PREFIX)/lib/perl5/TLBC
+else
+PMDIR = $(PREFIX)/lib64/perl5/TLBC
+endif
 MANDIR1 = $(PREFIX)/share/man/man1
 MANDIR3 = $(PREFIX)/share/man/man3
 MANDIR7 = $(PREFIX)/share/man/man7
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libhugetlbfs-2.16/NEWS new/libhugetlbfs-2.17/NEWS
--- old/libhugetlbfs-2.16/NEWS  2013-03-10 03:59:52.000000000 +0100
+++ new/libhugetlbfs-2.17/NEWS  2013-10-22 03:07:56.000000000 +0200
@@ -1,3 +1,18 @@
+libhugetlbfs 2.17 "Fowl and Fetus"
+======================================================================
+New Features
+* PPC segement alignment restrictions can be disabled
+* Added Aarch64 support
+
+Bug Fixes
+* Allow compiler overrides for 64 and 32 bit builds
+* hugeadm now handles /etc/mtab being a simlink properly
+
+Test Suite
+* Add corrupt-by-cow-opt test
+* Add noresv-preserve-resv-page test
+* Add noresv-regarded-as-resv test
+
 libhugetlbfs 2.16 "Joe E. Parker"
 ======================================================================
 New Features
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libhugetlbfs-2.16/elflink.c 
new/libhugetlbfs-2.17/elflink.c
--- old/libhugetlbfs-2.16/elflink.c     2013-03-10 03:59:52.000000000 +0100
+++ new/libhugetlbfs-2.17/elflink.c     2013-10-22 03:07:56.000000000 +0200
@@ -552,7 +552,8 @@
        seg->extrasz = end_orig - start;
 }
 
-#if defined(__powerpc64__) || defined (__powerpc__)
+#if defined(__powerpc64__) || \
+       (defined(__powerpc__) && !defined(PPC_NO_SEGMENTS))
 #define SLICE_LOW_TOP          (0x100000000UL)
 #define SLICE_LOW_SIZE         (1UL << SLICE_LOW_SHIFT)
 #define SLICE_HIGH_SIZE                (1UL << SLICE_HIGH_SHIFT)
@@ -574,7 +575,7 @@
                return SLICE_LOW_TOP;
        else
                return ALIGN_DOWN(addr, SLICE_HIGH_SIZE);
-#elif defined(__powerpc__)
+#elif defined(__powerpc__) && !defined(PPC_NO_SEGMENTS)
        return ALIGN_DOWN(addr, SLICE_LOW_SIZE);
 #else
        return ALIGN_DOWN(addr, gethugepagesize());
@@ -588,7 +589,7 @@
                return ALIGN_UP(addr, SLICE_LOW_SIZE) - 1;
        else
                return ALIGN_UP(addr, SLICE_HIGH_SIZE) - 1;
-#elif defined(__powerpc__)
+#elif defined(__powerpc__) && !defined(PPC_NO_SEGMENTS)
        return ALIGN_UP(addr, SLICE_LOW_SIZE) - 1;
 #else
        return ALIGN_UP(addr, gethugepagesize()) - 1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libhugetlbfs-2.16/hugeadm.c 
new/libhugetlbfs-2.17/hugeadm.c
--- old/libhugetlbfs-2.16/hugeadm.c     2013-03-10 03:59:52.000000000 +0100
+++ new/libhugetlbfs-2.17/hugeadm.c     2013-10-22 03:07:56.000000000 +0200
@@ -516,6 +516,9 @@
        struct group *grp;
        struct mntent entry;
        FILE *mounts;
+        char dummy;
+        int useMtab;
+
        struct mount_list *list, *previous;
 
        list = collect_active_mounts(NULL);
@@ -552,6 +555,14 @@
                        return 1;
                }
 
+          /* Check if mtab is a symlink */
+          useMtab = (readlink(MOUNTED, &dummy, 1) < 0);
+          if (!useMtab) {
+           /* No need updating mtab */
+              return 0;
+           }
+
+
                mounts = setmntent(MOUNTED, "a+");
                if (mounts) {
                        entry.mnt_fsname = FS_NAME;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libhugetlbfs-2.16/ld.hugetlbfs 
new/libhugetlbfs-2.17/ld.hugetlbfs
--- old/libhugetlbfs-2.16/ld.hugetlbfs  2013-03-10 03:59:52.000000000 +0100
+++ new/libhugetlbfs-2.17/ld.hugetlbfs  2013-10-22 03:07:56.000000000 +0200
@@ -79,11 +79,6 @@
     HTLB_ALIGN="" # --hugetlbfs-link overrides --hugetlbfs-align
     LDSCRIPT="$EMU.x$HTLB_LINK"
     HTLBOPTS="-T${HUGETLB_LDSCRIPT_PATH}/${LDSCRIPT}"
-
-    if [ "$EMU" == "armelf_linux_eabi" ]; then
-        echo "Please use --hugetlbfs-align when targeting ARM."
-       exit -1
-    fi
 fi
 
 MB=$((1024*1024))
@@ -91,7 +86,7 @@
 elf32ppclinux|elf64ppc)        HPAGE_SIZE=$((16*$MB)) SLICE_SIZE=$((256*$MB)) 
;;
 elf_i386|elf_x86_64)   HPAGE_SIZE=$((4*$MB)) SLICE_SIZE=$HPAGE_SIZE ;;
 elf_s390|elf64_s390)   HPAGE_SIZE=$((1*$MB)) SLICE_SIZE=$HPAGE_SIZE ;;
-armelf_linux_eabi)     HPAGE_SIZE=$((2*$MB)) SLICE_SIZE=$HPAGE_SIZE ;;
+armelf_linux_eabi|aarch64elf)  HPAGE_SIZE=$((2*MB)) SLICE_SIZE=$HPAGE_SIZE ;;
 esac
 
 if [ "$HTLB_ALIGN" == "slice" ]; then
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libhugetlbfs-2.16/libhugetlbfs_internal.h 
new/libhugetlbfs-2.17/libhugetlbfs_internal.h
--- old/libhugetlbfs-2.16/libhugetlbfs_internal.h       2013-03-10 
03:59:52.000000000 +0100
+++ new/libhugetlbfs-2.17/libhugetlbfs_internal.h       2013-10-22 
03:07:56.000000000 +0200
@@ -49,7 +49,8 @@
 #define ALIGN_UP(x,a)  ALIGN(x,a)
 #define ALIGN_DOWN(x,a) ((x) & ~((a) - 1))
 
-#if defined(__powerpc64__) || defined (__powerpc__)
+#if defined(__powerpc64__) || \
+       (defined(__powerpc__) && !defined(PPC_NO_SEGMENTS))
 #define SLICE_LOW_SHIFT                28
 #define SLICE_HIGH_SHIFT       40
 #elif defined(__ia64__)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libhugetlbfs-2.16/morecore.c 
new/libhugetlbfs-2.17/morecore.c
--- old/libhugetlbfs-2.16/morecore.c    2013-03-10 03:59:52.000000000 +0100
+++ new/libhugetlbfs-2.17/morecore.c    2013-10-22 03:07:56.000000000 +0200
@@ -44,7 +44,7 @@
 {
 #if defined(__powerpc64__)
        return ALIGN(addr, 1L << SLICE_HIGH_SHIFT);
-#elif defined(__powerpc__)
+#elif defined(__powerpc__) && !defined(PPC_NO_SEGMENTS)
        return ALIGN(addr, 1L << SLICE_LOW_SHIFT);
 #elif defined(__ia64__)
        if (addr < (1UL << SLICE_HIGH_SHIFT))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libhugetlbfs-2.16/sys-aarch64elf.S 
new/libhugetlbfs-2.17/sys-aarch64elf.S
--- old/libhugetlbfs-2.16/sys-aarch64elf.S      1970-01-01 01:00:00.000000000 
+0100
+++ new/libhugetlbfs-2.17/sys-aarch64elf.S      2013-10-22 03:07:56.000000000 
+0200
@@ -0,0 +1,34 @@
+/*
+ * libhugetlbfs - Easy use of Linux hugepages
+ * Copyright (C) 2013 Linaro Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+        .text
+
+        .globl  direct_syscall
+
+
+direct_syscall:
+       uxtw    x8, w0
+       mov     x0, x1
+       mov     x1, x2
+       mov     x2, x3
+       mov     x3, x4
+       mov     x4, x5
+       mov     x5, x6
+       mov     x6, x7
+       svc     0x0
+       ret
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libhugetlbfs-2.16/tests/Makefile 
new/libhugetlbfs-2.17/tests/Makefile
--- old/libhugetlbfs-2.16/tests/Makefile        2013-03-10 03:59:52.000000000 
+0100
+++ new/libhugetlbfs-2.17/tests/Makefile        2013-10-22 03:07:56.000000000 
+0200
@@ -12,7 +12,8 @@
        madvise_reserve fadvise_reserve readahead_reserve \
        shm-perms \
        mremap-expand-slice-collision \
-       mremap-fixed-normal-near-huge mremap-fixed-huge-near-normal
+       mremap-fixed-normal-near-huge mremap-fixed-huge-near-normal \
+       corrupt-by-cow-opt noresv-preserve-resv-page noresv-regarded-as-resv
 LIB_TESTS_64 =
 LIB_TESTS_64_STATIC = straddle_4GB huge_at_4GB_normal_below \
        huge_below_4GB_normal_above
@@ -54,7 +55,7 @@
 TESTS += $(LDSCRIPT_TESTS) $(HUGELINK_TESTS) $(HUGELINK_TESTS:%=xB.%) \
        $(HUGELINK_TESTS:%=xBDT.%)
 else
-TESTS += $(LDSCRIPT_TESTS) $(HUGELINK_TESTS)
+TESTS += $(LDSCRIPT_TESTS) $(HUGELINK_TESTS) $(HUGELINK_RW_TESTS)
 endif
 
 endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libhugetlbfs-2.16/tests/brk_near_huge.c 
new/libhugetlbfs-2.17/tests/brk_near_huge.c
--- old/libhugetlbfs-2.16/tests/brk_near_huge.c 2013-03-10 03:59:52.000000000 
+0100
+++ new/libhugetlbfs-2.17/tests/brk_near_huge.c 2013-10-22 03:07:56.000000000 
+0200
@@ -47,7 +47,7 @@
                /* 1TB segments above */
                return PALIGN(addr, 0x10000000000UL);
 }
-#elif defined(__powerpc__)
+#elif defined(__powerpc__) && !defined(PPC_NO_SEGMENTS)
 void *next_chunk(void *addr)
 {
        return PALIGN(addr, 0x10000000UL);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libhugetlbfs-2.16/tests/corrupt-by-cow-opt.c 
new/libhugetlbfs-2.17/tests/corrupt-by-cow-opt.c
--- old/libhugetlbfs-2.16/tests/corrupt-by-cow-opt.c    1970-01-01 
01:00:00.000000000 +0100
+++ new/libhugetlbfs-2.17/tests/corrupt-by-cow-opt.c    2013-10-22 
03:07:56.000000000 +0200
@@ -0,0 +1,78 @@
+/*
+ * libhugetlbfs - Easy use of Linux hugepages
+ * Copyright (C) 2013 Joonsoo Kim, LG Electronics.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <hugetlbfs.h>
+#include "hugetests.h"
+
+#define P "corrupt-by-cow-opt"
+#define DESC \
+       "* Test sanity of cow optimization on page cache. If a page        *\n"\
+       "* in page cache has only 1 ref count, it is mapped for a private  *\n"\
+       "* mapping directly and is overwritten freely, so next time we     *\n"\
+       "* access the page, we can see corrupt data.                       *\n"\
+
+int main(int argc, char *argv[])
+{
+       long hpage_size;
+       int fd;
+       char *p;
+       char c;
+
+       test_init(argc, argv);
+
+       hpage_size = check_hugepagesize();
+
+       check_free_huge_pages(2);
+
+       fd = hugetlbfs_unlinked_fd();
+       if (fd < 0)
+               FAIL("hugetlbfs_unlinked_fd()");
+
+       p = mmap(NULL, hpage_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+       if (p == MAP_FAILED)
+               FAIL("mmap() 1: %s", strerror(errno));
+
+       *p = 's';
+       verbose_printf("Write %c to %p via shared mapping\n", *p, p);
+       munmap(p, hpage_size);
+
+       p = mmap(NULL, hpage_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
+       if (p == MAP_FAILED)
+               FAIL("mmap() 2: %s", strerror(errno));
+
+       *p = 'p';
+       verbose_printf("Write %c to %p via private mapping\n", *p, p);
+       munmap(p, hpage_size);
+
+       p = mmap(NULL, hpage_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+       if (p == MAP_FAILED)
+               FAIL("mmap() 3: %s", strerror(errno));
+
+       c = *p;
+       verbose_printf("Read %c from %p via shared mapping\n", *p, p);
+       munmap(p, hpage_size);
+
+       if (c != 's')
+               FAIL("data corrupt");
+
+       PASS();
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libhugetlbfs-2.16/tests/icache-hygiene.c 
new/libhugetlbfs-2.17/tests/icache-hygiene.c
--- old/libhugetlbfs-2.16/tests/icache-hygiene.c        2013-03-10 
03:59:52.000000000 +0100
+++ new/libhugetlbfs-2.17/tests/icache-hygiene.c        2013-10-22 
03:07:56.000000000 +0200
@@ -54,7 +54,7 @@
 {
 #if defined(__powerpc__)
        asm volatile("dcbst 0,%0; sync; icbi 0,%0; isync" : : "r"(p));
-#elif defined(__arm__)
+#elif defined(__arm__) || defined(__aarch64__)
        __clear_cache(p, p + COPY_SIZE);
 #endif
 }
@@ -87,8 +87,9 @@
 static void sig_handler(int signum, siginfo_t *si, void *uc)
 {
 #if defined(__powerpc__) || defined(__powerpc64__) || defined(__ia64__) || \
-    defined(__s390__) || defined(__s390x__) || defined(__sparc__)
-       /* On powerpc and ia64 and s390, 0 bytes are an illegal
+    defined(__s390__) || defined(__s390x__) || defined(__sparc__) || \
+    defined(__aarch64__)
+       /* On powerpc, ia64, s390 and Aarch64, 0 bytes are an illegal
         * instruction, so, if the icache is cleared properly, we SIGILL
         * as soon as we jump into the cleared page */
        if (signum == SIGILL) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libhugetlbfs-2.16/tests/mprotect.c 
new/libhugetlbfs-2.17/tests/mprotect.c
--- old/libhugetlbfs-2.16/tests/mprotect.c      2013-03-10 03:59:52.000000000 
+0100
+++ new/libhugetlbfs-2.17/tests/mprotect.c      2013-10-22 03:07:56.000000000 
+0200
@@ -213,5 +213,11 @@
        test_mprotect(fd, "RW->R 1/2", 2*hpage_size, PROT_READ|PROT_WRITE,
                      hpage_size, PROT_READ);
 
+       /* PROT_NONE tests */
+       test_mprotect(fd, "NONE->R", hpage_size, PROT_NONE,
+                     hpage_size, PROT_READ);
+       test_mprotect(fd, "NONE->RW", hpage_size, PROT_NONE,
+                     hpage_size, PROT_READ|PROT_WRITE);
+
        PASS();
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libhugetlbfs-2.16/tests/mremap-expand-slice-collision.c 
new/libhugetlbfs-2.17/tests/mremap-expand-slice-collision.c
--- old/libhugetlbfs-2.16/tests/mremap-expand-slice-collision.c 2013-03-10 
03:59:52.000000000 +0100
+++ new/libhugetlbfs-2.17/tests/mremap-expand-slice-collision.c 2013-10-22 
03:07:56.000000000 +0200
@@ -38,7 +38,7 @@
        unsigned long slice_size;
        void *p1, *p2, *heap;
        int slices_ok, i, rc;
-#ifdef __LP64__
+#if defined(__LP64__) && !defined(__aarch64__)
        /* powerpc: 1TB slices starting at 1 TB */
        slice_boundary = 0x10000000000;
        slice_size = 0x10000000000;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libhugetlbfs-2.16/tests/noresv-preserve-resv-page.c 
new/libhugetlbfs-2.17/tests/noresv-preserve-resv-page.c
--- old/libhugetlbfs-2.16/tests/noresv-preserve-resv-page.c     1970-01-01 
01:00:00.000000000 +0100
+++ new/libhugetlbfs-2.17/tests/noresv-preserve-resv-page.c     2013-10-22 
03:07:56.000000000 +0200
@@ -0,0 +1,109 @@
+/*
+ * libhugetlbfs - Easy use of Linux hugepages
+ * Copyright (C) 2013 Joonsoo Kim, LG Electronics.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+#include <setjmp.h>
+#include <sys/mman.h>
+#include <hugetlbfs.h>
+#include "hugetests.h"
+
+#define P "noresv-preserve-resv-page"
+#define DESC \
+       "* Test to preserve a reserved page against no-reserved maping.    *\n"\
+       "* If all hugepages are reserved, access to no-reserved shared     *\n"\
+       "* mapping cause a process die, instead of stealing a hugepage     *\n"\
+       "* which is reserved for other process                             *\n"
+
+static sigjmp_buf sig_escape;
+static void *sig_expected = MAP_FAILED;
+
+static void sig_handler(int signum, siginfo_t *si, void *uc)
+{
+       if (signum == SIGBUS) {
+               verbose_printf("SIGBUS at %p (sig_expected=%p)\n", si->si_addr,
+                              sig_expected);
+               if (si->si_addr == sig_expected) {
+                       siglongjmp(sig_escape, 1);
+               }
+               FAIL("SIGBUS somewhere unexpected");
+       }
+       FAIL("Unexpected signal %s", strsignal(signum));
+}
+
+static void test_write(void *p)
+{
+       volatile char *pl = p;
+
+       if (sigsetjmp(sig_escape, 1)) {
+               /* We got a SIGBUS */
+               PASS();
+       }
+
+       sig_expected = p;
+       barrier();
+       *pl = 's';
+}
+
+int main(int argc, char *argv[])
+{
+       long hpage_size;
+       int nr_hugepages;
+       int fd1, fd2, err;
+       char *p, *q;
+       struct sigaction sa = {
+               .sa_sigaction = sig_handler,
+               .sa_flags = SA_SIGINFO,
+       };
+
+       test_init(argc, argv);
+
+       hpage_size = check_hugepagesize();
+       nr_hugepages = get_huge_page_counter(hpage_size, HUGEPAGES_FREE);
+
+       fd1 = hugetlbfs_unlinked_fd();
+       if (fd1 < 0)
+               FAIL("hugetlbfs_unlinked_fd()");
+
+       fd2 = hugetlbfs_unlinked_fd();
+       if (fd2 < 0)
+               FAIL("hugetlbfs_unlinked_fd()");
+
+       err = sigaction(SIGBUS, &sa, NULL);
+       if (err)
+               FAIL("Can't install SIGBUS handler: %s", strerror(errno));
+
+       p = mmap(NULL, hpage_size * nr_hugepages,
+               PROT_READ | PROT_WRITE, MAP_SHARED, fd1, 0);
+       if (p == MAP_FAILED)
+               FAIL("mmap() 1: %s", strerror(errno));
+
+       verbose_printf("Reserve all hugepages %d\n", nr_hugepages);
+
+       q = mmap(NULL, hpage_size,
+               PROT_READ | PROT_WRITE, MAP_SHARED | MAP_NORESERVE, fd2, 0);
+       if (q == MAP_FAILED)
+               FAIL("mmap() 2: %s", strerror(errno));
+
+       verbose_printf("Write %c to %p to steal reserved page\n", *q, q);
+
+       test_write(q);
+       FAIL("Steal reserved page");
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libhugetlbfs-2.16/tests/noresv-regarded-as-resv.c 
new/libhugetlbfs-2.17/tests/noresv-regarded-as-resv.c
--- old/libhugetlbfs-2.16/tests/noresv-regarded-as-resv.c       1970-01-01 
01:00:00.000000000 +0100
+++ new/libhugetlbfs-2.17/tests/noresv-regarded-as-resv.c       2013-10-22 
03:07:56.000000000 +0200
@@ -0,0 +1,77 @@
+/*
+ * libhugetlbfs - Easy use of Linux hugepages
+ * Copyright (C) 2013 Joonsoo Kim, LG Electronics.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+#include <sys/mman.h>
+#include <hugetlbfs.h>
+#include "hugetests.h"
+
+#define P "noresv-regarded-as-resv"
+#define DESC \
+       "* Test to correct handling for reserve count. If no reserved      *\n"\
+       "* mapping is created to reserved file region, it should be        *\n"\
+       "* considered as reserve mapping. Otherwise, reserve count will be *\n"\
+       "* overflowed.                                                     *\n"
+
+int main(int argc, char *argv[])
+{
+       long hpage_size;
+       int nr_resvpages1, nr_resvpages2;
+       int fd;
+       char *p, *q;
+
+       test_init(argc, argv);
+
+       hpage_size = check_hugepagesize();
+       nr_resvpages1 = get_huge_page_counter(hpage_size, HUGEPAGES_RSVD);
+       verbose_printf("Number of reserve page is %d\n", nr_resvpages1);
+
+       fd = hugetlbfs_unlinked_fd();
+       if (fd < 0)
+               FAIL("hugetlbfs_unlinked_fd()");
+
+       p = mmap(NULL, hpage_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+       if (p == MAP_FAILED)
+               FAIL("mmap() 1: %s", strerror(errno));
+
+       verbose_printf("Reserve a page to file offset 0\n");
+
+       q = mmap(NULL, hpage_size,
+               PROT_READ | PROT_WRITE, MAP_SHARED | MAP_NORESERVE, fd, 0);
+       if (q == MAP_FAILED)
+               FAIL("mmap() 2: %s", strerror(errno));
+
+       verbose_printf("Map a page of file offset 0 with no resv mapping\n");
+       *q = 's';
+
+       munmap(p, hpage_size);
+       munmap(q, hpage_size);
+       close(fd);
+       verbose_printf("Unmap all mappings and close file\n");
+
+       nr_resvpages2 = get_huge_page_counter(hpage_size, HUGEPAGES_RSVD);
+       verbose_printf("Number of reserve page is now %d\n", nr_resvpages2);
+
+       if (nr_resvpages1 != nr_resvpages2)
+               FAIL("Reserve count overflowed");
+
+       PASS();
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libhugetlbfs-2.16/tests/run_tests.py 
new/libhugetlbfs-2.17/tests/run_tests.py
--- old/libhugetlbfs-2.16/tests/run_tests.py    2013-03-10 03:59:52.000000000 
+0100
+++ new/libhugetlbfs-2.17/tests/run_tests.py    2013-10-22 03:07:56.000000000 
+0200
@@ -536,6 +536,9 @@
     do_test("brk_near_huge")
     do_test("task-size-overrun")
     do_test_with_rlimit(resource.RLIMIT_STACK, -1, "stack_grow_into_huge")
+    do_test("corrupt-by-cow-opt")
+    do_test("noresv-preserve-resv-page")
+    do_test("noresv-regarded-as-resv")
 
     if dangerous == 1:
         do_test("readahead_reserve")
@@ -572,7 +575,7 @@
     do_test("heapshrink", LD_PRELOAD="libhugetlbfs.so libheapshrink.so",
             HUGETLB_MORECORE="yes")
     do_test("heapshrink", LD_PRELOAD="libheapshrink.so", 
HUGETLB_MORECORE="yes",
-            HUGETLB_MORECORE_SHRINK="es")
+            HUGETLB_MORECORE_SHRINK="yes")
     do_test("heapshrink", LD_PRELOAD="libhugetlbfs.so libheapshrink.so",
             HUGETLB_MORECORE="yes", HUGETLB_MORECORE_SHRINK="yes")
     do_test("heap-overflow", HUGETLB_VERBOSE="1", HUGETLB_MORECORE="yes")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libhugetlbfs-2.16/tests/truncate_above_4GB.c 
new/libhugetlbfs-2.17/tests/truncate_above_4GB.c
--- old/libhugetlbfs-2.16/tests/truncate_above_4GB.c    2013-03-10 
03:59:52.000000000 +0100
+++ new/libhugetlbfs-2.17/tests/truncate_above_4GB.c    2013-10-22 
03:07:56.000000000 +0200
@@ -102,11 +102,13 @@
        *qi = 0;
 
        /* This part of the test makes the problem more obvious, but
-        * is not essential.  It can't be done on powerpc, where
+        * is not essential.  It can't be done on segmented powerpc, where
         * segment restrictions prohibit us from performing such a
         * mapping, so skip it there. Similarly, ia64's address space
         * restrictions prevent this. */
-#if !defined(__powerpc__) && !defined(__powerpc64__) && !defined(__ia64__)
+#if (defined(__powerpc__) && defined(PPC_NO_SEGMENTS)) \
+       || !defined(__powerpc__) && !defined(__powerpc64__) \
+       && !defined(__ia64__)
        /* Replace middle hpage by tinypage mapping to trigger
         * nr_ptes BUG */
        verbose_printf("Replacing map at %p-%p...", q + hpage_size,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libhugetlbfs-2.16/version 
new/libhugetlbfs-2.17/version
--- old/libhugetlbfs-2.16/version       2013-03-10 04:02:17.000000000 +0100
+++ new/libhugetlbfs-2.17/version       2013-10-22 03:08:56.000000000 +0200
@@ -1 +1 @@
-2.16
+2.17

++++++ libhugetlbfs-ppc64le.patch ++++++
--- /var/tmp/diff_new_pack.ljDpYp/_old  2014-04-09 18:47:37.000000000 +0200
+++ /var/tmp/diff_new_pack.ljDpYp/_new  2014-04-09 18:47:37.000000000 +0200
@@ -3,34 +3,32 @@
 Signed-off-by: Anton Blanchard <an...@samba.org>
 ---
 
-diff --git a/Makefile b/Makefile
-index 48205af..7919c3b 100644
---- a/Makefile
-+++ b/Makefile
-@@ -46,6 +46,11 @@ CC32 = gcc -m32
+Index: libhugetlbfs-2.17/Makefile
+===================================================================
+--- libhugetlbfs-2.17.orig/Makefile
++++ libhugetlbfs-2.17/Makefile
+@@ -46,6 +46,11 @@ ifneq ($(BUILDTYPE),NATIVEONLY)
+ CC32 = $(CC) -m32
  ELF32 = elf32ppclinux
  endif
- else
++else
 +ifeq ($(ARCH),ppc64le)
-+CC64 = gcc -m64
++CC64 = $(CC) -m64
 +ELF64 = elf64lppc
 +TMPLIB64 = lib64
-+else
- ifeq ($(ARCH),ppc)
- CC32 = gcc -m32
- ELF32 = elf32ppclinux
-@@ -100,6 +105,7 @@ endif
+ else
+ ifeq ($(ARCH),powerpc)
+ CC32 = $(CC) -m32
+@@ -106,6 +110,7 @@ $(error "Unrecognized architecture ($(AR
  endif
  endif
  endif
 +endif
- 
- ifdef CC32
- OBJDIRS += obj32
-diff --git a/contrib/tlbmiss_cost.sh b/contrib/tlbmiss_cost.sh
-index 1f1e234..8fbf798 100755
---- a/contrib/tlbmiss_cost.sh
-+++ b/contrib/tlbmiss_cost.sh
+ endif
+ endif
+ endif
+--- libhugetlbfs-2.17.orig/contrib/tlbmiss_cost.sh
++++ libhugetlbfs-2.17/contrib/tlbmiss_cost.sh
 @@ -44,7 +44,7 @@ cpumhz() {
        FNAME="cpu MHz"
        FINDEX=4

++++++ libhugetlbfs.s390.patch ++++++
--- /var/tmp/diff_new_pack.ljDpYp/_old  2014-04-09 18:47:37.000000000 +0200
+++ /var/tmp/diff_new_pack.ljDpYp/_new  2014-04-09 18:47:37.000000000 +0200
@@ -2,38 +2,34 @@
  Makefile |   12 ++++++++----
  1 file changed, 8 insertions(+), 4 deletions(-)
 
-Index: libhugetlbfs-2.15/Makefile
+Index: libhugetlbfs-2.17/Makefile
 ===================================================================
---- libhugetlbfs-2.15.orig/Makefile
-+++ libhugetlbfs-2.15/Makefile
-@@ -69,19 +69,22 @@ else
+--- libhugetlbfs-2.17.orig/Makefile
++++ libhugetlbfs-2.17/Makefile
+@@ -82,12 +82,12 @@ else
  ifeq ($(ARCH),ia64)
- CC64 = gcc
- TMPLIB64 = lib
+ CC64 = $(CC)
+ TMPLIB64 = lib64
 -CFLAGS += -DNO_ELFLINK
 +CPPFLAGS += -DNO_ELFLINK
  else
  ifeq ($(ARCH),sparc64)
- CC64 = gcc -m64
+ CC64 = $(CC) -m64
  TMPLIB64 = lib64
 -CFLAGS += -DNO_ELFLINK
 +CPPFLAGS += -DNO_ELFLINK
  else
  ifeq ($(ARCH),s390x)
- CC64 = gcc -m64
--CC32 = gcc -m31
--ELF32 = elf_s390
- ELF64 = elf64_s390
- TMPLIB64 = lib64
-+CUSTOM_LDSCRIPTS = no
-+else
-+ifeq ($(ARCH),s390)
-+CC32 = gcc -m31
-+ELF32 = elf_s390
+ CC64 = $(CC) -m64
+@@ -98,10 +98,15 @@ TMPLIB64 = lib64
  TMPLIB32 = lib
  CUSTOM_LDSCRIPTS = no
  else
-@@ -89,6 +92,7 @@ $(error "Unrecognized architecture ($(AR
++ifeq ($(ARCH),s390)
++CC32 = gcc -m31
++ELF32 = elf_s390
++else
+ $(error "Unrecognized architecture ($(ARCH))")
  endif
  endif
  endif

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to