1. 13 8月, 2013 1 次提交
  2. 09 5月, 2013 1 次提交
  3. 04 5月, 2013 1 次提交
  4. 25 4月, 2013 3 次提交
  5. 09 4月, 2013 2 次提交
  6. 01 3月, 2013 1 次提交
    • P
      hw: include hw header files with full paths · 83c9f4ca
      Paolo Bonzini 提交于
      Done with this script:
      
      cd hw
      for i in `find . -name '*.h' | sed 's/^..//'`; do
        echo '\,^#.*include.*["<]'$i'[">], s,'$i',hw/&,'
      done | sed -i -f - `find . -type f`
      
      This is so that paths remain valid as files are moved.
      
      Instead, files in hw/dataplane are referenced with the relative path.
      We know they are not going to move to include/, and they are the only
      include files that are in subdirectories _and_ move.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      83c9f4ca
  7. 02 2月, 2013 2 次提交
  8. 22 1月, 2013 1 次提交
  9. 20 12月, 2012 1 次提交
  10. 19 12月, 2012 1 次提交
  11. 30 11月, 2012 1 次提交
  12. 23 10月, 2012 1 次提交
    • A
      Rename target_phys_addr_t to hwaddr · a8170e5e
      Avi Kivity 提交于
      target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are
      reserved) and its purpose doesn't match the name (most target_phys_addr_t
      addresses are not target specific).  Replace it with a finger-friendly,
      standards conformant hwaddr.
      
      Outstanding patchsets can be fixed up with the command
      
        git rebase -i --exec 'find -name "*.[ch]"
                              | xargs s/target_phys_addr_t/hwaddr/g' origin
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      a8170e5e
  13. 28 9月, 2012 3 次提交
  14. 07 8月, 2012 1 次提交
  15. 12 7月, 2012 2 次提交
  16. 25 4月, 2012 3 次提交
    • M
      virtio: order index/descriptor reads · a821ce59
      Michael S. Tsirkin 提交于
      virtio has the equivalent of:
      
      	if (vq->last_avail_index != vring_avail_idx(vq)) {
      		read descriptor head at vq->last_avail_index;
      	}
      
      In theory, processor can reorder descriptor head
      read to happen speculatively before the index read.
      this would trigger the following race:
      
      	host descriptor head read <- reads invalid head from ring
      		guest writes valid descriptor head
      		guest writes avail index
      	host avail index read <- observes valid index
      
      as a result host will use an invalid head value.
      This was not observed in the field by me but after
      the experience with the previous two races
      I think it is prudent to address this theoretical race condition.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      a821ce59
    • M
      virtio: add missing mb() on enable notification · 92045d80
      Michael S. Tsirkin 提交于
      This fixes an issue dual to the one fixed by
      patch 'virtio: add missing mb() on notification'
      and applies on top.
      
      In this case, to enable vq kick to exit to host,
      qemu writes out used flag then reads the
      avail index. if these are reordered we get a race:
      
          host avail index read: ring is empty
          		guest avail index write
          		guest flag read: exit disabled
          host used flag write: enable exit
      
      which results in a lost exit: host will never be notified about the
      avail index update.  Again, happens in the field but only seems to
      trigger on some specific hardware.
      
      Insert an smp_mb barrier operation to ensure the correct ordering.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      92045d80
    • M
      virtio: add missing mb() on notification · a281ebc1
      Michael S. Tsirkin 提交于
      During normal operation, virtio first writes a used index
      and then checks whether it should interrupt the guest
      by reading guest avail index/flag values.
      
      Guest does the reverse: writes the index/flag,
      then checks the used ring.
      
      The ordering is important: if host avail flag read bypasses the used
      index write, we could in effect get this timing:
      
      host avail flag read
      		guest enable interrupts: avail flag write
      		guest check used ring: ring is empty
      host used index write
      
      which results in a lost interrupt: guest will never be notified
      about the used ring update.
      
      This actually can happen when using kvm with an io thread,
      such that the guest vcpu and qemu run on different host cpus,
      and this has actually been observed in the field
      (but only seems to trigger on very specific processor types)
      with userspace virtio: vhost has the necessary smp_mb()
      in place to prevent the regordering, so the same workload stalls
      forever waiting for an interrupt with vhost=off but works
      fine with vhost=on.
      
      Insert an smp_mb barrier operation in userspace virtio to
      ensure the correct ordering.
      Applying this patch fixed the race condition we have observed.
      Tested on x86_64. I checked the code generated by the new macro
      for i386 and ppc but didn't run virtio.
      
      Note: mb could in theory be implemented by __sync_synchronize, but this
      would make us hit old GCC bugs. Besides old GCC
      not implementing __sync_synchronize at all, there were bugs
      http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36793
      in this functionality as recently as in 4.3.
      
      As we need asm for rmb,wmb anyway, it's just as well to
      use it for mb.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      a281ebc1
  17. 19 4月, 2012 1 次提交
  18. 10 2月, 2012 1 次提交
  19. 21 1月, 2012 1 次提交
    • A
      virtio: change memcpy to guest reads · 06dbfc6f
      Alexander Graf 提交于
      When accessing the device specific virtio config space, we memcpy
      the data into a variable in QEMU. At that point we're basically
      pulling host endianness into the game which is a really bad idea.
      
      So instead, let's use the target specific load/store helpers for
      memory pointers which fetch things in target endianness. The whole
      array is already populated in target endianness anyways
      (see virtio-blk).
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Reviewed-by: NAnthony Liguori <aliguori@us.ibm.com>
      06dbfc6f
  20. 29 11月, 2011 1 次提交
  21. 24 9月, 2011 1 次提交
  22. 17 9月, 2011 1 次提交
  23. 16 9月, 2011 2 次提交
  24. 21 8月, 2011 1 次提交
  25. 28 7月, 2011 1 次提交
  26. 17 7月, 2011 1 次提交
  27. 24 6月, 2011 1 次提交
  28. 12 6月, 2011 3 次提交
    • M
      virtio: event index support · bcbabae8
      Michael S. Tsirkin 提交于
      Add support for event_idx feature, and utilize it to
      reduce the number of interrupts and exits for the guest.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      bcbabae8
    • J
      virtio: correctly initialize vm_running · d3674c57
      Jason Wang 提交于
      Current vm_running was not explicitly initialized and its value was changed by
      vm state notifier, this may confuse the virtio device being hotplugged such as
      virtio-net with vhost backend as it may think the vm was not running. Solve this
      by initialize this value explicitly in virtio_common_init().
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      d3674c57
    • S
      virtio: guard against negative vq notifies · 7157e2e2
      Stefan Hajnoczi 提交于
      The virtio_queue_notify() function checks that the virtqueue number is
      less than the maximum number of virtqueues.  A signed comparison is used
      but the virtqueue number could be negative if a buggy or malicious guest
      is run.  This results in memory accesses outside of the virtqueue array.
      
      It is risky doing input validation in common code instead of at the
      guest<->host boundary.  Note that virtio_queue_set_addr(),
      virtio_queue_get_addr(), virtio_queue_get_num(), and many other virtio
      functions do *not* validate the virtqueue number argument.
      
      Instead of fixing the comparison in virtio_queue_notify(), move the
      comparison to the virtio bindings (just like VIRTIO_PCI_QUEUE_SEL) where
      we have a uint32_t value and can avoid ever calling into common virtio
      code if the virtqueue number is invalid.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      7157e2e2