Bug 139124 - Issue on PPC64 on kernel 64KB pages
Summary: Issue on PPC64 on kernel 64KB pages
Status: RESOLVED DUPLICATE of bug 136300
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.2 SVN
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-22 12:08 UTC by Christophe Lamoureux
Modified: 2006-12-25 09:41 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe Lamoureux 2006-12-22 12:08:13 UTC
This bug happens on platform like cell blade that could have a kernel compiled 
with pages of 64K instead of 4K.
 
With valgrind from FC6 on a cell blade platform:  
[root@fdo-cpbw-3 valgrind_64K]# getconf PAGESIZE
65536
[root@fdo-cpbw-3 valgrind_64K]# valgrind pwd
valgrind: mmap(0x10015000, 4096) failed in UME with error 22.


For information, this quick hack, makes the svn version running on this kind of
platform ( but broke support of other platform ): 

[root@fdo-cpbw-3 valgrind_64K]# svn info
Path: .
URL: svn://svn.valgrind.org/valgrind/trunk
Repository Root: svn://svn.valgrind.org/valgrind
Repository UUID: a5019735-40e9-0310-863c-91ae7b9d1cf9
Revision: 6412
Node Kind: directory
Schedule: normal
Last Changed Author: sewardj
Last Changed Rev: 6412
Last Changed Date: 2006-12-18 18:53:13 +0100 (Mon, 18 Dec 2006)

[root@fdo-cpbw-3 valgrind_64K]# svn diff
Index: include/vki/vki-ppc32-linux.h
===================================================================
--- include/vki/vki-ppc32-linux.h       (revision 6412)
+++ include/vki/vki-ppc32-linux.h       (working copy)
@@ -62,7 +62,7 @@
 //----------------------------------------------------------------------

 /* PAGE_SHIFT determines the page size */
-#define VKI_PAGE_SHIFT 12
+#define VKI_PAGE_SHIFT 16
 #define VKI_PAGE_SIZE  (1UL << VKI_PAGE_SHIFT)

 //----------------------------------------------------------------------
Index: include/vki/vki-ppc64-linux.h
===================================================================
--- include/vki/vki-ppc64-linux.h       (revision 6412)
+++ include/vki/vki-ppc64-linux.h       (working copy)
@@ -63,7 +63,7 @@
 //----------------------------------------------------------------------

 /* PAGE_SHIFT determines the page size */
-#define VKI_PAGE_SHIFT  12
+#define VKI_PAGE_SHIFT  16
 #define VKI_PAGE_SIZE   (1UL << VKI_PAGE_SHIFT)

 //----------------------------------------------------------------------
Index: coregrind/m_aspacemgr/aspacemgr-common.c
===================================================================
--- coregrind/m_aspacemgr/aspacemgr-common.c    (revision 6412)
+++ coregrind/m_aspacemgr/aspacemgr-common.c    (working copy)
@@ -152,7 +152,7 @@
    aspacem_assert(VG_IS_PAGE_ALIGNED(offset));
 #  if defined(VGP_x86_linux) || defined(VGP_ppc32_linux)
    res = VG_(do_syscall6)(__NR_mmap2, (UWord)start, length,
-                          prot, flags, fd, offset / VKI_PAGE_SIZE);
+                          prot, flags, fd, offset >> 12 );
 #  elif defined(VGP_amd64_linux) || defined(VGP_ppc64_linux) \
         || defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
    res = VG_(do_syscall6)(__NR_mmap, (UWord)start, length,
Index: coregrind/pub_core_aspacemgr.h
===================================================================
--- coregrind/pub_core_aspacemgr.h      (revision 6412)
+++ coregrind/pub_core_aspacemgr.h      (working copy)
@@ -367,10 +367,10 @@
 // Valgrind (non-client) thread stacks.  V itself runs on such
 // stacks.  The address space manager provides and suitably
 // protects such stacks.
+#define VG_STACK_PAGESIZE (65536)
+#define VG_STACK_GUARD_SZB  2*VG_STACK_PAGESIZE   // 2 pages
+#define VG_STACK_ACTIVE_SZB 16*VG_STACK_PAGESIZE  // 16 pages

-#define VG_STACK_GUARD_SZB  8192   // 2 pages
-#define VG_STACK_ACTIVE_SZB 65536  // 16 pages
-
 typedef
    struct {
       HChar bytes[VG_STACK_GUARD_SZB
[root@fdo-cpbw-3 valgrind_64K]#
Comment 1 Julian Seward 2006-12-25 09:41:51 UTC

*** This bug has been marked as a duplicate of 136300 ***