1. 27 6月, 2011 1 次提交
  2. 22 6月, 2011 1 次提交
  3. 16 6月, 2011 1 次提交
  4. 01 6月, 2011 2 次提交
    • R
      target-alpha: Tidy exception constants. · 07b6c13b
      Richard Henderson 提交于
      There's no need to attempt to match EXCP_* values with PALcode entry
      point offsets.  Instead, compress all the values to make for more
      efficient switch statements within QEMU.
      
      We will be doing TLB fill within QEMU proper, not within the PALcode,
      so all of the ITB/DTB miss, double fault, and access exceptions can
      be compressed to EXCP_MMFAULT.
      
      Compress all of the EXCP_CALL_PAL exceptions into one.
      Use env->error_code to store the specific entry point.
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      07b6c13b
    • R
      target-alpha: Rationalize internal processor registers. · 129d8aa5
      Richard Henderson 提交于
      Delete all the code that tried to emulate the real IPRs of some
      unnamed CPU.  Replace those with just 3 slots that we can use to
      communicate trap information between the helper functions that
      signal exceptions and the OS trap handler.
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      129d8aa5
  5. 22 5月, 2011 1 次提交
  6. 20 5月, 2011 1 次提交
  7. 08 5月, 2011 1 次提交
  8. 13 4月, 2011 1 次提交
  9. 12 4月, 2011 1 次提交
  10. 09 2月, 2011 1 次提交
  11. 07 12月, 2010 1 次提交
  12. 03 12月, 2010 1 次提交
    • 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
  13. 06 10月, 2010 1 次提交
  14. 09 9月, 2010 1 次提交
  15. 22 7月, 2010 1 次提交
  16. 10 6月, 2010 1 次提交
  17. 09 6月, 2010 1 次提交
  18. 29 5月, 2010 2 次提交
  19. 22 5月, 2010 3 次提交
  20. 19 5月, 2010 1 次提交
  21. 27 4月, 2010 2 次提交
  22. 26 4月, 2010 1 次提交
  23. 08 4月, 2010 1 次提交
  24. 30 3月, 2010 1 次提交
  25. 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
  26. 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
  27. 01 3月, 2010 1 次提交
  28. 24 2月, 2010 1 次提交
  29. 23 2月, 2010 1 次提交
    • J
      Add cpu model configuration support.. · b5ec5ce0
      john cooper 提交于
      This is a reimplementation of prior versions which adds
      the ability to define cpu models for contemporary processors.
      The added models are likewise selected via -cpu <name>,
      and are intended to displace the existing convention
      of "-cpu qemu64" augmented with a series of feature flags.
      
      A primary motivation was determination of a least common
      denominator within a given processor class to simplify guest
      migration.  It is still possible to modify an arbitrary model
      via additional feature flags however the goal here was to
      make doing so unnecessary in typical usage.  The other
      consideration was providing models names reflective of
      current processors.  Both AMD and Intel have reviewed the
      models in terms of balancing generality of migration vs.
      excessive feature downgrade relative to released silicon.
      
      This version of the patch replaces the prior hard wired
      definitions with a configuration file approach for new
      models.  Existing models are thus far left as-is but may
      easily be transitioned to (or may be overridden by) the
      configuration file representation.
      
      Proposed new model definitions are provided here for current
      AMD and Intel processors.  Each model consists of a name
      used to select it on the command line (-cpu <name>), and a
      model_id which corresponds to a least common denominator
      commercial instance of the processor class.
      
      A table of names/model_ids may be queried via "-cpu ?model":
      
              :
          x86       Opteron_G3  AMD Opteron 23xx (Gen 3 Class Opteron)
          x86       Opteron_G2  AMD Opteron 22xx (Gen 2 Class Opteron)
          x86       Opteron_G1  AMD Opteron 240 (Gen 1 Class Opteron)
          x86          Nehalem  Intel Core i7 9xx (Nehalem Class Core i7)
          x86           Penryn  Intel Core 2 Duo P9xxx (Penryn Class Core 2)
          x86           Conroe  Intel Celeron_4x0 (Conroe/Merom Class Core 2)
              :
      
      Also added is "-cpu ?dump" which exhaustively outputs all config
      data for all defined models, and "-cpu ?cpuid" which enumerates
      all qemu recognized CPUID feature flags.
      
      The pseudo cpuid flag 'check' when added to the feature flag list
      will warn when feature flags (either implicit in a cpu model or
      explicit on the command line) would have otherwise been quietly
      unavailable to a guest:
      
          # qemu-system-x86_64 ... -cpu Nehalem,check
          warning: host cpuid 0000_0001 lacks requested flag 'sse4.2|sse4_2' [0x00100000]
          warning: host cpuid 0000_0001 lacks requested flag 'popcnt' [0x00800000]
      
      A similar 'enforce' pseudo flag exists which in addition
      to the above causes qemu to error exit if requested flags are
      unavailable.
      
      Configuration data for a cpu model resides in the target config
      file which by default will be installed as:
      
          /usr/local/etc/qemu/target-<arch>.conf
      
      The format of this file should be self explanatory given the
      definitions for the above six models and essentially mimics
      the structure of the static x86_def_t x86_defs.
      
      Encoding of cpuid flags names now allows aliases for both the
      configuration file and the command line which reconciles some
      Intel/AMD/Linux/Qemu naming differences.
      
      This patch was tested relative to qemu.git.
      Signed-off-by: Njohn cooper <john.cooper@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      b5ec5ce0
  30. 24 12月, 2009 1 次提交
  31. 21 12月, 2009 3 次提交
  32. 20 12月, 2009 1 次提交
  33. 11 12月, 2009 1 次提交