15 Sep, 2020

1 commit


22 Jul, 2020

1 commit

  • According to the VirtIO 1.0 spec data, sent over virtual queues must
    be in little-endian format. Update the RPMsg VirtIO implementation
    to enforce that but let legacy configurations continue use native
    endianness.

    Acked-by: Michael S. Tsirkin
    Signed-off-by: Guennadi Liakhovetski
    Reviewed-by: Mathieu Poirier
    Tested-by: Arnaud Pouliquen
    Link: https://lore.kernel.org/r/20200721085638.GA3815@ubuntu
    Signed-off-by: Bjorn Andersson

    Guennadi Liakhovetski
     

13 May, 2020

1 commit

  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertently introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    sizeof(flexible-array-member) triggers a warning because flexible array
    members have incomplete type[1]. There are some instances of code in
    which the sizeof operator is being incorrectly/erroneously applied to
    zero-length arrays and the result is zero. Such instances may be hiding
    some bugs. So, this work (flexible-array member conversions) will also
    help to get completely rid of those sorts of issues.

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Link: https://lore.kernel.org/r/20200507191948.GA16053@embeddedor
    Signed-off-by: Bjorn Andersson

    Gustavo A. R. Silva
     

28 Aug, 2019

1 commit

  • The virtio_rpmsg_bus driver uses the "%p" format-specifier for
    printing the vring buffer address. This prints only a hashed
    pointer even for previliged users. Use "%pK" instead so that
    the address can be printed during debug using kptr_restrict
    sysctl.

    Signed-off-by: Suman Anna
    Signed-off-by: Bjorn Andersson

    Suman Anna
     

21 Feb, 2019

2 commits


04 Jun, 2018

1 commit


25 Aug, 2017

2 commits


27 Jul, 2017

1 commit


26 Jun, 2017

3 commits


18 May, 2017

1 commit


03 May, 2017

1 commit


28 Feb, 2017

1 commit

  • Add a struct irq_affinity pointer to the find_vqs methods, which if set
    is used to tell the PCI layer to create the MSI-X vectors for our I/O
    virtqueues with the proper affinity from the start. Compared to after
    the fact affinity hints this gives us an instantly working setup and
    allows to allocate the irq descritors node-local and avoid interconnect
    traffic. Last but not least this will allow blk-mq queues are created
    based on the interrupt affinity for storage drivers.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Jason Wang
    Signed-off-by: Michael S. Tsirkin

    Christoph Hellwig
     

09 Sep, 2016

15 commits


13 Aug, 2016

5 commits

  • There are couple of print_hex_dump traces used in rpmsg code which
    prints the actual byte messages being transferred between host and
    the remote processors. These traces are quiet verbose and affects
    performance, if the appropriate trace level is enabled. These hex
    dumps are needed rather rarely, but are quite useful when debugging
    complex IPC corner cases. So, this patch switches these hex dump
    traces to use the dynamic_hex_dump() API.

    The hex dump traces are also enabled only when CONFIG_DYNAMIC_DEBUG
    is enabled. This switch allows flexibility of controlling these
    traces through dynamic debug, instead of removing them completely.

    Signed-off-by: Suman Anna
    Signed-off-by: Bjorn Andersson

    Anna, Suman
     
  • This patch fixes most of the existing alignment checkpatch check
    warnings of the type "Alignment should match open parenthesis"
    in the virtio rpmsg bus code. A couple of them have been left as
    is to not exceed the 80-char limit.

    Signed-off-by: Suman Anna
    Signed-off-by: Bjorn Andersson

    Anna, Suman
     
  • The dma_addr_t types can be printed properly using the %pad
    printk format-specifier, there is no need to resort to the
    unsigned long long type-casting to deal with different possible
    type sizes.

    Signed-off-by: Suman Anna
    Signed-off-by: Bjorn Andersson

    Anna, Suman
     
  • These types of error prints are superfluous. The system will
    pick up on OOM issues and let the user know. While at this,
    fix the usage of using a structure instead of the actual
    variable in one of the allocations.

    Signed-off-by: Suman Anna
    Signed-off-by: Bjorn Andersson

    Anna, Suman
     
  • It should never have been there in the first place.

    Signed-off-by: Lee Jones
    Signed-off-by: Bjorn Andersson

    Lee Jones
     

11 Aug, 2016

1 commit


07 May, 2016

1 commit


13 Jan, 2016

1 commit

  • checkpatch.pl wants arrays of strings declared as follows:

    static const char * const names[] = { "vq-1", "vq-2", "vq-3" };

    Currently the find_vqs() function takes a const char *names[] argument
    so passing checkpatch.pl's const char * const names[] results in a
    compiler error due to losing the second const.

    This patch adjusts the find_vqs() prototype and updates all virtio
    transports. This makes it possible for virtio_balloon.c, virtio_input.c,
    virtgpu_kms.c, and virtio_rpmsg_bus.c to use the checkpatch.pl-friendly
    type.

    Signed-off-by: Stefan Hajnoczi
    Signed-off-by: Michael S. Tsirkin
    Acked-by: Bjorn Andersson

    Stefan Hajnoczi
     

13 Mar, 2015

1 commit

  • virtio spec requires that all drivers set DRIVER_OK
    before using devices. While rpmsg isn't yet
    included in the virtio 1 spec, previous spec versions
    also required this.

    virtio rpmsg violates this rule: is calls kick
    before setting DRIVER_OK.

    The fix isn't trivial since simply calling virtio_device_ready earlier
    would mean we might get an interrupt in parallel with adding buffers.

    Instead, split kick out to prepare+notify calls. prepare before
    virtio_device_ready - when we know we won't get interrupts. notify right
    afterwards.

    Signed-off-by: Michael S. Tsirkin
    Acked-by: Ohad Ben-Cohen
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin