]> git.proxmox.com Git - qemu.git/commitdiff
Merge remote branch 'qemu-kvm/uq/master' into staging-tmp
authorAnthony Liguori <aliguori@us.ibm.com>
Mon, 8 Feb 2010 16:06:54 +0000 (10:06 -0600)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 8 Feb 2010 16:06:54 +0000 (10:06 -0600)
1  2 
exec.c
vl.c

diff --combined exec.c
index b0caf7c24f81b0a598c8fd6fa31cf9febf0a0c37,67fabaef04ccaea10ccf705ef1cfdc4387232aa7..0fb363b49d184e0a4cc91b6e85b27e3ca6e9b2f8
--- 1/exec.c
--- 2/exec.c
+++ b/exec.c
@@@ -40,7 -40,6 +40,7 @@@
  #include "kvm.h"
  #if defined(CONFIG_USER_ONLY)
  #include <qemu.h>
 +#include <signal.h>
  #endif
  
  //#define DEBUG_TB_INVALIDATE
@@@ -1538,15 -1537,15 +1538,15 @@@ static void cpu_unlink_tb(CPUState *env
      TranslationBlock *tb;
      static spinlock_t interrupt_lock = SPIN_LOCK_UNLOCKED;
  
 +    spin_lock(&interrupt_lock);
      tb = env->current_tb;
      /* if the cpu is currently executing code, we must unlink it and
         all the potentially executing TB */
      if (tb) {
 -        spin_lock(&interrupt_lock);
          env->current_tb = NULL;
          tb_reset_jump_recursive(tb);
 -        spin_unlock(&interrupt_lock);
      }
 +    spin_unlock(&interrupt_lock);
  }
  
  /* mask must never be zero, except for A20 change call */
@@@ -1693,14 -1692,6 +1693,14 @@@ void cpu_abort(CPUState *env, const cha
      }
      va_end(ap2);
      va_end(ap);
 +#if defined(CONFIG_USER_ONLY)
 +    {
 +        struct sigaction act;
 +        sigfillset(&act.sa_mask);
 +        act.sa_handler = SIG_DFL;
 +        sigaction(SIGABRT, &act, NULL);
 +    }
 +#endif
      abort();
  }
  
@@@ -2415,6 -2406,12 +2415,12 @@@ void qemu_unregister_coalesced_mmio(tar
          kvm_uncoalesce_mmio_region(addr, size);
  }
  
+ void qemu_flush_coalesced_mmio_buffer(void)
+ {
+     if (kvm_enabled())
+         kvm_flush_coalesced_mmio_buffer();
+ }
  ram_addr_t qemu_ram_alloc(ram_addr_t size)
  {
      RAMBlock *new_block;
@@@ -2498,13 -2495,17 +2504,13 @@@ void *qemu_get_ram_ptr(ram_addr_t addr
  ram_addr_t qemu_ram_addr_from_host(void *ptr)
  {
      RAMBlock *prev;
 -    RAMBlock **prevp;
      RAMBlock *block;
      uint8_t *host = ptr;
  
      prev = NULL;
 -    prevp = &ram_blocks;
      block = ram_blocks;
      while (block && (block->host > host
                       || block->host + block->length <= host)) {
 -        if (prev)
 -          prevp = &prev->next;
          prev = block;
          block = block->next;
      }
diff --combined vl.c
index 5ddf1febdfe36af452230d391fdcc31aba5b5a0d,57f0ba53df0fa014616fb56ec008667d72371e14..880bcd5943e9924938596c762a0d8190155de44f
--- 1/vl.c
--- 2/vl.c
+++ b/vl.c
@@@ -2380,9 -2380,9 +2380,9 @@@ static void numa_add(const char *optarg
                          fprintf(stderr,
                              "only 63 CPUs in NUMA mode supported.\n");
                      }
 -                    value = (1 << (endvalue + 1)) - (1 << value);
 +                    value = (2ULL << endvalue) - (1ULL << value);
                  } else {
 -                    value = 1 << value;
 +                    value = 1ULL << value;
                  }
              }
              node_cpumask[nodenr] = value;
@@@ -2996,6 -2996,7 +2996,7 @@@ static void gui_update(void *opaque
      DisplayState *ds = opaque;
      DisplayChangeListener *dcl = ds->listeners;
  
+     qemu_flush_coalesced_mmio_buffer();
      dpy_refresh(ds);
  
      while (dcl != NULL) {
@@@ -3011,6 -3012,7 +3012,7 @@@ static void nographic_update(void *opaq
  {
      uint64_t interval = GUI_REFRESH_INTERVAL;
  
+     qemu_flush_coalesced_mmio_buffer();
      qemu_mod_timer(nographic_timer, interval + qemu_get_clock(rt_clock));
  }
  
@@@ -3280,6 -3282,8 +3282,8 @@@ static int cpu_can_run(CPUState *env
          return 0;
      if (env->stopped)
          return 0;
+     if (!vm_running)
+         return 0;
      return 1;
  }
  
@@@ -4021,7 -4025,11 +4025,7 @@@ static void version(void
  
  static void help(int exitcode)
  {
 -    version();
 -    printf("usage: %s [options] [disk_image]\n"
 -           "\n"
 -           "'disk_image' is a raw hard image image for IDE hard disk 0\n"
 -           "\n"
 +    const char *options_help =
  #define DEF(option, opt_arg, opt_enum, opt_help)        \
             opt_help
  #define DEFHEADING(text) stringify(text) "\n"
  #undef DEF
  #undef DEFHEADING
  #undef GEN_DOCS
 +        ;
 +    version();
 +    printf("usage: %s [options] [disk_image]\n"
 +           "\n"
 +           "'disk_image' is a raw hard image image for IDE hard disk 0\n"
             "\n"
 +           "%s\n"
             "During emulation, the following keys are useful:\n"
             "ctrl-alt-f      toggle full screen\n"
             "ctrl-alt-n      switch to virtual console 'n'\n"
             "ctrl-alt        toggle mouse and keyboard grab\n"
             "\n"
 -           "When using -nographic, press 'ctrl-a h' to get some help.\n"
 -           ,
 +           "When using -nographic, press 'ctrl-a h' to get some help.\n",
             "qemu",
 -           DEFAULT_RAM_SIZE,
 -#ifndef _WIN32
 -           DEFAULT_NETWORK_SCRIPT,
 -           DEFAULT_NETWORK_DOWN_SCRIPT,
 -#endif
 -           DEFAULT_GDBSTUB_PORT,
 -           "/tmp/qemu.log");
 +           options_help);
      exit(exitcode);
  }