1. 25 10月, 2011 1 次提交
  2. 04 10月, 2011 1 次提交
    • L
      RunState: Rename enum values as generated by the QAPI · 0461d5a6
      Luiz Capitulino 提交于
      Next commit will convert the query-status command to use the
      RunState type as generated by the QAPI.
      
      In order to "transparently" replace the current enum by the QAPI
      one, we have to make some changes to some enum values.
      
      As the changes are simple renames, I'll do them in one shot. The
      changes are:
      
       - Rename the prefix from RSTATE_ to RUN_STATE_
       - RUN_STATE_SAVEVM to RUN_STATE_SAVE_VM
       - RUN_STATE_IN_MIGRATE to RUN_STATE_INMIGRATE
       - RUN_STATE_PANICKED to RUN_STATE_INTERNAL_ERROR
       - RUN_STATE_POST_MIGRATE to RUN_STATE_POSTMIGRATE
       - RUN_STATE_PRE_LAUNCH to RUN_STATE_PRELAUNCH
       - RUN_STATE_PRE_MIGRATE to RUN_STATE_PREMIGRATE
       - RUN_STATE_RESTORE to RUN_STATE_RESTORE_VM
       - RUN_STATE_PRE_MIGRATE to RUN_STATE_FINISH_MIGRATE
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      0461d5a6
  3. 16 9月, 2011 1 次提交
    • L
      Replace the VMSTOP macros with a proper state type · 1dfb4dd9
      Luiz Capitulino 提交于
      Today, when notifying a VM state change with vm_state_notify(),
      we pass a VMSTOP macro as the 'reason' argument. This is not ideal
      because the VMSTOP macros tell why qemu stopped and not exactly
      what the current VM state is.
      
      One example to demonstrate this problem is that vm_start() calls
      vm_state_notify() with reason=0, which turns out to be VMSTOP_USER.
      
      This commit fixes that by replacing the VMSTOP macros with a proper
      state type called RunState.
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      1dfb4dd9
  4. 02 9月, 2011 1 次提交
    • A
      main: force enabling of I/O thread · 12d4536f
      Anthony Liguori 提交于
      Enabling the I/O thread by default seems like an important part of declaring
      1.0.  Besides allowing true SMP support with KVM, the I/O thread means that the
      TCG VCPU doesn't have to multiplex itself with the I/O dispatch routines which
      currently requires a (racey) signal based alarm system.
      
      I know there have been concerns about performance.  I think so far the ones that
      have come up (virtio-net) are most likely due to secondary reasons like
      decreased batching.
      
      I think we ought to force enabling I/O thread early in 1.0 development and
      commit to resolving any lingering issues.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      12d4536f
  5. 21 8月, 2011 1 次提交
  6. 05 8月, 2011 1 次提交
  7. 21 6月, 2011 2 次提交
  8. 10 5月, 2011 1 次提交
    • A
      kvm: ppc: warn user on PAGE_SIZE mismatch · d4d6868f
      Alexander Graf 提交于
      On PPC, the default PAGE_SIZE is 64kb. Unfortunately, the hardware
      alignments don't match here: There are RAM and MMIO regions within
      a single page when it's 64kb in size.
      
      So the only way out for now is to tell the user that he should use 4k
      PAGE_SIZE.
      
      This patch gives the user a hint on that, telling him that failing to
      register a prefix slot is most likely to be caused by mismatching PAGE_SIZE.
      
      This way it's also more future-proof, as bigger PAGE_SIZE can easily be
      supported by other machines then, as long as they stick to 64kb granularities.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      d4d6868f
  9. 02 5月, 2011 3 次提交
    • P
      kvm: use qemu_free consistently · 4a043713
      Paolo Bonzini 提交于
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      4a043713
    • M
      fix crash in migration, 32-bit userspace on 64-bit host · 51b0c606
      Michael Tokarev 提交于
      This change fixes a long-standing immediate crash (memory corruption
      and abort in glibc malloc code) in migration on 32bits.
      
      The bug is present since this commit:
      
        commit 692d9aca97b865b0f7903565274a52606910f129
        Author: Bruce Rogers <brogers@novell.com>
        Date:   Wed Sep 23 16:13:18 2009 -0600
      
          qemu-kvm: allocate correct size for dirty bitmap
      
          The dirty bitmap copied out to userspace is stored in a long array,
          and gets copied out to userspace accordingly.  This patch accounts
          for that correctly.  Currently I'm seeing kvm crashing due to writing
          beyond the end of the alloc'd dirty bitmap memory, because the buffer
          has the wrong size.
      
          Signed-off-by: Bruce Rogers
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      
       --- a/qemu-kvm.c
       +++ b/qemu-kvm.c
       @@ int kvm_get_dirty_pages_range(kvm_context_t kvm, unsigned long phys_addr,
       -            buf = qemu_malloc((slots[i].len / 4096 + 7) / 8 + 2);
       +            buf = qemu_malloc(BITMAP_SIZE(slots[i].len));
                   r = kvm_get_map(kvm, KVM_GET_DIRTY_LOG, i, buf);
      
      BITMAP_SIZE is now open-coded in that function, like this:
      
       size = ALIGN(((mem->memory_size) >> TARGET_PAGE_BITS), HOST_LONG_BITS) / 8;
      
      The problem is that HOST_LONG_BITS in 32bit userspace is 32
      but it's 64 in 64bit kernel.  So userspace aligns this to
      32, and kernel to 64, but since no length is passed from
      userspace to kernel on ioctl, kernel uses its size calculation
      and copies 4 extra bytes to userspace, corrupting memory.
      
      Here's how it looks like during migrate execution:
      
      our=20, kern=24
      our=4, kern=8
      ...
      our=4, kern=8
      our=4064, kern=4064
      our=512, kern=512
      our=4, kern=8
      our=20, kern=24
      our=4, kern=8
      ...
      our=4, kern=8
      our=4064, kern=4064
      *** glibc detected *** ./x86_64-softmmu/qemu-system-x86_64: realloc(): invalid next size: 0x08f20528 ***
      
      (our is userspace size above, kern is the size as calculated
      by the kernel).
      
      Fix this by always aligning to 64 in a hope that no platform will
      have sizeof(long)>8 any time soon, and add a comment describing it
      all.  It's a small price to pay for bad kernel design.
      
      Alternatively it's possible to fix that in the kernel by using
      different size calculation depending on the current process.
      But this becomes quite ugly.
      
      Special thanks goes to Stefan Hajnoczi for spotting the fundamental
      cause of the issue, and to Alexander Graf for his support in #qemu.
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      CC: Bruce Rogers <brogers@novell.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      51b0c606
    • J
      kvm: Install specialized interrupt handler · aa7f74d1
      Jan Kiszka 提交于
      KVM only requires to set the raised IRQ in CPUState and to kick the
      receiving vcpu if it is remote. Installing a specialized handler allows
      potential future changes to the TCG code path without risking KVM side
      effects.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      aa7f74d1
  10. 07 4月, 2011 2 次提交
  11. 17 3月, 2011 7 次提交
  12. 15 3月, 2011 2 次提交
  13. 14 2月, 2011 10 次提交
  14. 31 1月, 2011 1 次提交
  15. 23 1月, 2011 6 次提交