26 Jan, 2017

1 commit

  • commit 21f5eda9b8671744539c8295b9df62991fffb2ce upstream.

    Since ef1b144d ("tools/virtio/ringtest: fix run-on-all.sh to work
    without /dev/cpu") run-on-all.sh uses seq 0 $HOST_AFFINITY as the list
    of ids of the CPUs to run the command on (assuming ids of online CPUs
    are consecutive and start from 0), where $HOST_AFFINITY is the highest
    CPU id in the system previously determined using lscpu. This can fail
    on systems with offline CPUs.

    Instead let's use lscpu to determine the list of online CPUs.

    Signed-off-by: Halil Pasic
    Fixes: ef1b144d ("tools/virtio/ringtest: fix run-on-all.sh to work without
    /dev/cpu")
    Reviewed-by: Sascha Silbe
    Signed-off-by: Cornelia Huck
    Signed-off-by: Greg Kroah-Hartman

    Halil Pasic
     

15 Jan, 2017

1 commit

  • commit 5da889c795b1fbefc9d8f058b54717ab8ab17891 upstream.

    The virtio tools implementation of READ_ONCE() has a single parameter called
    'var', but erroneously refers to 'val' for its cast, and thus won't work unless
    there's a variable of the correct type that happens to be called 'var'.

    Fix this with s/var/val/, making READ_ONCE() work as expected regardless.

    Fixes: a7c490333df3cff5 ("tools/virtio: use virt_xxx barriers")
    Signed-off-by: Mark Rutland
    Cc: Jason Wang
    Cc: Michael S. Tsirkin
    Cc: linux-kernel@vger.kernel.org
    Cc: virtualization@lists.linux-foundation.org
    Signed-off-by: Michael S. Tsirkin
    Reviewed-by: Cornelia Huck
    Reviewed-by: Jason Wang
    Signed-off-by: Greg Kroah-Hartman

    Mark Rutland
     

31 Oct, 2016

3 commits


15 Aug, 2016

2 commits


01 Jul, 2016

1 commit


30 Jun, 2016

1 commit


16 Jun, 2016

1 commit


06 Jun, 2016

3 commits


23 May, 2016

2 commits


02 Mar, 2016

1 commit

  • virtio_ring currently sends the device (usually a hypervisor)
    physical addresses of its I/O buffers. This is okay when DMA
    addresses and physical addresses are the same thing, but this isn't
    always the case. For example, this never works on Xen guests, and
    it is likely to fail if a physical "virtio" device ever ends up
    behind an IOMMU or swiotlb.

    The immediate use case for me is to enable virtio on Xen guests.
    For that to work, we need vring to support DMA address translation
    as well as a corresponding change to virtio_pci or to another
    driver.

    Signed-off-by: Andy Lutomirski
    Signed-off-by: Michael S. Tsirkin

    Andy Lutomirski
     

26 Jan, 2016

2 commits

  • This adds micro-benchmarks useful for tuning virtio ring layouts.
    Three layouts are currently implemented:

    - virtio 0.9 compatible one
    - an experimental extension bypassing the ring index, polling ring
    itself instead
    - an experimental extension bypassing avail and used ring completely

    Typical use:

    sh run-on-all.sh perf stat -r 10 --log-fd 1 -- ./ring

    It doesn't depend on the kernel directly, but it's handy
    to have as much virtio stuff as possible in one tree.

    Signed-off-by: Michael S. Tsirkin

    Michael S. Tsirkin
     
  • Fix build after API changes.

    Reported-by: Kamal Mostafa
    Signed-off-by: Michael S. Tsirkin

    Michael S. Tsirkin
     

07 Dec, 2015

2 commits


16 Sep, 2015

1 commit


10 Sep, 2015

1 commit


16 Dec, 2014

6 commits


09 Dec, 2014

2 commits

  • Change u32 to u64, and use BIT_ULL and 1ULL everywhere.

    Note: transports are unchanged, and only set low 32 bit.
    This guarantees that no transport sets e.g. VERSION_1
    by mistake without proper support.

    Based on patch by Rusty.

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

    Michael S. Tsirkin
     
  • It seemed like a good idea to use bitmap for features
    in struct virtio_device, but it's actually a pain,
    and seems to become even more painful when we get more
    than 32 feature bits. Just change it to a u32 for now.

    Based on patch by Rusty.

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

    Michael S. Tsirkin
     

02 May, 2014

2 commits

  • Combine all definitions into a common tools/include/linux/types.h and
    kill the wild growth elsewhere. Move DECLARE_BITMAP to its proper
    bitmap.h header.

    Signed-off-by: Borislav Petkov
    Acked-by: Rusty Russell
    Link: http://lkml.kernel.org/n/tip-azczs7qcv6h9xek9od10hiv2@git.kernel.org
    Signed-off-by: Jiri Olsa

    Borislav Petkov
     
  • So tools/ has been growing three, at a different stage of their
    development export.h headers and so we should unite into one. Add
    tools/include/ to the include path of virtio and liblockdep to pick the
    shared header now.

    Signed-off-by: Borislav Petkov
    Acked-by: Rusty Russell
    Cc: Arnaldo Carvalho de Melo
    Cc: Ingo Molnar
    Cc: Michael S. Tsirkin
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Sasha Levin
    Cc: virtio-dev@lists.oasis-open.org
    Cc: virtualization@lists.linux-foundation.org
    Link: http://lkml.kernel.org/r/1397493185-19521-2-git-send-email-bp@alien8.de
    Signed-off-by: Jiri Olsa

    Borislav Petkov
     

13 Mar, 2014

3 commits

  • Fixes the following build failure:

    cc -g -O2 -Wall -I. -I ../../usr/include/ -Wno-pointer-sign
    -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD
    -U_FORTIFY_SOURCE -c -o virtio_test.o virtio_test.c
    virtio_test.c: In function ‘run_test’:
    virtio_test.c:176:7: error: expected ‘)’ before ‘r’
    r = -1;
    ^

    Fixes: 53c18c9906441 (virtio_test: verify if virtqueue_kick() succeeded)
    Cc: Heinz Graalfs
    Signed-off-by: Joel Stanley
    Acked-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Joel Stanley
     
  • In commit bb478d8b167 virtio_ring: plug kmemleak false positive,
    kmemleak_ignore was introduced. This broke compilation of virtio_test:

    cc -g -O2 -Wall -I. -I ../../usr/include/ -Wno-pointer-sign
    -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD
    -U_FORTIFY_SOURCE -c -o virtio_ring.o ../../drivers/virtio/virtio_ring.c
    ../../drivers/virtio/virtio_ring.c: In function ‘vring_add_indirect’:
    ../../drivers/virtio/virtio_ring.c:177:2: warning: implicit declaration
    of function ‘kmemleak_ignore’ [-Wimplicit-function-declaration]
    kmemleak_ignore(desc);
    ^
    cc virtio_test.o virtio_ring.o -o virtio_test
    virtio_ring.o: In function `vring_add_indirect':
    tools/virtio/../../drivers/virtio/virtio_ring.c:177:
    undefined reference to `kmemleak_ignore'

    Add a dummy header for tools/virtio, and add #incldue
    to drivers/virtio/virtio_ring.c so it is picked up by the userspace
    tools.

    Signed-off-by: Joel Stanley
    Signed-off-by: Rusty Russell

    Joel Stanley
     
  • The virtio headers have changed recently:

    5b1bf7cb673 virtio_ring: let virtqueue_{kick()/notify()} return a bool
    46f9c2b925a virtio_ring: change host notification API

    Update the internal copies to fix the build of virtio_test:

    cc -g -O2 -Wall -I. -I ../../usr/include/ -Wno-pointer-sign
    -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE
    -c -o virtio_test.o virtio_test.c
    In file included from virtio_test.c:15:0:
    ./linux/virtio.h:76:19: error: conflicting types for ‘vring_new_virtqueue’
    struct virtqueue *vring_new_virtqueue(unsigned int index,
    ^
    In file included from ./linux/virtio_ring.h:1:0,
    from ../../usr/include/linux/vhost.h:17,
    from virtio_test.c:14:
    ./linux/../../../include/linux/virtio_ring.h:68:19: note: previous
    declaration of ‘vring_new_virtqueue’ was here
    struct virtqueue *vring_new_virtqueue(unsigned int index,
    virtio_test.c: In function ‘vq_info_add’:
    virtio_test.c:103:12: warning: passing argument 7 of ‘vring_new_virtqueue’
    from incompatible pointer type [enabled by default]
    vq_notify, vq_callback, "test");
    ^
    In file included from virtio_test.c:15:0:
    ./linux/virtio.h:76:19: note: expected ‘void (*)(struct virtqueue *)’ but
    argument is of type ‘_Bool (*)(struct virtqueue *)’
    struct virtqueue *vring_new_virtqueue(unsigned int index,
    ^

    Signed-off-by: Joel Stanley
    Signed-off-by: Rusty Russell

    Joel Stanley
     

29 Oct, 2013

2 commits

  • Verify if a host kick succeeded by checking return value of virtqueue_kick().

    Signed-off-by: Heinz Graalfs
    Signed-off-by: Rusty Russell

    Heinz Graalfs
     
  • Currently a host kick error is silently ignored and not reflected in
    the virtqueue of a particular virtio device.

    Changing the notify API for guest->host notification seems to be one
    prerequisite in order to be able to handle such errors in the context
    where the kick is triggered.

    This patch changes the notify API. The notify function must return a
    bool return value. It returns false if the host notification failed.

    Signed-off-by: Heinz Graalfs
    Signed-off-by: Rusty Russell

    Heinz Graalfs
     

15 Jul, 2013

1 commit


09 Jul, 2013

1 commit

  • This fixes build for the vringh test:
    [linux]$ make -C tools/virtio/
    make: Entering directory `/home/mst/scm/linux/tools/virtio'
    cc -g -O2 -Wall -I. -I ../../usr/include/ -Wno-pointer-sign
    -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD
    -U_FORTIFY_SOURCE -c -o vringh.o ../../drivers/vhost/vringh.c
    ../../drivers/vhost/vringh.c:1010:16: error: expected declaration
    specifiers or ‘...’ before string constant

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

    Michael S. Tsirkin
     

20 Mar, 2013

1 commit