1. 03 7月, 2019 8 次提交
    • M
      9p: Use a slab for allocating requests · 3ea4cf42
      Matthew Wilcox 提交于
      [ Upstream commit 996d5b4db4b191f2676cf8775565cab8a5e2753b ]
      
      Replace the custom batch allocation with a slab.  Use an IDR to store
      pointers to the active requests instead of an array.  We don't try to
      handle P9_NOTAG specially; the IDR will happily shrink all the way back
      once the TVERSION call has completed.
      
      Link: http://lkml.kernel.org/r/20180711210225.19730-6-willy@infradead.orgSigned-off-by: NMatthew Wilcox <willy@infradead.org>
      Cc: Eric Van Hensbergen <ericvh@gmail.com>
      Cc: Ron Minnich <rminnich@sandia.gov>
      Cc: Latchesar Ionkov <lucho@ionkov.net>
      Signed-off-by: NDominique Martinet <dominique.martinet@cea.fr>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      3ea4cf42
    • D
      9p/xen: fix check for xenbus_read error in front_probe · f8bc5f1a
      Dominique Martinet 提交于
      [ Upstream commit 2f9ad0ac947ccbe3ffe7c6229c9330f2a7755f64 ]
      
      If the xen bus exists but does not expose the proper interface, it is
      possible to get a non-zero length but still some error, leading to
      strcmp failing trying to load invalid memory addresses e.g.
      fffffffffffffffe.
      
      There is then no need to check length when there is no error, as the
      xenbus driver guarantees that the string is nul-terminated.
      
      Link: http://lkml.kernel.org/r/1534236007-10170-1-git-send-email-asmadeus@codewreck.orgSigned-off-by: NDominique Martinet <dominique.martinet@cea.fr>
      Reviewed-by: NStefano Stabellini <sstabellini@kernel.org>
      Cc: Eric Van Hensbergen <ericvh@gmail.com>
      Cc: Latchesar Ionkov <lucho@ionkov.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      f8bc5f1a
    • M
      IB/hfi1: Close PSM sdma_progress sleep window · a8782ce0
      Mike Marciniszyn 提交于
      commit da9de5f8527f4b9efc82f967d29a583318c034c7 upstream.
      
      The call to sdma_progress() is called outside the wait lock.
      
      In this case, there is a race condition where sdma_progress() can return
      false and the sdma_engine can idle.  If that happens, there will be no
      more sdma interrupts to cause the wakeup and the user_sdma xmit will hang.
      
      Fix by moving the lock to enclose the sdma_progress() call.
      
      Also, delete busycount. The need for this was removed by:
      commit bcad2913 ("IB/hfi1: Serve the most starved iowait entry first")
      
      Ported to linux-4.19.y.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 77241056 ("IB/hfi1: add driver files")
      Reviewed-by: NGary Leshner <Gary.S.Leshner@intel.com>
      Signed-off-by: NMike Marciniszyn <mike.marciniszyn@intel.com>
      Signed-off-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      a8782ce0
    • S
      Revert "x86/uaccess, ftrace: Fix ftrace_likely_update() vs. SMAP" · fec1a13b
      Sasha Levin 提交于
      This reverts commit 1a3188d7, which was
      upstream commit 4a6c91fbdef846ec7250b82f2eeeb87ac5f18cf9.
      
      On Tue, Jun 25, 2019 at 09:39:45AM +0200, Sebastian Andrzej Siewior wrote:
      >Please backport commit e74deb11931ff682b59d5b9d387f7115f689698e to
      >stable _or_ revert the backport of commit 4a6c91fbdef84 ("x86/uaccess,
      >ftrace: Fix ftrace_likely_update() vs. SMAP"). It uses
      >user_access_{save|restore}() which has been introduced in the following
      >commit.
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      fec1a13b
    • N
      arm64: Don't unconditionally add -Wno-psabi to KBUILD_CFLAGS · 85a3b1ef
      Nathan Chancellor 提交于
      commit fa63da2ab046b885a7f70291aafc4e8ce015429b upstream.
      
      This is a GCC only option, which warns about ABI changes within GCC, so
      unconditionally adding it breaks Clang with tons of:
      
      warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
      
      and link time failures:
      
      ld.lld: error: undefined symbol: __efistub___stack_chk_guard
      >>> referenced by arm-stub.c:73
      (/home/nathan/cbl/linux/drivers/firmware/efi/libstub/arm-stub.c:73)
      >>>               arm-stub.stub.o:(__efistub_install_memreserve_table)
      in archive ./drivers/firmware/efi/libstub/lib.a
      
      These failures come from the lack of -fno-stack-protector, which is
      added via cc-option in drivers/firmware/efi/libstub/Makefile. When an
      unknown flag is added to KBUILD_CFLAGS, clang will noisily warn that it
      is ignoring the option like above, unlike gcc, who will just error.
      
      $ echo "int main() { return 0; }" > tmp.c
      
      $ clang -Wno-psabi tmp.c; echo $?
      warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option]
      1 warning generated.
      0
      
      $ gcc -Wsometimes-uninitialized tmp.c; echo $?
      gcc: error: unrecognized command line option
      ‘-Wsometimes-uninitialized’; did you mean ‘-Wmaybe-uninitialized’?
      1
      
      For cc-option to work properly with clang and behave like gcc, -Werror
      is needed, which was done in commit c3f0d0bc ("kbuild, LLVMLinux:
      Add -Werror to cc-option to support clang").
      
      $ clang -Werror -Wno-psabi tmp.c; echo $?
      error: unknown warning option '-Wno-psabi'
      [-Werror,-Wunknown-warning-option]
      1
      
      As a consequence of this, when an unknown flag is unconditionally added
      to KBUILD_CFLAGS, it will cause cc-option to always fail and those flags
      will never get added:
      
      $ clang -Werror -Wno-psabi -fno-stack-protector tmp.c; echo $?
      error: unknown warning option '-Wno-psabi'
      [-Werror,-Wunknown-warning-option]
      1
      
      This can be seen when compiling the whole kernel as some warnings that
      are normally disabled (see below) show up. The full list of flags
      missing from drivers/firmware/efi/libstub are the following (gathered
      from diffing .arm64-stub.o.cmd):
      
      -fno-delete-null-pointer-checks
      -Wno-address-of-packed-member
      -Wframe-larger-than=2048
      -Wno-unused-const-variable
      -fno-strict-overflow
      -fno-merge-all-constants
      -fno-stack-check
      -Werror=date-time
      -Werror=incompatible-pointer-types
      -ffreestanding
      -fno-stack-protector
      
      Use cc-disable-warning so that it gets disabled for GCC and does nothing
      for Clang.
      
      Fixes: ebcc5928c5d9 ("arm64: Silence gcc warnings about arch ABI drift")
      Link: https://github.com/ClangBuiltLinux/linux/issues/511Reported-by: NQian Cai <cai@lca.pw>
      Acked-by: NDave Martin <Dave.Martin@arm.com>
      Reviewed-by: NNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: NNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      85a3b1ef
    • A
      perf header: Fix unchecked usage of strncpy() · 6461a454
      Arnaldo Carvalho de Melo 提交于
      commit 5192bde7d98c99f2cd80225649e3c2e7493722f7 upstream.
      
      The strncpy() function may leave the destination string buffer
      unterminated, better use strlcpy() that we have a __weak fallback
      implementation for systems without it.
      
      This fixes this warning on an Alpine Linux Edge system with gcc 8.2:
      
        util/header.c: In function 'perf_event__synthesize_event_update_name':
        util/header.c:3625:2: error: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
          strncpy(ev->data, evsel->name, len);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        util/header.c:3618:15: note: length computed here
          size_t len = strlen(evsel->name);
                       ^~~~~~~~~~~~~~~~~~~
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Fixes: a6e52817 ("perf tools: Add event_update event unit type")
      Link: https://lkml.kernel.org/n/tip-wycz66iy8dl2z3yifgqf894p@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6461a454
    • A
      perf help: Remove needless use of strncpy() · 0bf5d53b
      Arnaldo Carvalho de Melo 提交于
      commit b6313899f4ed2e76b8375cf8069556f5b94fbff0 upstream.
      
      Since we make sure the destination buffer has at least strlen(orig) + 1,
      no need to do a strncpy(dest, orig, strlen(orig)), just use strcpy(dest,
      orig).
      
      This silences this gcc 8.2 warning on Alpine Linux:
      
        In function 'add_man_viewer',
            inlined from 'perf_help_config' at builtin-help.c:284:3:
        builtin-help.c:192:2: error: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
          strncpy((*p)->name, name, len);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        builtin-help.c: In function 'perf_help_config':
        builtin-help.c:187:15: note: length computed here
          size_t len = strlen(name);
                       ^~~~~~~~~~~~
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Fixes: 07800601 ("perf_counter tools: add in basic glue from Git")
      Link: https://lkml.kernel.org/n/tip-2f69l7drca427ob4km8i7kvo@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0bf5d53b
    • A
      perf ui helpline: Use strlcpy() as a shorter form of strncpy() + explicit set nul · 6e75d927
      Arnaldo Carvalho de Melo 提交于
      commit 4d0f16d059ddb91424480d88473f7392f24aebdc upstream.
      
      The strncpy() function may leave the destination string buffer
      unterminated, better use strlcpy() that we have a __weak fallback
      implementation for systems without it.
      
      In this case we are actually setting the null byte at the right place,
      but since we pass the buffer size as the limit to strncpy() and not
      it minus one, gcc ends up warning us about that, see below. So, lets
      just switch to the shorter form provided by strlcpy().
      
      This fixes this warning on an Alpine Linux Edge system with gcc 8.2:
      
        ui/tui/helpline.c: In function 'tui_helpline__push':
        ui/tui/helpline.c:27:2: error: 'strncpy' specified bound 512 equals destination size [-Werror=stringop-truncation]
          strncpy(ui_helpline__current, msg, sz)[sz - 1] = '\0';
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        cc1: all warnings being treated as errors
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Fixes: e6e90468 ("perf ui: Introduce struct ui_helpline")
      Link: https://lkml.kernel.org/n/tip-d1wz0hjjsh19xbalw69qpytj@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6e75d927
  2. 25 6月, 2019 32 次提交