1. 09 11月, 2012 1 次提交
    • C
      virtio: Don't access index after unregister. · 237242bd
      Cornelia Huck 提交于
      Virtio wants to release used indices after the corresponding
      virtio device has been unregistered. However, virtio does not
      hold an extra reference, giving up its last reference with
      device_unregister(), making accessing dev->index afterwards
      invalid.
      
      I actually saw problems when testing my (not-yet-merged)
      virtio-ccw code:
      
      - device_add virtio-net,id=xxx
      -> creates device virtio<n> with n>0
      
      - device_del xxx
      -> deletes virtio<n>, but calls ida_simple_remove with an
         index of 0
      
      - device_add virtio-net,id=xxx
      -> tries to add virtio0, which is still in use...
      
      So let's save the index we want to release before calling
      device_unregister().
      Signed-off-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      Acked-by: NSjur Brændeland <sjur.brandeland@stericsson.com>
      Cc: stable@kernel.org
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      237242bd
  2. 28 9月, 2012 11 次提交
  3. 20 7月, 2012 1 次提交
  4. 09 7月, 2012 1 次提交
    • M
      virtio-balloon: fix add/get API use · 9c378abc
      Michael S. Tsirkin 提交于
      Since ee7cd898 'virtio: expose added
      descriptors immediately.', in virtio balloon virtqueue_get_buf might
      now run concurrently with virtqueue_kick.  I audited both and this
      seems safe in practice but this is not guaranteed by the API.
      Additionally, a spurious interrupt might in theory make
      virtqueue_get_buf run in parallel with virtqueue_add_buf, which is
      racy.
      
      While we might try to protect against spurious callbacks it's
      easier to fix the driver: balloon seems to be the only one
      (mis)using the API like this, so let's just fix balloon.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (removed unused var)
      9c378abc
  5. 22 5月, 2012 4 次提交
  6. 17 5月, 2012 1 次提交
  7. 15 4月, 2012 2 次提交
  8. 31 3月, 2012 5 次提交
  9. 29 3月, 2012 1 次提交
  10. 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
  11. 28 1月, 2012 2 次提交
  12. 12 1月, 2012 10 次提交