1. 02 1月, 2013 10 次提交
    • S
      virtio-blk: restore VirtIOBlkConf->config_wce flag · 8a873ba7
      Stefan Hajnoczi 提交于
      Two slightly different versions of a patch to conditionally set
      VIRTIO_BLK_F_CONFIG_WCE through the "config-wce" qdev property have been
      applied (ea776abc and eec7f96c).  David Gibson
      <david@gibson.dropbear.id.au> noticed that the "config-wce"
      property is broken as a result and fixed it recently.
      
      The fix sets the host_features VIRTIO_BLK_F_CONFIG_WCE bit from a qdev
      property.  Unfortunately, the virtio device then has no chance to test
      for the presence of the feature bit during virtio_blk_init().
      
      Therefore, reinstate the VirtIOBlkConf->config_wce flag.  Drop the
      duplicate qdev property to set the host_features bit.  The
      VirtIOBlkConf->config_wce flag will be used by virtio-blk-data-plane in
      a later patch.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      8a873ba7
    • S
      iov: add qemu_iovec_concat_iov() · 530c0bbd
      Stefan Hajnoczi 提交于
      The qemu_iovec_concat() function copies a subset of a QEMUIOVector.  The
      new qemu_iovec_concat_iov() function does the same for a iov/cnt pair.
      
      It is easy to define qemu_iovec_concat() in terms of
      qemu_iovec_concat_iov().  The existing code is mostly unchanged, except
      for the assertion src->size >= soffset, which cannot be efficiently
      checked upfront on a iov/cnt pair.  Instead we assert upon hitting the
      end of src with an unsatisfied soffset.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      530c0bbd
    • S
      8962e44f
    • S
      iov: add iov_discard_front/back() to remove data · d0277635
      Stefan Hajnoczi 提交于
      The iov_discard_front/back() functions remove data from the front or
      back of the vector.  This is useful when peeling off header/footer
      structs.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      d0277635
    • S
      dataplane: add Linux AIO request queue · 3e9ec521
      Stefan Hajnoczi 提交于
      The IOQueue has a pool of iocb structs and a function to add new
      read/write requests.  Multiple requests can be added before calling the
      submit function to actually tell the host kernel to begin I/O.  This
      allows callers to batch requests and submit them in one go.
      
      The actual I/O is performed using Linux AIO.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      3e9ec521
    • S
      dataplane: add event loop · 71973b04
      Stefan Hajnoczi 提交于
      Outside the safety of the global mutex we need to poll on file
      descriptors.  I found epoll(2) is a convenient way to do that, although
      other options could replace this module in the future (such as an
      AioContext-based loop or glib's GMainLoop).
      
      One important feature of this small event loop implementation is that
      the loop can be terminated in a thread-safe way.  This allows QEMU to
      stop the data plane thread cleanly.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      71973b04
    • S
      dataplane: add virtqueue vring code · 88807f89
      Stefan Hajnoczi 提交于
      The virtio-blk-data-plane cannot access memory using the usual QEMU
      functions since it executes outside the global mutex and the memory APIs
      are this time are not thread-safe.
      
      This patch introduces a virtqueue module based on the kernel's vhost
      vring code.  The trick is that we map guest memory ahead of time and
      access it cheaply outside the global mutex.
      
      Once the hardware emulation code can execute outside the global mutex it
      will be possible to drop this code.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      88807f89
    • S
      dataplane: add host memory mapping code · 185ecf40
      Stefan Hajnoczi 提交于
      The data plane thread needs to map guest physical addresses to host
      pointers.  Normally this is done with cpu_physical_memory_map() but the
      function assumes the global mutex is held.  The data plane thread does
      not touch the global mutex and therefore needs a thread-safe memory
      mapping mechanism.
      
      Hostmem registers a MemoryListener similar to how vhost collects and
      pushes memory region information into the kernel.  There is a
      fine-grained lock on the regions list which is held during lookup and
      when installing a new regions list.
      
      When the physical memory map changes the MemoryListener callbacks are
      invoked.  They build up a new list of memory regions which is finally
      installed when the list has been completed.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      185ecf40
    • S
      configure: add CONFIG_VIRTIO_BLK_DATA_PLANE · 583f6e7b
      Stefan Hajnoczi 提交于
      The virtio-blk-data-plane feature only works with Linux AIO.  Therefore
      add a ./configure option and necessary checks to implement this
      dependency.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      583f6e7b
    • S
      raw-posix: add raw_get_aio_fd() for virtio-blk-data-plane · 4065742a
      Stefan Hajnoczi 提交于
      The raw_get_aio_fd() function allows virtio-blk-data-plane to get the
      file descriptor of a raw image file with Linux AIO enabled.  This
      interface is really a layering violation that can be resolved once the
      block layer is able to run outside the global mutex - at that point
      virtio-blk-data-plane will switch from custom Linux AIO code to using
      the block layer.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      4065742a
  2. 01 1月, 2013 7 次提交
  3. 29 12月, 2012 7 次提交
  4. 24 12月, 2012 4 次提交
  5. 23 12月, 2012 4 次提交
    • J
      win32: Switch thread abstraction to us TLS variable internally · 6265e4ff
      Jan Kiszka 提交于
      We already depend on working __thread support for coroutines, so this
      complication here is no longer needed.
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      6265e4ff
    • E
      target-i386: CPUID: return highest basic leaf if eax > cpuid_xlevel · 57f26ae7
      Eduardo Habkost 提交于
      This fixes a subtle bug. A bug that probably won't cause trouble for any
      existing OS, but a bug anyway:
      
      Intel SDM Volume 2, CPUID Instruction states:
      
      > Two types of information are returned: basic and extended function
      > information. If a value entered for CPUID.EAX is higher than the maximum
      > input value for basic or extended function for that processor then the
      > data for the highest basic information leaf is returned. For example,
      > using the Intel Core i7 processor, the following is true:
      >
      >   CPUID.EAX = 05H (* Returns MONITOR/MWAIT leaf. *)
      >   CPUID.EAX = 0AH (* Returns Architectural Performance Monitoring leaf. *)
      >   CPUID.EAX = 0BH (* Returns Extended Topology Enumeration leaf. *)
      >   CPUID.EAX = 0CH (* INVALID: Returns the same information as CPUID.EAX = 0BH. *)
      >   CPUID.EAX = 80000008H (* Returns linear/physical address size data. *)
      >   CPUID.EAX = 8000000AH (* INVALID: Returns same information as CPUID.EAX = 0BH. *)
      
      AMD's CPUID Specification, on the other hand, is less specific:
      
      > The CPUID instruction supports two sets or ranges of functions,
      > standard and extended.
      >
      > • The smallest function number of the standard function range is
      >   Fn0000_0000. The largest function num- ber of the standard function
      >   range, for a particular implementation, is returned in CPUID
      >   Fn0000_0000_EAX.
      >
      > • The smallest function number of the extended function range is
      >   Fn8000_0000. The largest function num- ber of the extended function
      >   range, for a particular implementation, is returned in CPUID
      >   Fn8000_0000_EAX.
      >
      > Functions that are neither standard nor extended are undefined and
      > should not be relied upon.
      
      QEMU's behavior matched Intel's specification before, but this was
      changed by commit b3baa152. This patch
      restores the behavior documented by Intel when cpuid_xlevel2 is 0.
      
      The existing behavior when cpuid_xlevel2 is set (falling back to
      level=cpuid_xlevel) is being kept, as I couldn't find any public
      documentation on the CPUID 0xC0000000 function range on Centaur CPUs.
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      57f26ae7
    • L
      qemu-char: Inherit ptys and improve output from -serial pty · 58650218
      Lei Li 提交于
      Changes since V1:
        - Avoid crashing since qemu_opts_id() may return null on some
          systems according to Markus's suggestion.
      
      When controlling a qemu instance from another program, it's
      hard to know which serial port or monitor device is redirected
      to which pty. With more than one device using "pty" a lot of
      guesswork is involved.
      
      $ ./x86_64-softmmu/qemu-system-x86_64 -serial pty -serial pty -monitor pty
      char device redirected to /dev/pts/5
      char device redirected to /dev/pts/6
      char device redirected to /dev/pts/7
      
      Although we can find out what everything else is connected to
      by the "info chardev" with "-monitor stdio" in the command line,
      It'd be very useful to be able to have qemu inherit pseudo-tty
      file descriptors so they could just be specified on the command
      line like:
      
      $ ./x86_64-softmmu/qemu-system-x86_64 -serial pty -serial pty -monitor pty
      char device compat_monitor0 redirected to /dev/pts/5
      char device serial0 redirected to /dev/pts/6
      char device serial1 redirected to /dev/pts/7
      
      Referred link: https://bugs.launchpad.net/qemu/+bug/938552Signed-off-by: NLei Li <lilei@linux.vnet.ibm.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      58650218
    • A
      Merge branch 'master' of git://git.qemu.org/qemu into qom-cpu · 501a7ce7
      Andreas Färber 提交于
      Adapt header include paths.
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      501a7ce7
  6. 22 12月, 2012 6 次提交
  7. 21 12月, 2012 2 次提交
    • A
      Merge remote-tracking branch 'quintela/thread-20121220.next' into staging · bb5801f5
      Anthony Liguori 提交于
      * quintela/thread-20121220.next: (79 commits)
        migration: merge QEMUFileBuffered into MigrationState
        migration: fix qemu_get_fd for BufferedFile
        ram: refactor ram_save_block() return value
        ram: account the amount of transferred ram better
        ram: optimize migration bitmap walking
        ram: Use memory_region_test_and_clear_dirty
        memory: introduce memory_region_test_and_clear_dirty
        ram: Add last_sent_block
        ram: rename last_block to last_seen_block
        migration: move migration notifier
        migration: Inline qemu_fopen_ops_buffered into migrate_fd_connect
        migration: move migration_fd_put_ready()
        migration: add XFER_LIMIT_RATIO
        migration: move buffered_file.c code into migration.c
        savevm: New save live migration method: pending
        buffered_file: unfold buffered_append in buffered_put_buffer
        buffered_file: don't flush on put buffer
        buffered_file: Unfold the trick to restart generating migration data
        migration: just lock migrate_fd_put_ready
        migration: remove unfreeze logic
        ...
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      bb5801f5
    • J
      migration: merge QEMUFileBuffered into MigrationState · 9848a404
      Juan Quintela 提交于
      Avoid splitting the state of outgoing migration, more or less arbitrarily,
      between two data structures.  QEMUFileBuffered anyway is used only during
      migration.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NJuan Quintela <quintela@redhat.com>
      9848a404