19 Dec, 2014

1 commit

  • Pull virtio fixes from Michael S Tsirkin:
    "virtio 1.0 related fixes

    Most importantly, this fixes using virtio_pci as a module.

    Further, the big virtio 1.0 conversion missed a couple of places.
    This fixes them up.

    This isn't 100% sparse-clean yet because on many architectures
    get_user triggers sparse warnings when used with __bitwise tag (when
    same tag is on both pointer and value read).

    I posted a patchset to fix it up by adding __force on all arches that
    don't already have it (many do), when that's merged these warnings
    will go away"

    * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
    virtio_pci: restore module attributes
    mic/host: fix up virtio 1.0 APIs
    vringh: update for virtio 1.0 APIs
    vringh: 64 bit features
    tools/virtio: add virtio 1.0 in vringh_test
    tools/virtio: add virtio 1.0 in virtio_test
    tools/virtio: enable -Werror
    tools/virtio: 64 bit features
    tools/virtio: fix vringh test
    tools/virtio: more stubs
    virtio: core support for config generation
    virtio_pci: add VIRTIO_PCI_NO_LEGACY
    virtio_pci: move probe to common file
    virtio_pci_common.h: drop VIRTIO_PCI_NO_LEGACY
    virtio_config: fix virtio_cread_bytes
    virtio: set VIRTIO_CONFIG_S_FEATURES_OK on restore

    Linus Torvalds
     

18 Dec, 2014

1 commit

  • Pull virtio updates from Rusty Russell:
    "A balloon enhancement, and a minor race-on-module-unload theoretical
    bug which doesn't merit cc: stable.

    All the exciting stuff went via MST this cycle"

    * tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    virtio_balloon: free some memory from balloon on OOM
    virtio_balloon: return the amount of freed memory from leak_balloon()
    virtio_blk: fix race at module removal
    virtio: Fix comment typo 'CONFIG_S_FAILED'

    Linus Torvalds
     

17 Dec, 2014

1 commit


15 Dec, 2014

1 commit

  • Pull driver core update from Greg KH:
    "Here's the set of driver core patches for 3.19-rc1.

    They are dominated by the removal of the .owner field in platform
    drivers. They touch a lot of files, but they are "simple" changes,
    just removing a line in a structure.

    Other than that, a few minor driver core and debugfs changes. There
    are some ath9k patches coming in through this tree that have been
    acked by the wireless maintainers as they relied on the debugfs
    changes.

    Everything has been in linux-next for a while"

    * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
    Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
    fs: debugfs: add forward declaration for struct device type
    firmware class: Deletion of an unnecessary check before the function call "vunmap"
    firmware loader: fix hung task warning dump
    devcoredump: provide a one-way disable function
    device: Add dev__once variants
    ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
    ath: use seq_file api for ath9k debugfs files
    debugfs: add helper function to create device related seq_file
    drivers/base: cacheinfo: remove noisy error boot message
    Revert "core: platform: add warning if driver has no owner"
    drivers: base: support cpu cache information interface to userspace via sysfs
    drivers: base: add cpu_device_create to support per-cpu devices
    topology: replace custom attribute macros with standard DEVICE_ATTR*
    cpumask: factor out show_cpumap into separate helper function
    driver core: Fix unbalanced device reference in drivers_probe
    driver core: fix race with userland in device_add()
    sysfs/kernfs: make read requests on pre-alloc files use the buffer.
    sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
    fs: sysfs: return EGBIG on write if offset is larger than file size
    ...

    Linus Torvalds
     

14 Dec, 2014

1 commit


12 Dec, 2014

2 commits


10 Dec, 2014

12 commits


09 Dec, 2014

12 commits


11 Nov, 2014

2 commits

  • Excessive virtio_balloon inflation can cause invocation of OOM-killer,
    when Linux is under severe memory pressure. Various mechanisms are
    responsible for correct virtio_balloon memory management. Nevertheless
    it is often the case that these control tools does not have enough time
    to react on fast changing memory load. As a result OS runs out of memory
    and invokes OOM-killer. The balancing of memory by use of the virtio
    balloon should not cause the termination of processes while there are
    pages in the balloon. Now there is no way for virtio balloon driver to
    free some memory at the last moment before some process will be get
    killed by OOM-killer.

    This does not provide a security breach as balloon itself is running
    inside guest OS and is working in the cooperation with the host. Thus
    some improvements from guest side should be considered as normal.

    To solve the problem, introduce a virtio_balloon callback which is
    expected to be called from the oom notifier call chain in out_of_memory()
    function. If virtio balloon could release some memory, it will make
    the system to return and retry the allocation that forced the out of
    memory killer to run.

    Allocate virtio feature bit for this: it is not set by default,
    the the guest will not deflate virtio balloon on OOM without explicit
    permission from host.

    Signed-off-by: Raushaniya Maksudova
    Signed-off-by: Denis V. Lunev
    Acked-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Raushaniya Maksudova
     
  • This value would be useful in the next patch to provide the amount of
    the freed memory for OOM killer.

    Signed-off-by: Raushaniya Maksudova
    Signed-off-by: Denis V. Lunev
    CC: Rusty Russell
    CC: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Raushaniya Maksudova
     

20 Oct, 2014

1 commit


19 Oct, 2014

1 commit

  • Pull virtio updates from Rusty Russell:
    "One cc: stable commit, the rest are a series of minor cleanups which
    have been sitting in MST's tree during my vacation. I changed a
    function name and made one trivial change, then they spent two days in
    linux-next"

    * tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (25 commits)
    virtio-rng: refactor probe error handling
    virtio_scsi: drop scan callback
    virtio_balloon: enable VQs early on restore
    virtio_scsi: fix race on device removal
    virito_scsi: use freezable WQ for events
    virtio_net: enable VQs early on restore
    virtio_console: enable VQs early on restore
    virtio_scsi: enable VQs early on restore
    virtio_blk: enable VQs early on restore
    virtio_scsi: move kick event out from virtscsi_init
    virtio_net: fix use after free on allocation failure
    9p/trans_virtio: enable VQs early
    virtio_console: enable VQs early
    virtio_blk: enable VQs early
    virtio_net: enable VQs early
    virtio: add API to enable VQs early
    virtio_net: minor cleanup
    virtio-net: drop config_mutex
    virtio_net: drop config_enable
    virtio-blk: drop config_mutex
    ...

    Linus Torvalds
     

15 Oct, 2014

5 commits

  • virtio spec requires drivers to set DRIVER_OK before using VQs.
    This is set automatically after resume returns, virtio balloon
    violated this rule by adding bufs, which causes the VQ to be used
    directly within restore.

    To fix, call virtio_device_ready before using VQ.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • Defer config changed notifications that arrive during
    probe/scan/freeze/restore.

    This will allow drivers to set DRIVER_OK earlier, without worrying about
    racing with config change interrupts.

    This change will also benefit old hypervisors (before 2009)
    that send interrupts without checking DRIVER_OK: previously,
    the callback could race with driver-specific initialization.

    This will also help simplify drivers.

    Signed-off-by: Michael S. Tsirkin
    Reviewed-by: Cornelia Huck
    Signed-off-by: Rusty Russell (cosmetic changes)

    Michael S. Tsirkin
     
  • This is in preparation to extending config changed event handling
    in core.
    Wrapping these in an API also seems to make for a cleaner code.

    Signed-off-by: Michael S. Tsirkin
    Reviewed-by: Cornelia Huck
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • Replace duplicated code in all transports with a single wrapper in
    virtio.c.

    The only functional change is in virtio_mmio.c: if a buggy device sends
    us an interrupt before driver is set, we previously returned IRQ_NONE,
    now we return IRQ_HANDLED.

    As this must not happen in practice, this does not look like a big deal.

    See also commit 3fff0179e33cd7d0a688dab65700c46ad089e934
    virtio-pci: do not oops on config change if driver not loaded.
    for the original motivation behind the driver check.

    Signed-off-by: Michael S. Tsirkin
    Reviewed-by: Cornelia Huck
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • On restore, virtio pci does the following:
    + set features
    + init vqs etc - device can be used at this point!
    + set ACKNOWLEDGE,DRIVER and DRIVER_OK status bits

    This is in violation of the virtio spec, which
    requires the following order:
    - ACKNOWLEDGE
    - DRIVER
    - init vqs
    - DRIVER_OK

    This behaviour will break with hypervisors that assume spec compliant
    behaviour. It seems like a good idea to have this patch applied to
    stable branches to reduce the support butden for the hypervisors.

    Cc: stable@vger.kernel.org
    Cc: Amit Shah
    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin