1. 31 3月, 2012 3 次提交
  2. 29 3月, 2012 1 次提交
  3. 01 3月, 2012 1 次提交
    • A
      virtio: balloon: leak / fill balloon across S4 · 4eb05d56
      Amit Shah 提交于
      commit e562966d added support for S4 to
      the balloon driver.  The freeze function did nothing to free the pages,
      since reclaiming the pages from the host to immediately give them back
      (if S4 was successful) seemed wasteful.  Also, if S4 wasn't successful,
      the guest would have to re-fill the balloon.  On restore, the pages were
      supposed to be marked freed and the free page counters were incremented
      to reflect the balloon was totally deflated.
      
      However, this wasn't done right.  The pages that were earlier taken away
      from the guest during a balloon inflation operation were just shown as
      used pages after a successful restore from S4.  Just a fancy way of
      leaking lots of memory.
      
      Instead of trying that, just leak the balloon on freeze and fill it on
      restore/thaw paths.  This works properly now.  The optimisation to not
      leak can be added later on after a bit of refactoring of the code.
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      4eb05d56
  4. 28 1月, 2012 2 次提交
  5. 12 1月, 2012 12 次提交
  6. 24 11月, 2011 3 次提交
  7. 17 11月, 2011 1 次提交
  8. 14 11月, 2011 1 次提交
  9. 02 11月, 2011 2 次提交
  10. 01 11月, 2011 1 次提交
  11. 24 10月, 2011 1 次提交
  12. 23 7月, 2011 1 次提交
    • O
      virtio: expose for non-virtualization users too · e7254219
      Ohad Ben-Cohen 提交于
      virtio has been so far used only in the context of virtualization,
      and the virtio Kconfig was sourced directly by the relevant arch
      Kconfigs when VIRTUALIZATION was selected.
      
      Now that we start using virtio for inter-processor communications,
      we need to source the virtio Kconfig outside of the virtualization
      scope too.
      
      Moreover, some architectures might use virtio for both virtualization
      and inter-processor communications, so directly sourcing virtio
      might yield unexpected results due to conflicting selections.
      
      The simple solution offered by this patch is to always source virtio's
      Kconfig in drivers/Kconfig, and remove it from the appropriate arch
      Kconfigs. Additionally, a virtio menu entry has been added so virtio
      drivers don't show up in the general drivers menu.
      
      This way anyone can use virtio, though it's arguably less accessible
      (and neat!) for virtualization users now.
      
      Note: some architectures (mips and sh) seem to have a VIRTUALIZATION
      menu merely for sourcing virtio's Kconfig, so that menu is removed too.
      Signed-off-by: NOhad Ben-Cohen <ohad@wizery.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      e7254219
  13. 30 5月, 2011 3 次提交
    • M
      virtio: add api for delayed callbacks · 7ab358c2
      Michael S. Tsirkin 提交于
      Add an API that tells the other side that callbacks
      should be delayed until a lot of work has been done.
      Implement using the new event_idx feature.
      
      Note: it might seem advantageous to let the drivers
      ask for a callback after a specific capacity has
      been reached. However, as a single head can
      free many entries in the descriptor table,
      we don't really have a clue about capacity
      until get_buf is called. The API is the simplest
      to implement at the moment, we'll see what kind of
      hints drivers can pass when there's more than one
      user of the feature.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      7ab358c2
    • M
      virtio_ring: support event idx feature · a5c262c5
      Michael S. Tsirkin 提交于
      Support for the new event idx feature:
      1. When enabling interrupts, publish the current avail index
         value to the host to get interrupts on the next update.
      2. Use the new avail_event feature to reduce the number
         of exits from the guest.
      
      Simple test with the simulator:
      
      [virtio]# time ./virtio_test
      spurious wakeus: 0x7
      
      real    0m0.169s
      user    0m0.140s
      sys     0m0.019s
      [virtio]# time ./virtio_test --no-event-idx
      spurious wakeus: 0x11
      
      real    0m0.649s
      user    0m0.295s
      sys     0m0.335s
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      a5c262c5
    • D
      virtio balloon: kill tell-host-first logic · bf50e69f
      Dave Hansen 提交于
      The virtio balloon driver has a VIRTIO_BALLOON_F_MUST_TELL_HOST
      feature bit.  Whenever the bit is set, the guest kernel must
      always tell the host before we free pages back to the allocator.
      Without this feature, we might free a page (and have another
      user touch it) while the hypervisor is unprepared for it.
      
      But, if the bit is _not_ set, we are under no obligation to
      reverse the order; we're under no obligation to do _anything_.
      As of now, qemu-kvm defines the bit, but doesn't set it.
      
      This patch makes the "tell host first" logic the only case.  This
      should make everybody happy, and reduce the amount of untested or
      untestable code in the kernel.
      
      This _also_ means that we don't have to preserve a pfn list
      after the pages are freed, which should let us get rid of some
      temporary storage (vb->pfns) eventually.
      Signed-off-by: NDave Hansen <dave@linux.vnet.ibm.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      bf50e69f
  14. 21 4月, 2011 2 次提交
    • A
      virtio_pci: Prevent double-free of pci regions after device hot-unplug · 31a3ddda
      Amit Shah 提交于
      In the case where a virtio-console port is in use (opened by a program)
      and a virtio-console device is removed, the port is kept around but all
      the virtio-related state is assumed to be gone.
      
      When the port is finally released (close() called), we call
      device_destroy() on the port's device.  This results in the parent
      device's structures to be freed as well.  This includes the PCI regions
      for the virtio-console PCI device.
      
      Once this is done, however, virtio_pci_release_dev() kicks in, as the
      last ref to the virtio device is now gone, and attempts to do
      
           pci_iounmap(pci_dev, vp_dev->ioaddr);
           pci_release_regions(pci_dev);
           pci_disable_device(pci_dev);
      
      which results in a double-free warning.
      
      Move the code that releases regions, etc., to the virtio_pci_remove()
      function, and all that's now left in release_dev is the final freeing of
      the vp_dev.
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      31a3ddda
    • A
      virtio: Decrement avail idx on buffer detach · b3258ff1
      Amit Shah 提交于
      When detaching a buffer from a vq, the avail.idx value should be
      decremented as well.
      
      This was noticed by hot-unplugging a virtio console port and then
      plugging in a new one on the same number (re-using the vqs which were
      just 'disowned').  qemu reported
      
         'Guest moved used index from 0 to 256'
      
      when any IO was attempted on the new port.
      
      CC: stable@kernel.org
      Reported-by: Njuzhang <juzhang@redhat.com>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      b3258ff1
  15. 20 1月, 2011 1 次提交
  16. 24 11月, 2010 2 次提交
  17. 26 7月, 2010 1 次提交
  18. 23 6月, 2010 2 次提交