1. 12 10月, 2012 1 次提交
  2. 22 9月, 2012 1 次提交
  3. 15 8月, 2012 2 次提交
  4. 07 4月, 2012 1 次提交
    • P
      Userspace ARM BE8 support · d8fd2954
      Paul Brook 提交于
      Add support for ARM BE8 userspace binaries.
      i.e. big-endian data and little-endian code.
      In principle LE8 mode is also possible, but AFAIK has never actually
      been implemented/used.
      
      System emulation doesn't have any useable big-endian board models,
      but should in principle work once you fix that.
      Dynamic endianness switching requires messing with data accesses,
      preferably with TCG cooperation, and is orthogonal to BE8 support.
      Signed-off-by: NPaul Brook <paul@codesourcery.com>
      [PMM: various changes, mostly as per my suggestions in code review:
       * rebase
       * use EF_ defines rather than hardcoded constants
       * make bswap_code a bool for future VMSTATE macro compatibility
       * update comment in cpu.h about TB flags bit field usage
       * factor out load-code-and-swap into arm_ld*_code functions and
         get_user_code* macros
       * fix stray trailing space at end of line
       * added braces in disas.c to satisfy checkpatch
      ]
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
      d8fd2954
  5. 06 4月, 2012 1 次提交
  6. 15 3月, 2012 1 次提交
  7. 02 2月, 2012 2 次提交
  8. 09 9月, 2011 1 次提交
  9. 22 6月, 2011 1 次提交
  10. 08 5月, 2011 1 次提交
  11. 13 4月, 2011 1 次提交
  12. 09 2月, 2011 1 次提交
  13. 08 1月, 2011 1 次提交
  14. 03 12月, 2010 2 次提交
    • P
      linux-user: remove unnecessary local from __get_user(), __put_user() · bee70008
      Peter Maydell 提交于
      Remove an unnecessary local variable from the __get_user() and
      __put_user() macros. This avoids confusing compilation failures
      if the name of the local variable ('size') happens to be the
      same as the variable the macro user is trying to read/write.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NRiku Voipio <riku.voipio@nokia.com>
      bee70008
    • N
      linux-user: fix memory leaks with NPTL emulation · 48e15fc2
      Nathan Froyd 提交于
      Running programs that create large numbers of threads, such as this
      snippet from libstdc++'s pthread7-rope.cc:
      
        const int max_thread_count = 4;
        const int max_loop_count = 10000;
        ...
        for (int j = 0; j < max_loop_count; j++)
          {
            ...
            for (int i = 0; i < max_thread_count; i++)
      	pthread_create (&tid[i], NULL, thread_main, 0);
      
            for (int i = 0; i < max_thread_count; i++)
      	pthread_join (tid[i], NULL);
          }
      
      in user-mode emulation will quickly run out of memory.  This is caused
      by a failure to free memory in do_syscall prior to thread exit:
      
                /* TODO: Free CPU state.  */
                pthread_exit(NULL);
      
      The first step in fixing this is to make all TaskStates used by QEMU
      dynamically allocated.  The TaskState used by the initial thread was
      not, as it was allocated on main's stack.  So fix that, free the
      cpu_env, free the TaskState, and we're home free, right?
      
      Not exactly.  When we create a thread, we do:
      
              ts = qemu_mallocz(sizeof(TaskState) + NEW_STACK_SIZE);
              ...
              new_stack = ts->stack;
              ...
              ret = pthread_attr_setstack(&attr, new_stack, NEW_STACK_SIZE);
      
      If we blindly free the TaskState, then, we yank the current (host)
      thread's stack out from underneath it while it still has things to do,
      like calling pthread_exit.  That causes problems, as you might expect.
      
      The solution adopted here is to let the C library allocate the thread's
      stack (so the C library can properly clean it up at pthread_exit) and
      provide a hint that we want NEW_STACK_SIZE bytes of stack.
      
      With those two changes, we're done, right?  Well, almost.  You see,
      we're creating all these host threads and their parent threads never
      bother to check that their children are finished.  There's no good place
      for the parent threads to do so.  Therefore, we need to create the
      threads in a detached state so the parent thread doesn't have to call
      pthread_join on the child to release the child's resources; the child
      does so automatically.
      
      With those three major changes, we can comfortably run programs like the
      above without exhausting memory.  We do need to delete 'stack' from the
      TaskState structure.
      Signed-off-by: NNathan Froyd <froydnj@codesourcery.com>
      Signed-off-by: NRiku Voipio <riku.voipio@nokia.com>
      48e15fc2
  15. 03 10月, 2010 1 次提交
  16. 29 7月, 2010 1 次提交
  17. 16 6月, 2010 1 次提交
    • P
      Usermode exec-stack fix · 97374d38
      Paul Brook 提交于
      When loading a shared library that requires an executable stack,
      glibc uses the mprotext PROT_GROWSDOWN flag to achieve this.
      We don't support PROT_GROWSDOWN.
      Add a special case to handle changing the stack permissions in this way.
      Signed-off-by: NPaul Brook <paul@codesourcery.com>
      97374d38
  18. 25 4月, 2010 1 次提交
  19. 27 3月, 2010 1 次提交
    • R
      linux-user: Use RLIMIT_STACK for default stack size. · 703e0e89
      Richard Henderson 提交于
      The current default stack limit of 512kB is far too small; a fair
      number of gcc testsuite failures (for all guests) are directly
      attributable to this.  Using the -s option in every invocation of
      the emulator is annoying to say the least.
      
      A reasonable compromise seems to be to honor the system rlimit.
      At least on two Linux distributions, this is set to 8MB and 10MB
      respectively.  If the system does not limit the stack, then we're
      no worse off than before.
      
      At the same time, rename the variable from x86_stack_size and
      change the ultimate fallback size from 512kB to 8MB.
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
      703e0e89
  20. 13 3月, 2010 1 次提交
    • R
      linux-user: Fix mmap_find_vma returning invalid addresses. · 14f24e14
      Richard Henderson 提交于
      Don't return addresses that aren't properly aligned for the guest,
      e.g. when the guest has a larger page size than the host.  Don't
      return addresses that are outside the virtual address space for the
      target, by paying proper attention to the h2g/g2h macros.
      
      At the same time, place the default mapping base for 64-bit guests
      (on 64-bit hosts) outside the low 4G.  Consistently interpret
      mmap_next_start in the guest address space.
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      14f24e14
  21. 02 10月, 2009 2 次提交
  22. 12 9月, 2009 1 次提交
    • B
      Fix sys-queue.h conflict for good · 72cf2d4f
      Blue Swirl 提交于
      Problem: Our file sys-queue.h is a copy of the BSD file, but there are
      some additions and it's not entirely compatible. Because of that, there have
      been conflicts with system headers on BSD systems. Some hacks have been
      introduced in the commits 15cc9235,
      f40d7537,
      96555a96 and
      3990d09a but the fixes were fragile.
      
      Solution: Avoid the conflict entirely by renaming the functions and the
      file. Revert the previous hacks.
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      72cf2d4f
  23. 15 8月, 2009 1 次提交
  24. 28 7月, 2009 1 次提交
  25. 17 7月, 2009 1 次提交
  26. 08 7月, 2009 1 次提交
    • A
      linux-user: increment MAX_ARG_PAGES · fd4d81dd
      Arnaud Patard 提交于
      There's a error When doing something like that :
      find / -type f -print0 | xargs -0 echo
      
      [ done in a arm chroot with qemu-arm and linux binfmt stuff or with
      find / -type f -print0 | qemu-arm -L <path> <path>/usr/bin/xargs -0
      echo ]
      
      Doing this outsite qemu is fine. The problem was the huge number of
      parameters. Increasing MAX_ARG_PAGES is fixing that.
      
      While I was at it, I've modified linux-user/main.c to report error code
      of loader_exec. It helps to debug/know what's wrong.
      Signed-off-by: NArnaud Patard <arnaud.patard@rtp-net.org>
      Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
      fd4d81dd
  27. 16 6月, 2009 2 次提交
  28. 19 5月, 2009 1 次提交
  29. 16 4月, 2009 1 次提交
  30. 07 3月, 2009 1 次提交
  31. 31 1月, 2009 1 次提交
  32. 09 12月, 2008 1 次提交
  33. 05 10月, 2008 1 次提交
  34. 30 8月, 2008 1 次提交
  35. 08 6月, 2008 1 次提交