1. 26 1月, 2013 3 次提交
    • P
      block: implement dirty bitmap using HBitmap · 8f0720ec
      Paolo Bonzini 提交于
      This actually uses the dirty bitmap in the block layer, and converts
      mirroring to use an HBitmapIter.
      
      Reviewed-by: Laszlo Ersek <lersek@redhat.com> (except block/mirror.c parts)
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      8f0720ec
    • P
      add hierarchical bitmap data type and test cases · e7c033c3
      Paolo Bonzini 提交于
      HBitmaps provides an array of bits.  The bits are stored as usual in an
      array of unsigned longs, but HBitmap is also optimized to provide fast
      iteration over set bits; going from one bit to the next is O(logB n)
      worst case, with B = sizeof(long) * CHAR_BIT: the result is low enough
      that the number of levels is in fact fixed.
      
      In order to do this, it stacks multiple bitmaps with progressively coarser
      granularity; in all levels except the last, bit N is set iff the N-th
      unsigned long is nonzero in the immediately next level.  When iteration
      completes on the last level it can examine the 2nd-last level to quickly
      skip entire words, and even do so recursively to skip blocks of 64 words or
      powers thereof (32 on 32-bit machines).
      
      Given an index in the bitmap, it can be split in group of bits like
      this (for the 64-bit case):
      
           bits 0-57 => word in the last bitmap     | bits 58-63 => bit in the word
           bits 0-51 => word in the 2nd-last bitmap | bits 52-57 => bit in the word
           bits 0-45 => word in the 3rd-last bitmap | bits 46-51 => bit in the word
      
      So it is easy to move up simply by shifting the index right by
      log2(BITS_PER_LONG) bits.  To move down, you shift the index left
      similarly, and add the word index within the group.  Iteration uses
      ffs (find first set bit) to find the next word to examine; this
      operation can be done in constant time in most current architectures.
      
      Setting or clearing a range of m bits on all levels, the work to perform
      is O(m + m/W + m/W^2 + ...), which is O(m) like on a regular bitmap.
      
      When iterating on a bitmap, each bit (on any level) is only visited
      once.  Hence, The total cost of visiting a bitmap with m bits in it is
      the number of bits that are set in all bitmaps.  Unless the bitmap is
      extremely sparse, this is also O(m + m/W + m/W^2 + ...), so the amortized
      cost of advancing from one bit to the next is usually constant.
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      e7c033c3
    • P
      host-utils: add ffsl · 4c37ef02
      Paolo Bonzini 提交于
      We can provide fast versions based on the other functions defined
      by host-utils.h.  Some care is required on glibc, which provides
      ffsl already.
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      4c37ef02
  2. 25 1月, 2013 1 次提交
  3. 24 1月, 2013 5 次提交
    • M
      Revert "serial: fix retry logic" · b37a2e45
      Michael Tokarev 提交于
      This reverts commit 67c5322d:
      
          I'm not sure if the retry logic has ever worked when not using FIFO mode.  I
          found this while writing a test case although code inspection confirms it is
          definitely broken.
      
          The TSR retry logic will never actually happen because it is guarded by an
          'if (s->tsr_rety > 0)' but this is the only place that can ever make the
          variable greater than zero.  That effectively makes the retry logic an 'if (0)
      
          I believe this is a typo and the intention was >= 0.  Once this is fixed thoug
          I see double transmits with my test case.  This is because in the non FIFO
          case, serial_xmit may get invoked while LSR.THRE is still high because the
          character was processed but the retransmit timer was still active.
      
          We can handle this by simply checking for LSR.THRE and returning early.  It's
          possible that the FIFO paths also need some attention.
      
          Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      Even if the previous logic was never worked, new logic breaks stuff -
      namely,
      
       qemu -enable-kvm -nographic -kernel /boot/vmlinuz-$(uname -r) -append console=ttyS0 -serial pty
      
      the above command will cause the virtual machine to stuck at startup
      using 100% CPU till one connects to the pty and sends any char to it.
      
      Note this is rather typical invocation for various headless virtual
      machines by libvirt.
      
      So revert this change for now, till a better solution will be found.
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      b37a2e45
    • P
      iscsi: add support for iovectors · 7371d56f
      Peter Lieven 提交于
      This patch adds support for directly passing the iovec
      array from QEMUIOVector if libiscsi supports it (1.8.0
      or newer).
      Signed-off-by: NPeter Lieven <pl@kamp.de>
      [Preserve the improvements from commit 4cc841b5, iscsi: partly
       avoid iovec linearization in iscsi_aio_writev, 2012-11-19 - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      7371d56f
    • P
      iscsi: do not leak acb->buf when commands are aborted · 4790b03d
      Paolo Bonzini 提交于
      acb->buf is freed in the WRITE(16) callback, but this may not
      get called at all when commands are aborted.  Add another
      free in the ABORT TASK callback, which requires setting acb->buf
      to NULL everywhere.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      4790b03d
    • A
      target-cris: Fix typo in D_LOG() macro · 3f668b6c
      Andreas Färber 提交于
      It's __VA_ARGS__. Fixes the build with CRIS_[OP_]HELPER_DEBUG defined.
      
      Broken since r6338 / 93fcfe39 (Convert
      references to logfile/loglevel to use qemu_log*() macros).
      
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      Signed-off-by: NEdgar E. Iglesias <edgar.iglesias@gmail.com>
      3f668b6c
    • G
      trivial: etraxfs_eth: Eliminate checkpatch errors · 9fc7577a
      Grant Likely 提交于
      This is a trivial patch to harmonize the coding style on
      hw/etraxfs_eth.c. This is in preparation to split off the bitbang mdio
      code into a separate file.
      
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Paul Brook <paul@codesourcery.com>
      Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
      Cc: Anthony Liguori <aliguori@us.ibm.com>
      Cc: Andreas Färber <afaerber@suse.de>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NEdgar E. Iglesias <edgar.iglesias@gmail.com>
      9fc7577a
  4. 23 1月, 2013 3 次提交
  5. 22 1月, 2013 23 次提交
  6. 21 1月, 2013 5 次提交