29 Apr, 2020

1 commit

  • commit bdebd6a2831b6fab69eb85cee74a8ba77f1a1cc2 upstream.

    remap_vmalloc_range() has had various issues with the bounds checks it
    promises to perform ("This function checks that addr is a valid
    vmalloc'ed area, and that it is big enough to cover the vma") over time,
    e.g.:

    - not detecting pgoff<<<<
    Signed-off-by: Andrew Morton
    Cc: stable@vger.kernel.org
    Cc: Alexei Starovoitov
    Cc: Daniel Borkmann
    Cc: Martin KaFai Lau
    Cc: Song Liu
    Cc: Yonghong Song
    Cc: Andrii Nakryiko
    Cc: John Fastabend
    Cc: KP Singh
    Link: http://lkml.kernel.org/r/20200415222312.236431-1-jannh@google.com
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Jann Horn
     

20 Aug, 2019

1 commit

  • While generating interrupt, mdev_state is already available for which
    interrupt is generated.
    Instead of doing indirect way from state->device->uuid-> to searching
    state linearly in linked list on every interrupt generation,
    directly use the available state.

    Hence, simplify the code to use mdev_state and remove unused helper
    function with that.

    Reviewed-by: Cornelia Huck
    Signed-off-by: Parav Pandit
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Alex Williamson

    Parav Pandit
     

25 Jul, 2019

1 commit

  • The "WITH Linux-syscall-note" exception exists for headers exported to
    user space. It is strange to add it to non-exported headers.

    Commit 687a3e4d8e61 ("treewide: remove SPDX "WITH Linux-syscall-note"
    from kernel-space headers") did cleanups some months ago, but it looks
    like we need to do this periodically.

    This patch was generated by the following script:

    git grep -l -e Linux-syscall-note \
    -- :*.h :^arch/*/include/uapi/asm/*.h :^include/uapi/ :^tools |
    while read file
    do
    sed -i -e 's/(\(GPL-[^[:space:]]*\) WITH Linux-syscall-note)/\1/g' \
    -e 's/ WITH Linux-syscall-note//g' $file
    done

    I did not commit drivers/staging/android/uapi/ion.h . This header is
    not currently exported, but somebody may plan to move it to include/uapi/
    when the time comes. I am not sure. Anyway, it will be better to check
    the license inconsistency in drivers/staging/android/uapi/.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Masahiro Yamada
     

03 Jul, 2019

2 commits

  • Fixes gcc '-Wunused-but-set-variable' warning:

    samples/vfio-mdev/mbochs.c: In function mbochs_ioctl:
    samples/vfio-mdev/mbochs.c:1188:21: warning: variable mdev_state set but not used [-Wunused-but-set-variable]

    It's not used any more since commit 104c7405a64d ("vfio:
    add edid support to mbochs sample driver")

    Signed-off-by: YueHaibing
    Signed-off-by: Alex Williamson

    YueHaibing
     
  • Make some structs and functions static to fix build warning, parts of
    warning shown below,

    samples/vfio-mdev/mtty.c:730:5: warning: symbol 'mtty_create' was not declared. Should it be static?
    samples/vfio-mdev/mtty.c:780:5: warning: symbol 'mtty_remove' was not declared. Should it be static?
    samples/vfio-mdev/mtty.c:802:5: warning: symbol 'mtty_reset' was not declared. Should it be static?
    samples/vfio-mdev/mtty.c:818:9: warning: symbol 'mtty_read' was not declared. Should it be static?
    samples/vfio-mdev/mtty.c:877:9: warning: symbol 'mtty_write' was not declared. Should it be static?
    samples/vfio-mdev/mtty.c:1070:5: warning: symbol 'mtty_get_region_info' was not declared. Should it be static?
    samples/vfio-mdev/mtty.c:1119:5: warning: symbol 'mtty_get_irq_info' was not declared. Should it be static?
    samples/vfio-mdev/mtty.c:1143:5: warning: symbol 'mtty_get_device_info' was not declared. Should it be static?
    samples/vfio-mdev/mtty.c:1275:5: warning: symbol 'mtty_open' was not declared. Should it be static?
    samples/vfio-mdev/mtty.c:1281:6: warning: symbol 'mtty_close' was not declared. Should it be static?
    samples/vfio-mdev/mtty.c:1305:30: warning: symbol 'mtty_dev_groups' was not declared. Should it be static?

    Cc: Andy Shevchenko
    Cc: Alex Williamson
    Cc: Kirti Wankhede
    Reported-by: Hulk Robot
    Signed-off-by: Kefeng Wang
    Reviewed-by: Andy Shevchenko
    [aw: wrap long lines]
    Signed-off-by: Alex Williamson

    Kefeng Wang
     

19 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 May, 2019

1 commit


13 Feb, 2019

3 commits


06 Feb, 2019

1 commit

  • There are new types and helpers that are supposed to be used in new code.

    As a preparation to get rid of legacy types and API functions do
    the conversion here.

    Cc: Kirti Wankhede
    Cc: Alex Williamson
    Signed-off-by: Andy Shevchenko
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Alex Williamson

    Andy Shevchenko
     

18 Dec, 2018

1 commit

  • Clang warns:

    samples/vfio-mdev/mtty.c:592:39: warning: implicit conversion from 'int'
    to 'char' changes value from 162 to -94 [-Wconstant-conversion]
    *buf = UART_MSR_DSR | UART_MSR_DDSR | UART_MSR_DCD;
    ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
    1 warning generated.

    Turns out that all uses of buf in this function ultimately end up stored
    or cast to an unsigned type. Just use u8, which has the same number of
    bits but can store this larger number so Clang no longer warns.

    Signed-off-by: Nathan Chancellor
    Signed-off-by: Alex Williamson

    Nathan Chancellor
     

12 Oct, 2018

1 commit


12 Jul, 2018

1 commit


05 Jul, 2018

1 commit


26 Jun, 2018

2 commits


09 Jun, 2018

3 commits


23 Mar, 2018

1 commit

  • When FIFO mode is enabled, the receive data available interrupt
    (UART_IIR_RDI in code) should be triggered when the number of data
    in FIFO is equal or larger than interrupt trigger level.

    This patch changes the trigger level check to ensure multiple bytes
    received from upper layer can trigger RDI interrupt correctly.

    Cc: Joey Zheng
    Signed-off-by: Shunyong Yang
    Reviewed by: Kirti Wankhede
    Signed-off-by: Alex Williamson

    Shunyong Yang
     

03 Oct, 2017

1 commit


12 Jan, 2017

3 commits

  • We set info.count to 1 in mtty_get_irq_info() so static checkers
    complain that, "Why do we have impossible conditions?" The answer is
    that it seems to be left over dead code that can be safely removed.

    Signed-off-by: Dan Carpenter
    Reviewed-by: Kirti Wankhede
    Signed-off-by: Alex Williamson

    Dan Carpenter
     
  • This is a sample driver for documentation so the impact is probably
    pretty low. But we should check that bar_index is valid so we
    don't write beyond the end of the mdev_state->region_info[] array.

    Fixes: 9d1a546c53b4 ("docs: Sample driver to demonstrate how to use Mediated device framework.")
    Signed-off-by: Dan Carpenter
    Reviewed-by: Kirti Wankhede
    Signed-off-by: Alex Williamson

    Dan Carpenter
     
  • The copy_to_user() function returns the number of bytes which it wasn't
    able to copy but we want to return a negative error code.

    Fixes: 9d1a546c53b4 ("docs: Sample driver to demonstrate how to use Mediated device framework.")
    Signed-off-by: Dan Carpenter
    Reviewed-by: Kirti Wankhede
    Signed-off-by: Alex Williamson

    Dan Carpenter
     

04 Jan, 2017

1 commit


30 Dec, 2016

4 commits


18 Nov, 2016

1 commit