Patchwork qemu-arm fails on test-mmap - take #2

login
register
mail settings
Submitter Jan-Simon Möller
Date Aug. 10, 2009, 2:09 a.m.
Message ID <200908100409.04926.dl9pf@gmx.de>
Download mbox | patch
Permalink /patch/31046/
State Superseded
Headers show

Comments

Jan-Simon Möller - Aug. 10, 2009, 2:09 a.m.
A quick hack around is this:


But this is for sure not the real solution.

Best,
Jan-Simon
Martin Mohring - Aug. 10, 2009, 8:33 a.m.
Hi,

yesterday, we tracked down the problem to a kernel bug in this area:
http://bugzilla.kernel.org/attachment.cgi?id=17219 What do I want to say
with this: the user mode memory allocator does not work because it runs
into a kernel bug.

Kudos to Jan-Simon. Has anyone an idea how to handle such a case....
Patching the kernel is not the best idea. We will check which kernels
are affected.

Cheers, Martin

Jan-Simon Möller wrote:
> A quick hack around is this:
>
> diff --git a/linux-user/mmap.c b/linux-user/mmap.c
> index e05caa0..a04d6b1 100644
> --- a/linux-user/mmap.c
> +++ b/linux-user/mmap.c
> @@ -316,8 +316,14 @@ abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size)
>          if (addr == addr_start)
>              return (abi_ulong)-1;
>      }
> -    if (start == 0)
> -        mmap_next_start = addr + size;
> +    if (start == 0) {
> +        abi_ulong mynext = addr + size ;
> +        if ( (mynext > 0x5f000000) && (mynext < 0x65000000) ) {
> +          mmap_next_start = 0x65000000 ;
> +        } else {
> +          mmap_next_start = addr + size;
> +        }
> +    }
>      return addr;
>  }
>
>
> But this is for sure not the real solution.
>
> Best,
> Jan-Simon
>
>
>

Patch

diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index e05caa0..a04d6b1 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -316,8 +316,14 @@  abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size)
         if (addr == addr_start)
             return (abi_ulong)-1;
     }
-    if (start == 0)
-        mmap_next_start = addr + size;
+    if (start == 0) {
+        abi_ulong mynext = addr + size ;
+        if ( (mynext > 0x5f000000) && (mynext < 0x65000000) ) {
+          mmap_next_start = 0x65000000 ;
+        } else {
+          mmap_next_start = addr + size;
+        }
+    }
     return addr;
 }