1. 18 May, 2019 7 commits
    • Feng Tang's avatar
      panic: add an option to replay all the printk message in buffer · de6da1e8
      Feng Tang authored
      Currently on panic, kernel will lower the loglevel and print out pending
      printk msg only with console_flush_on_panic().
      
      Add an option for users to configure the "panic_print" to replay all
      dmesg in buffer, some of which they may have never seen due to the
      loglevel setting, which will help panic debugging .
      
      [feng.tang@intel.com: keep the original console_flush_on_panic() inside panic()]
        Link: http://lkml.kernel.org/r/1556199137-14163-1-git-send-email-feng.tang@intel.com
      [feng.tang@intel.com: use logbuf lock to protect the console log index]
        Link: http://lkml.kernel.org/r/1556269868-22654-1-git-send-email-feng.tang@intel.com
      Link: http://lkml.kernel.org/r/1556095872-36838-1-git-send-email-feng.tang@intel.comSigned-off-by: default avatarFeng Tang <feng.tang@intel.com>
      Reviewed-by: default avatarPetr Mladek <pmladek@suse.com>
      Cc: Aaro Koskinen <aaro.koskinen@nokia.com>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Borislav Petkov <bp@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      de6da1e8
    • Steven Price's avatar
      initramfs: don't free a non-existent initrd · 5d59aa8f
      Steven Price authored
      Since commit 54c7a891 ("initramfs: free initrd memory if opening
      /initrd.image fails"), the kernel has unconditionally attempted to free
      the initrd even if it doesn't exist.
      
      In the non-existent case this causes a boot-time splat if
      CONFIG_DEBUG_VIRTUAL is enabled due to a call to virt_to_phys() with a
      NULL address.
      
      Instead we should check that the initrd actually exists and only attempt
      to free it if it does.
      
      Link: http://lkml.kernel.org/r/20190516143125.48948-1-steven.price@arm.com
      Fixes: 54c7a891 ("initramfs: free initrd memory if opening /initrd.image fails")
      Signed-off-by: default avatarSteven Price <steven.price@arm.com>
      Reported-by: default avatarMark Rutland <mark.rutland@arm.com>
      Tested-by: default avatarMark Rutland <mark.rutland@arm.com>
      Reviewed-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5d59aa8f
    • Jiufei Xue's avatar
      fs/writeback.c: use rcu_barrier() to wait for inflight wb switches going into workqueue when umount · ec084de9
      Jiufei Xue authored
      synchronize_rcu() didn't wait for call_rcu() callbacks, so inode wb
      switch may not go to the workqueue after synchronize_rcu().  Thus
      previous scheduled switches was not finished even flushing the
      workqueue, which will cause a NULL pointer dereferenced followed below.
      
        VFS: Busy inodes after unmount of vdd. Self-destruct in 5 seconds.  Have a nice day...
        BUG: unable to handle kernel NULL pointer dereference at 0000000000000278
          evict+0xb3/0x180
          iput+0x1b0/0x230
          inode_switch_wbs_work_fn+0x3c0/0x6a0
          worker_thread+0x4e/0x490
          ? process_one_work+0x410/0x410
          kthread+0xe6/0x100
          ret_from_fork+0x39/0x50
      
      Replace the synchronize_rcu() call with a rcu_barrier() to wait for all
      pending callbacks to finish.  And inc isw_nr_in_flight after call_rcu()
      in inode_switch_wbs() to make more sense.
      
      Link: http://lkml.kernel.org/r/20190429024108.54150-1-jiufei.xue@linux.alibaba.comSigned-off-by: default avatarJiufei Xue <jiufei.xue@linux.alibaba.com>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Suggested-by: default avatarTejun Heo <tj@kernel.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ec084de9
    • Mel Gorman's avatar
      mm/compaction.c: correct zone boundary handling when isolating pages from a pageblock · 60fce36a
      Mel Gorman authored
      syzbot reported the following error from a tree with a head commit of
      baf76f0c ("slip: make slhc_free() silently accept an error pointer")
      
        BUG: unable to handle kernel paging request at ffffea0003348000
        #PF error: [normal kernel read fault]
        PGD 12c3f9067 P4D 12c3f9067 PUD 12c3f8067 PMD 0
        Oops: 0000 [#1] PREEMPT SMP KASAN
        CPU: 1 PID: 28916 Comm: syz-executor.2 Not tainted 5.1.0-rc6+ #89
        Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
        RIP: 0010:constant_test_bit arch/x86/include/asm/bitops.h:314 [inline]
        RIP: 0010:PageCompound include/linux/page-flags.h:186 [inline]
        RIP: 0010:isolate_freepages_block+0x1c0/0xd40 mm/compaction.c:579
        Code: 01 d8 ff 4d 85 ed 0f 84 ef 07 00 00 e8 29 00 d8 ff 4c 89 e0 83 85 38 ff
        ff ff 01 48 c1 e8 03 42 80 3c 38 00 0f 85 31 0a 00 00 <4d> 8b 2c 24 31 ff 49
        c1 ed 10 41 83 e5 01 44 89 ee e8 3a 01 d8 ff
        RSP: 0018:ffff88802b31eab8 EFLAGS: 00010246
        RAX: 1ffffd4000669000 RBX: 00000000000cd200 RCX: ffffc9000a235000
        RDX: 000000000001ca5e RSI: ffffffff81988cc7 RDI: 0000000000000001
        RBP: ffff88802b31ebd8 R08: ffff88805af700c0 R09: 0000000000000000
        R10: 0000000000000000 R11: 0000000000000000 R12: ffffea0003348000
        R13: 0000000000000000 R14: ffff88802b31f030 R15: dffffc0000000000
        FS:  00007f61648dc700(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        CR2: ffffea0003348000 CR3: 0000000037c64000 CR4: 00000000001426e0
        Call Trace:
         fast_isolate_around mm/compaction.c:1243 [inline]
         fast_isolate_freepages mm/compaction.c:1418 [inline]
         isolate_freepages mm/compaction.c:1438 [inline]
         compaction_alloc+0x1aee/0x22e0 mm/compaction.c:1550
      
      There is no reproducer and it is difficult to hit -- 1 crash every few
      days.  The issue is very similar to the fix in commit 6b0868c8
      ("mm/compaction.c: correct zone boundary handling when resetting pageblock
      skip hints").  When isolating free pages around a target pageblock, the
      boundary handling is off by one and can stray into the next pageblock.
      Triggering the syzbot error requires that the end of pageblock is section
      or zone aligned, and that the next section is unpopulated.
      
      A more subtle consequence of the bug is that pageblocks were being
      improperly used as migration targets which potentially hurts fragmentation
      avoidance in the long-term one page at a time.
      
      A debugging patch revealed that it's definitely possible to stray outside
      of a pageblock which is not intended.  While syzbot cannot be used to
      verify this patch, it was confirmed that the debugging warning no longer
      triggers with this patch applied.  It has also been confirmed that the THP
      allocation stress tests are not degraded by this patch.
      
      Link: http://lkml.kernel.org/r/20190510182124.GI18914@techsingularity.net
      Fixes: e332f741 ("mm, compaction: be selective about what pageblocks to clear skip hints")
      Signed-off-by: default avatarMel Gorman <mgorman@techsingularity.net>
      Reported-by: syzbot+d84c80f9fe26a0f7a734@syzkaller.appspotmail.com
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: Qian Cai <cai@lca.pw>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: <stable@vger.kernel.org> # v5.1+
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      60fce36a
    • Uladzislau Rezki (Sony)'s avatar
      mm/vmap: add DEBUG_AUGMENT_LOWEST_MATCH_CHECK macro · a6cf4e0f
      Uladzislau Rezki (Sony) authored
      This macro adds some debug code to check that vmap allocations are
      happened in ascending order.
      
      By default this option is set to 0 and not active.  It requires
      recompilation of the kernel to activate it.  Set to 1, compile the
      kernel.
      
      [urezki@gmail.com: v4]
        Link: http://lkml.kernel.org/r/20190406183508.25273-4-urezki@gmail.com
      Link: http://lkml.kernel.org/r/20190402162531.10888-4-urezki@gmail.comSigned-off-by: default avatarUladzislau Rezki (Sony) <urezki@gmail.com>
      Reviewed-by: default avatarRoman Gushchin <guro@fb.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Joel Fernandes <joelaf@google.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Oleksiy Avramchenko <oleksiy.avramchenko@sonymobile.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Thomas Garnier <thgarnie@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a6cf4e0f
    • Uladzislau Rezki (Sony)'s avatar
      mm/vmap: add DEBUG_AUGMENT_PROPAGATE_CHECK macro · bb850f4d
      Uladzislau Rezki (Sony) authored
      This macro adds some debug code to check that the augment tree is
      maintained correctly, meaning that every node contains valid
      subtree_max_size value.
      
      By default this option is set to 0 and not active.  It requires
      recompilation of the kernel to activate it.  Set to 1, compile the
      kernel.
      
      [urezki@gmail.com: v4]
        Link: http://lkml.kernel.org/r/20190406183508.25273-3-urezki@gmail.com
      Link: http://lkml.kernel.org/r/20190402162531.10888-3-urezki@gmail.comSigned-off-by: default avatarUladzislau Rezki (Sony) <urezki@gmail.com>
      Reviewed-by: default avatarRoman Gushchin <guro@fb.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Joel Fernandes <joelaf@google.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Oleksiy Avramchenko <oleksiy.avramchenko@sonymobile.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Thomas Garnier <thgarnie@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      bb850f4d
    • Uladzislau Rezki (Sony)'s avatar
      mm/vmalloc.c: keep track of free blocks for vmap allocation · 68ad4a33
      Uladzislau Rezki (Sony) authored
      Patch series "improve vmap allocation", v3.
      
      Objective
      ---------
      
      Please have a look for the description at:
      
        https://lkml.org/lkml/2018/10/19/786
      
      but let me also summarize it a bit here as well.
      
      The current implementation has O(N) complexity. Requests with different
      permissive parameters can lead to long allocation time. When i say
      "long" i mean milliseconds.
      
      Description
      -----------
      
      This approach organizes the KVA memory layout into free areas of the
      1-ULONG_MAX range, i.e.  an allocation is done over free areas lookups,
      instead of finding a hole between two busy blocks.  It allows to have
      lower number of objects which represent the free space, therefore to have
      less fragmented memory allocator.  Because free blocks are always as large
      as possible.
      
      It uses the augment tree where all free areas are sorted in ascending
      order of va->va_start address in pair with linked list that provides
      O(1) access to prev/next elements.
      
      Since the tree is augment, we also maintain the "subtree_max_size" of VA
      that reflects a maximum available free block in its left or right
      sub-tree.  Knowing that, we can easily traversal toward the lowest (left
      most path) free area.
      
      Allocation: ~O(log(N)) complexity.  It is sequential allocation method
      therefore tends to maximize locality.  The search is done until a first
      suitable block is large enough to encompass the requested parameters.
      Bigger areas are split.
      
      I copy paste here the description of how the area is split, since i
      described it in https://lkml.org/lkml/2018/10/19/786
      
      <snip>
      
      A free block can be split by three different ways.  Their names are
      FL_FIT_TYPE, LE_FIT_TYPE/RE_FIT_TYPE and NE_FIT_TYPE, i.e.  they
      correspond to how requested size and alignment fit to a free block.
      
      FL_FIT_TYPE - in this case a free block is just removed from the free
      list/tree because it fully fits.  Comparing with current design there is
      an extra work with rb-tree updating.
      
      LE_FIT_TYPE/RE_FIT_TYPE - left/right edges fit.  In this case what we do
      is just cutting a free block.  It is as fast as a current design.  Most of
      the vmalloc allocations just end up with this case, because the edge is
      always aligned to 1.
      
      NE_FIT_TYPE - Is much less common case.  Basically it happens when
      requested size and alignment does not fit left nor right edges, i.e.  it
      is between them.  In this case during splitting we have to build a
      remaining left free area and place it back to the free list/tree.
      
      Comparing with current design there are two extra steps.  First one is we
      have to allocate a new vmap_area structure.  Second one we have to insert
      that remaining free block to the address sorted list/tree.
      
      In order to optimize a first case there is a cache with free_vmap objects.
      Instead of allocating from slab we just take an object from the cache and
      reuse it.
      
      Second one is pretty optimized.  Since we know a start point in the tree
      we do not do a search from the top.  Instead a traversal begins from a
      rb-tree node we split.
      <snip>
      
      De-allocation.  ~O(log(N)) complexity.  An area is not inserted straight
      away to the tree/list, instead we identify the spot first, checking if it
      can be merged around neighbors.  The list provides O(1) access to
      prev/next, so it is pretty fast to check it.  Summarizing.  If merged then
      large coalesced areas are created, if not the area is just linked making
      more fragments.
      
      There is one more thing that i should mention here.  After modification of
      VA node, its subtree_max_size is updated if it was/is the biggest area in
      its left or right sub-tree.  Apart of that it can also be populated back
      to upper levels to fix the tree.  For more details please have a look at
      the __augment_tree_propagate_from() function and the description.
      
      Tests and stressing
      -------------------
      
      I use the "test_vmalloc.sh" test driver available under
      "tools/testing/selftests/vm/" since 5.1-rc1 kernel.  Just trigger "sudo
      ./test_vmalloc.sh" to find out how to deal with it.
      
      Tested on different platforms including x86_64/i686/ARM64/x86_64_NUMA.
      Regarding last one, i do not have any physical access to NUMA system,
      therefore i emulated it.  The time of stressing is days.
      
      If you run the test driver in "stress mode", you also need the patch that
      is in Andrew's tree but not in Linux 5.1-rc1.  So, please apply it:
      
      http://git.cmpxchg.org/cgit.cgi/linux-mmotm.git/commit/?id=e0cf7749bade6da318e98e934a24d8b62fab512c
      
      After massive testing, i have not identified any problems like memory
      leaks, crashes or kernel panics.  I find it stable, but more testing would
      be good.
      
      Performance analysis
      --------------------
      
      I have used two systems to test.  One is i5-3320M CPU @ 2.60GHz and
      another is HiKey960(arm64) board.  i5-3320M runs on 4.20 kernel, whereas
      Hikey960 uses 4.15 kernel.  I have both system which could run on 5.1-rc1
      as well, but the results have not been ready by time i an writing this.
      
      Currently it consist of 8 tests.  There are three of them which correspond
      to different types of splitting(to compare with default).  We have 3
      ones(see above).  Another 5 do allocations in different conditions.
      
      a) sudo ./test_vmalloc.sh performance
      
      When the test driver is run in "performance" mode, it runs all available
      tests pinned to first online CPU with sequential execution test order.  We
      do it in order to get stable and repeatable results.  Take a look at time
      difference in "long_busy_list_alloc_test".  It is not surprising because
      the worst case is O(N).
      
      # i5-3320M
      How many cycles all tests took:
      CPU0=646919905370(default) cycles vs CPU0=193290498550(patched) cycles
      
      # See detailed table with results here:
      ftp://vps418301.ovh.net/incoming/vmap_test_results_v2/i5-3320M_performance_default.txt
      ftp://vps418301.ovh.net/incoming/vmap_test_results_v2/i5-3320M_performance_patched.txt
      
      # Hikey960 8x CPUs
      How many cycles all tests took:
      CPU0=3478683207 cycles vs CPU0=463767978 cycles
      
      # See detailed table with results here:
      ftp://vps418301.ovh.net/incoming/vmap_test_results_v2/HiKey960_performance_default.txt
      ftp://vps418301.ovh.net/incoming/vmap_test_results_v2/HiKey960_performance_patched.txt
      
      b) time sudo ./test_vmalloc.sh test_repeat_count=1
      
      With this configuration, all tests are run on all available online CPUs.
      Before running each CPU shuffles its tests execution order.  It gives
      random allocation behaviour.  So it is rough comparison, but it puts in
      the picture for sure.
      
      # i5-3320M
      <default>            vs            <patched>
      real    101m22.813s                real    0m56.805s
      user    0m0.011s                   user    0m0.015s
      sys     0m5.076s                   sys     0m0.023s
      
      # See detailed table with results here:
      ftp://vps418301.ovh.net/incoming/vmap_test_results_v2/i5-3320M_test_repeat_count_1_default.txt
      ftp://vps418301.ovh.net/incoming/vmap_test_results_v2/i5-3320M_test_repeat_count_1_patched.txt
      
      # Hikey960 8x CPUs
      <default>            vs            <patched>
      real    unknown                    real    4m25.214s
      user    unknown                    user    0m0.011s
      sys     unknown                    sys     0m0.670s
      
      I did not manage to complete this test on "default Hikey960" kernel
      version.  After 24 hours it was still running, therefore i had to cancel
      it.  That is why real/user/sys are "unknown".
      
      This patch (of 3):
      
      Currently an allocation of the new vmap area is done over busy list
      iteration(complexity O(n)) until a suitable hole is found between two busy
      areas.  Therefore each new allocation causes the list being grown.  Due to
      over fragmented list and different permissive parameters an allocation can
      take a long time.  For example on embedded devices it is milliseconds.
      
      This patch organizes the KVA memory layout into free areas of the
      1-ULONG_MAX range.  It uses an augment red-black tree that keeps blocks
      sorted by their offsets in pair with linked list keeping the free space in
      order of increasing addresses.
      
      Nodes are augmented with the size of the maximum available free block in
      its left or right sub-tree.  Thus, that allows to take a decision and
      traversal toward the block that will fit and will have the lowest start
      address, i.e.  it is sequential allocation.
      
      Allocation: to allocate a new block a search is done over the tree until a
      suitable lowest(left most) block is large enough to encompass: the
      requested size, alignment and vstart point.  If the block is bigger than
      requested size - it is split.
      
      De-allocation: when a busy vmap area is freed it can either be merged or
      inserted to the tree.  Red-black tree allows efficiently find a spot
      whereas a linked list provides a constant-time access to previous and next
      blocks to check if merging can be done.  In case of merging of
      de-allocated memory chunk a large coalesced area is created.
      
      Complexity: ~O(log(N))
      
      [urezki@gmail.com: v3]
        Link: http://lkml.kernel.org/r/20190402162531.10888-2-urezki@gmail.com
      [urezki@gmail.com: v4]
        Link: http://lkml.kernel.org/r/20190406183508.25273-2-urezki@gmail.com
      Link: http://lkml.kernel.org/r/20190321190327.11813-2-urezki@gmail.comSigned-off-by: default avatarUladzislau Rezki (Sony) <urezki@gmail.com>
      Reviewed-by: default avatarRoman Gushchin <guro@fb.com>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Thomas Garnier <thgarnie@google.com>
      Cc: Oleksiy Avramchenko <oleksiy.avramchenko@sonymobile.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Joel Fernandes <joelaf@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Tejun Heo <tj@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      68ad4a33
  2. 17 May, 2019 13 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 0ef0fd35
      Linus Torvalds authored
      Pull KVM updates from Paolo Bonzini:
       "ARM:
         - support for SVE and Pointer Authentication in guests
         - PMU improvements
      
        POWER:
         - support for direct access to the POWER9 XIVE interrupt controller
         - memory and performance optimizations
      
        x86:
         - support for accessing memory not backed by struct page
         - fixes and refactoring
      
        Generic:
         - dirty page tracking improvements"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (155 commits)
        kvm: fix compilation on aarch64
        Revert "KVM: nVMX: Expose RDPMC-exiting only when guest supports PMU"
        kvm: x86: Fix L1TF mitigation for shadow MMU
        KVM: nVMX: Disable intercept for FS/GS base MSRs in vmcs02 when possible
        KVM: PPC: Book3S: Remove useless checks in 'release' method of KVM device
        KVM: PPC: Book3S HV: XIVE: Fix spelling mistake "acessing" -> "accessing"
        KVM: PPC: Book3S HV: Make sure to load LPID for radix VCPUs
        kvm: nVMX: Set nested_run_pending in vmx_set_nested_state after checks complete
        tests: kvm: Add tests for KVM_SET_NESTED_STATE
        KVM: nVMX: KVM_SET_NESTED_STATE - Tear down old EVMCS state before setting new state
        tests: kvm: Add tests for KVM_CAP_MAX_VCPUS and KVM_CAP_MAX_CPU_ID
        tests: kvm: Add tests to .gitignore
        KVM: Introduce KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2
        KVM: Fix kvm_clear_dirty_log_protect off-by-(minus-)one
        KVM: Fix the bitmap range to copy during clear dirty
        KVM: arm64: Fix ptrauth ID register masking logic
        KVM: x86: use direct accessors for RIP and RSP
        KVM: VMX: Use accessors for GPRs outside of dedicated caching logic
        KVM: x86: Omit caching logic for always-available GPRs
        kvm, x86: Properly check whether a pfn is an MMIO or not
        ...
      0ef0fd35
    • Linus Torvalds's avatar
      Merge tag 'nds32-for-linus-5.2-rc1' of... · 4489da71
      Linus Torvalds authored
      Merge tag 'nds32-for-linus-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/greentime/linux
      
      Pull nds32 updates from Greentime Hu:
      
       - Clean up codes and Makefile
      
       - Fix a vDSO bug
      
       - Remove useless functions/header files
      
       - Update git repo path in MAINTAINERS
      
      * tag 'nds32-for-linus-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/greentime/linux:
        nds32: Fix vDSO clock_getres()
        MAINTAINERS: update nds32 git repo path
        nds32: don't export low-level cache flushing routines
        arch: nds32: Kconfig: pedantic formatting
        nds32: fix semicolon code style issue
        nds32: vdso: drop unnecessary cc-ldoption
        nds32: remove unused generic-y += cmpxchg-local.h
        nds32: Use the correct style for SPDX License Identifier
        nds32: remove __virt_to_bus and __bus_to_virt
        nds32: vdso: fix and clean-up Makefile
        nds32: add vmlinux.lds and vdso.so to .gitignore
        nds32: ex-exit: Remove unneeded need_resched() loop
        nds32/io: Remove useless definition of mmiowb()
        nds32: Removed unused thread flag TIF_USEDFPU
      4489da71
    • Linus Torvalds's avatar
      Merge tag 's390-5.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 80111bfb
      Linus Torvalds authored
      Pull more s390 updates from Martin Schwidefsky:
      
       - Enhancements for the QDIO layer
      
       - Remove the RCP trace event
      
       - Avoid three build issues
      
       - Move the defconfig to the configs directory
      
      * tag 's390-5.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390: move arch/s390/defconfig to arch/s390/configs/defconfig
        s390/qdio: optimize state inspection of HW-owned SBALs
        s390/qdio: use get_buf_state() in debug_get_buf_state()
        s390/qdio: allow to scan all Output SBALs in one go
        s390/cio: Remove tracing for rchp instruction
        s390/kasan: adapt disabled_wait usage to avoid build error
        latent_entropy: avoid build error when plugin cflags are not set
        s390/boot: fix compiler error due to missing awk strtonum
      80111bfb
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · bf8a9a47
      Linus Torvalds authored
      Pull more vfs mount updates from Al Viro:
       "Propagation of new syscalls to other architectures + cosmetic change
        from Christian (fscontext didn't follow the convention for anon inode
        names)"
      
      * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        uapi: Wire up the mount API syscalls on non-x86 arches [ver #2]
        uapi, x86: Fix the syscall numbering of the mount API syscalls [ver #2]
        uapi, fsopen: use square brackets around "fscontext" [ver #2]
      bf8a9a47
    • Paolo Bonzini's avatar
      kvm: fix compilation on aarch64 · c011d23b
      Paolo Bonzini authored
      Commit e45adf66 ("KVM: Introduce a new guest mapping API", 2019-01-31)
      introduced a build failure on aarch64 defconfig:
      
      $ make -j$(nproc) ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- O=out defconfig \
                      Image.gz
      ...
      ../arch/arm64/kvm/../../../virt/kvm/kvm_main.c:
          In function '__kvm_map_gfn':
      ../arch/arm64/kvm/../../../virt/kvm/kvm_main.c:1763:9: error:
          implicit declaration of function 'memremap'; did you mean 'memset_p'?
      ../arch/arm64/kvm/../../../virt/kvm/kvm_main.c:1763:46: error:
          'MEMREMAP_WB' undeclared (first use in this function)
      ../arch/arm64/kvm/../../../virt/kvm/kvm_main.c:
          In function 'kvm_vcpu_unmap':
      ../arch/arm64/kvm/../../../virt/kvm/kvm_main.c:1795:3: error:
          implicit declaration of function 'memunmap'; did you mean 'vm_munmap'?
      
      because these functions are declared in <linux/io.h> rather than <asm/io.h>,
      and the former was being pulled in already on x86 but not on aarch64.
      Reported-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      c011d23b
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20190516' of git://git.kernel.dk/linux-block · a6a4b66b
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "A small set of fixes for io_uring.
      
        This contains:
      
         - smp_rmb() cleanup for io_cqring_events() (Jackie)
      
         - io_cqring_wait() simplification (Jackie)
      
         - removal of dead 'ev_flags' passing (me)
      
         - SQ poll CPU affinity verification fix (me)
      
         - SQ poll wait fix (Roman)
      
         - SQE command prep cleanup and fix (Stefan)"
      
      * tag 'for-linus-20190516' of git://git.kernel.dk/linux-block:
        io_uring: use wait_event_interruptible for cq_wait conditional wait
        io_uring: adjust smp_rmb inside io_cqring_events
        io_uring: fix infinite wait in khread_park() on io_finish_async()
        io_uring: remove 'ev_flags' argument
        io_uring: fix failure to verify SQ_AFF cpu
        io_uring: fix race condition reading SQE data
      a6a4b66b
    • Linus Torvalds's avatar
      Merge tag 'for-5.2/block-post-20190516' of git://git.kernel.dk/linux-block · 1718de78
      Linus Torvalds authored
      Pull more block updates from Jens Axboe:
       "This is mainly some late lightnvm changes that came in just before the
        merge window, as well as fixes that have been queued up since the
        initial pull request was frozen.
      
        This contains:
      
         - lightnvm changes, fixing race conditions, improving memory
           utilization, and improving pblk compatability (Chansol, Igor,
           Marcin)
      
         - NVMe pull request with minor fixes all over the map (via Christoph)
      
         - remove redundant error print in sata_rcar (Geert)
      
         - struct_size() cleanup (Jackie)
      
         - dasd CONFIG_LBADF warning fix (Ming)
      
         - brd cond_resched() improvement (Mikulas)"
      
      * tag 'for-5.2/block-post-20190516' of git://git.kernel.dk/linux-block: (41 commits)
        block/bio-integrity: use struct_size() in kmalloc()
        nvme: validate cntlid during controller initialisation
        nvme: change locking for the per-subsystem controller list
        nvme: trace all async notice events
        nvme: fix typos in nvme status code values
        nvme-fabrics: remove unused argument
        nvme-multipath: avoid crash on invalid subsystem cntlid enumeration
        nvme-fc: use separate work queue to avoid warning
        nvme-rdma: remove redundant reference between ib_device and tagset
        nvme-pci: mark expected switch fall-through
        nvme-pci: add known admin effects to augument admin effects log page
        nvme-pci: init shadow doorbell after each reset
        brd: add cond_resched to brd_free_pages
        sata_rcar: Remove ata_host_alloc() error printing
        s390/dasd: fix build warning in dasd_eckd_build_cp_raw
        lightnvm: pblk: use nvm_rq_to_ppa_list()
        lightnvm: pblk: simplify partial read path
        lightnvm: do not remove instance under global lock
        lightnvm: track inflight target creations
        lightnvm: pblk: recover only written metadata
        ...
      1718de78
    • Linus Torvalds's avatar
      Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · 815d469d
      Linus Torvalds authored
      Pull more clk framework updates from Stephen Boyd:
       "One more patch to remove io.h from clk-provider.h.
      
        We used to need this include when we had clk_readl() and clk_writel(),
        but those are gone now so this patch pushes the dependency out to the
        users of clk-provider.h"
      
      * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
        clk: Remove io.h from clk-provider.h
      815d469d
    • Linus Torvalds's avatar
      Merge branch 'for-5.2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup · 5f3ab27b
      Linus Torvalds authored
      Pull cgroup fix from Tejun Heo:
       "The cgroup2 freezer pulled in this cycle broke strace. This pull
        request includes a workaround for the problem.
      
        It's not a complete fix in that it may cause spurious frozen state
        flip-flops which is fairly minor. Will push a full fix once it's
        ready"
      
      * 'for-5.2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
        signal: unconditionally leave the frozen state in ptrace_stop()
      5f3ab27b
    • Linus Torvalds's avatar
      Merge tag 'linux-kselftest-5.2-rc1-2' of... · 4c7b63a3
      Linus Torvalds authored
      Merge tag 'linux-kselftest-5.2-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull more kselftest updates from Shuah Khan:
      
       - kselftest framework bpf build/test workflow regression fix
      
       - Fix to kselftest install to use default install path
      
       - Fix to kselftest KBUILD_OUTPUT builds to not clutter main
         KBUILD_OUTPUT directory with selftest objects
      
       - .gitignore fixes (Kelsey Skunberg)
      
       - rseq selftests updates (Mathieu Desnoyers and Martin Schwidefsky)
      
         They change the per-architecture pre-abort signatures to ensure those
         are valid trap instructions.
      
         The way exit points are presented to debuggers is enhanced, ensuring
         all exit points are present, so debuggers don't have to disassemble
         rseq critical section to properly skip over them.
      
         Discussions with the glibc community is reaching a consensus of
         exposing a __rseq_handled symbol from glibc to coexist with rseq
         early adopters. Update the rseq selftest code to expose and use this
         symbol.
      
         Support for compiling asm goto with clang is added with the
         "-no-integrated-as" compiler switch, similarly to the top level
         kernel Makefile.
      
       - kselftest Makefile test run output refactoring and making test output
         TAP13 compliant from Kees Cook:
      
         This re-factors the selftest Makefiles to extract the test running
         logic to be reused between "run_tests" and "emit_tests", while also
         fixing up the test output to be TAP version 13 compliant:
      	- added "plan" line
      	- fixed result line syntax
      	- moved all test output to be "# "-prefixed as TAP "diagnostic"
      	  lines
      
         The prefixing code includes a fallback mode for limited execution
         environments.
      
         Additionally, the plan lines are fixed for all callers of
         kselftest.h.
      
      * tag 'linux-kselftest-5.2-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (25 commits)
        selftests: avoid KBUILD_OUTPUT dir cluttering with selftest objects
        selftests: drivers: Create .gitignore to include /dma-buf/udmabuf
        selftests: pidfd: Create .gitignore to include pidfd_test
        selftests: fix bpf build/test workflow regression when KBUILD_OUTPUT is set
        selftests: fix install target to use default install path
        rseq/selftests: add -no-integrated-as for clang
        rseq/selftests: mips: use break instruction for RSEQ_SIG
        rseq/selftests: powerpc code signature: generate valid instructions
        rseq/selftests: aarch64 code signature: handle big-endian environment
        rseq/selftests: arm: use udf instruction for RSEQ_SIG
        rseq/selftests: s390: use trap4 for RSEQ_SIG
        rseq/selftests: x86: use ud1 instruction as RSEQ_SIG opcode
        rseq/selftests: s390: use jg instruction for jumps outside of the asm
        rseq/selftests: Use __rseq_handled symbol to coexist with glibc
        rseq/selftests: Introduce __rseq_cs_ptr_array, rename __rseq_table to __rseq_cs
        rseq/selftests: Add __rseq_exit_point_array section for debuggers
        rseq/selftests: x86: Work-around bogus gcc-8 optimisation
        selftests: Add test plan API to kselftest.h and adjust callers
        selftests: Remove KSFT_TAP_LEVEL
        selftests: Move test output to diagnostic lines
        ...
      4c7b63a3
    • Linus Torvalds's avatar
      Merge tag 'devicetree-for-5.2-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · 9cbda1bd
      Linus Torvalds authored
      Pull Devicetree vendor prefix conversion from Rob Herring:
       "Conversion of vendor-prefixes.txt to json-schema"
      
      * tag 'devicetree-for-5.2-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
        dt-bindings: Convert vendor prefixes to json-schema
      9cbda1bd
    • Linus Torvalds's avatar
      Merge tag 'afs-fixes-b-20190516' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs · 0d744719
      Linus Torvalds authored
      Pull AFS callback promise fixes from David Howells:
       "This series fixes a bunch of problems in callback promise handling,
        where a callback promise indicates a promise on the part of the server
        to notify the client in the event of some sort of change to a file or
        volume. In the event of a break, the client has to go and refetch the
        client status from the server and discard any cached permission
        information as the ACL might have changed.
      
        The problem in the current code is that changes made by other clients
        aren't always noticed, primarily because the file status information
        and the callback information aren't updated in the same critical
        section, even if these are carried in the same reply from an RPC
        operation, and so the AFS_VNODE_CB_PROMISED flag is unreliable.
      
        Arranging for them to be done in the same critical section during
        reply decoding is tricky because of the FS.InlineBulkStatus op - which
        has all the statuses in the reply arriving and then all the callbacks,
        so they have to be buffered. It simplifies things a lot to move the
        critical section out of the decode phase and do it after the RPC
        function returns.
      
        Also new inodes (either newly fetched or newly created) aren't
        properly managed against a callback break happening before we get the
        local inode up and running.
      
        Fix this by:
      
         - There's now a combined file status and callback record (struct
           afs_status_cb) to carry both plus some flags.
      
         - Each operation wrapper function allocates sufficient afs_status_cb
           records for all the vnodes it is interested in and passes them into
           RPC operations to be filled in from the reply.
      
         - The FileStatus and CallBack record decoders no longer apply the
           new/revised status and callback information to the inode/vnode at
           the point of decoding and instead store the information into the
           record from (2).
      
         - afs_vnode_commit_status() then revises the file status, detects
           deletion and notes callback information inside of a single critical
           section. It also checks the callback break counters and cancels the
           callback promise if they changed during the operation.
      
           [*] Note that "callback break counters" are counters of server
           events that cancel one or more callback promises that the client
           thinks it has. The client counts the events and compares the
           counters before and after an operation to see if the callback
           promise it thinks it just got evaporated before it got recorded
           under lock.
      
         - Volume and server callback break counters are passed into
           afs_iget() allowing callback breaks concurrent with inode set up to
           be detected and the callback promise thence to be cancelled.
      
         - AFS validation checks are now done under RCU conditions using a
           read lock on cb_lock. This requires vnode->cb_interest to be made
           RCU safe.
      
         - If the checks in (6) fail, the callback breaker is then called
           under write lock on the cb_lock - but only if the callback break
           counter didn't change from the value read before the checks were
           made.
      
         - Results from FS.InlineBulkStatus that correspond to inodes we
           currently have in memory are now used to update those inodes'
           status and callback information rather than being discarded. This
           requires those inodes to be looked up before the RPC op is made and
           all their callback break values saved.
      
        To aid in this, the following changes have also been made:
      
         - Don't pass the vnode into the reply delivery functions or the
           decoders. The vnode shouldn't be altered anywhere in those paths.
           The only exception, for the moment, is for the call done hook for
           file lock ops that wants access to both the vnode and the call -
           this can be fixed at a later time.
      
         - Get rid of the call->reply[] void* array and replace it with named
           and typed members. This avoids confusion since different ops were
           mapping different reply[] members to different things.
      
         - Fix an order-1 kmalloc allocation in afs_do_lookup() and replace it
           with kvcalloc().
      
         - Always get the reply time. Since callback, lock and fileserver
           record expiry times are calculated for several RPCs, make this
           mandatory.
      
         - Call afs_pages_written_back() from the operation wrapper rather
           than from the delivery function.
      
         - Don't store the version and type from a callback promise in a reply
           as the information in them is of very limited use"
      
      * tag 'afs-fixes-b-20190516' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
        afs: Fix application of the results of a inline bulk status fetch
        afs: Pass pre-fetch server and volume break counts into afs_iget5_set()
        afs: Fix unlink to handle YFS.RemoveFile2 better
        afs: Clear AFS_VNODE_CB_PROMISED if we detect callback expiry
        afs: Make vnode->cb_interest RCU safe
        afs: Split afs_validate() so first part can be used under LOOKUP_RCU
        afs: Don't save callback version and type fields
        afs: Fix application of status and callback to be under same lock
        afs: Always get the reply time
        afs: Fix order-1 allocation in afs_do_lookup()
        afs: Get rid of afs_call::reply[]
        afs: Don't pass the vnode pointer through into the inline bulk status op
      0d744719
    • Linus Torvalds's avatar
      Merge tag 'afs-fixes-20190516' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs · 227747fb
      Linus Torvalds authored
      Pull misc AFS fixes from David Howells:
       "This fixes a set of miscellaneous issues in the afs filesystem,
        including:
      
         - leak of keys on file close.
      
         - broken error handling in xattr functions.
      
         - missing locking when updating VL server list.
      
         - volume location server DNS lookup whereby preloaded cells may not
           ever get a lookup and regular DNS lookups to maintain server lists
           consume power unnecessarily.
      
         - incorrect error propagation and handling in the fileserver
           iteration code causes operations to sometimes apparently succeed.
      
         - interruption of server record check/update side op during
           fileserver iteration causes uninterruptible main operations to fail
           unexpectedly.
      
         - callback promise expiry time miscalculation.
      
         - over invalidation of the callback promise on directories.
      
         - double locking on callback break waking up file locking waiters.
      
         - double increment of the vnode callback break counter.
      
        Note that it makes some changes outside of the afs code, including:
      
         - an extra parameter to dns_query() to allow the dns_resolver key
           just accessed to be immediately invalidated. AFS is caching the
           results itself, so the key can be discarded.
      
         - an interruptible version of wait_var_event().
      
         - an rxrpc function to allow the maximum lifespan to be set on a
           call.
      
         - a way for an rxrpc call to be marked as non-interruptible"
      
      * tag 'afs-fixes-20190516' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
        afs: Fix double inc of vnode->cb_break
        afs: Fix lock-wait/callback-break double locking
        afs: Don't invalidate callback if AFS_VNODE_DIR_VALID not set
        afs: Fix calculation of callback expiry time
        afs: Make dynamic root population wait uninterruptibly for proc_cells_lock
        afs: Make some RPC operations non-interruptible
        rxrpc: Allow the kernel to mark a call as being non-interruptible
        afs: Fix error propagation from server record check/update
        afs: Fix the maximum lifespan of VL and probe calls
        rxrpc: Provide kernel interface to set max lifespan on a call
        afs: Fix "kAFS: AFS vnode with undefined type 0"
        afs: Fix cell DNS lookup
        Add wait_var_event_interruptible()
        dns_resolver: Allow used keys to be invalidated
        afs: Fix afs_cell records to always have a VL server list record
        afs: Fix missing lock when replacing VL server list
        afs: Fix afs_xattr_get_yfs() to not try freeing an error value
        afs: Fix incorrect error handling in afs_xattr_get_acl()
        afs: Fix key leak in afs_release() and afs_evict_inode()
      227747fb
  3. 16 May, 2019 20 commits
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-5.2-rc1' of git://github.com/ceph/ceph-client · 1d9d7cbf
      Linus Torvalds authored
      Pull ceph updates from Ilya Dryomov:
       "On the filesystem side we have:
      
         - a fix to enforce quotas set above the mount point (Luis Henriques)
      
         - support for exporting snapshots through NFS (Zheng Yan)
      
         - proper statx implementation (Jeff Layton). statx flags are mapped
           to MDS caps, with AT_STATX_{DONT,FORCE}_SYNC taken into account.
      
         - some follow-up dentry name handling fixes, in particular
           elimination of our hand-rolled helper and the switch to __getname()
           as suggested by Al (Jeff Layton)
      
         - a set of MDS client cleanups in preparation for async MDS requests
           in the future (Jeff Layton)
      
         - a fix to sync the filesystem before remounting (Jeff Layton)
      
        On the rbd side, work is on-going on object-map and fast-diff image
        features"
      
      * tag 'ceph-for-5.2-rc1' of git://github.com/ceph/ceph-client: (29 commits)
        ceph: flush dirty inodes before proceeding with remount
        ceph: fix unaligned access in ceph_send_cap_releases
        libceph: make ceph_pr_addr take an struct ceph_entity_addr pointer
        libceph: fix unaligned accesses in ceph_entity_addr handling
        rbd: don't assert on writes to snapshots
        rbd: client_mutex is never nested
        ceph: print inode number in __caps_issued_mask debugging messages
        ceph: just call get_session in __ceph_lookup_mds_session
        ceph: simplify arguments and return semantics of try_get_cap_refs
        ceph: fix comment over ceph_drop_caps_for_unlink
        ceph: move wait for mds request into helper function
        ceph: have ceph_mdsc_do_request call ceph_mdsc_submit_request
        ceph: after an MDS request, do callback and completions
        ceph: use pathlen values returned by set_request_path_attr
        ceph: use __getname/__putname in ceph_mdsc_build_path
        ceph: use ceph_mdsc_build_path instead of clone_dentry_name
        ceph: fix potential use-after-free in ceph_mdsc_build_path
        ceph: dump granular cap info in "caps" debugfs file
        ceph: make iterate_session_caps a public symbol
        ceph: fix NULL pointer deref when debugging is enabled
        ...
      1d9d7cbf
    • Linus Torvalds's avatar
      Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux · 2c45e7fb
      Linus Torvalds authored
      Pull thermal management updates from Zhang Rui:
      
       - Remove the 'module' Kconfig option for thermal subsystem framework
         because the thermal framework are required to be ready as early as
         possible to avoid overheat at boot time (Daniel Lezcano)
      
       - Fix a bug that thermal framework pokes disabled thermal zones upon
         resume (Wei Wang)
      
        - A couple of cleanups and trivial fixes on int340x thermal drivers
          (Srinivas Pandruvada, Zhang Rui, Sumeet Pawnikar)
      
      * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
        drivers: thermal: processor_thermal: Downgrade error message
        mlxsw: Remove obsolete dependency on THERMAL=m
        hwmon/drivers/core: Simplify complex dependency
        thermal/drivers/core: Fix typo in the option name
        thermal/drivers/core: Remove depends on THERMAL in Kconfig
        thermal/drivers/core: Remove module unload code
        thermal/drivers/core: Remove the module Kconfig's option
        thermal: core: skip update disabled thermal zones after suspend
        thermal: make device_register's type argument const
        thermal: intel: int340x: processor_thermal_device: simplify to get driver data
        thermal/int3403_thermal: favor _TMP instead of PTYP
      2c45e7fb
    • Linus Torvalds's avatar
      Merge tag 'for-5.2/dm-changes-v2' of... · 311f7128
      Linus Torvalds authored
      Merge tag 'for-5.2/dm-changes-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
      
      Pull device mapper updates from Mike Snitzer:
      
       - Improve DM snapshot target's scalability by using finer grained
         locking. Requires some list_bl interface improvements.
      
       - Add ability for DM integrity to use a bitmap mode, that tracks
         regions where data and metadata are out of sync, instead of using a
         journal.
      
       - Improve DM thin provisioning target to not write metadata changes to
         disk if the thin-pool and associated thin devices are merely
         activated but not used. This avoids metadata corruption due to
         concurrent activation of thin devices across different OS instances
         (e.g. split brain scenarios, which ultimately would be avoided if
         proper device filters were used -- but not having proper filtering
         has proven a very common configuration mistake)
      
       - Fix missing call to path selector type->end_io in DM multipath. This
         fixes reported performance problems due to inaccurate path selector
         IO accounting causing an imbalance of IO (e.g. avoiding issuing IO to
         particular path due to it seemingly being heavily used).
      
       - Fix bug in DM cache metadata's loading of its discard bitset that
         could lead to all cache blocks being discarded if the very first
         cache block was discarded (thankfully in practice the first cache
         block is generally in use; be it FS superblock, partition table, disk
         label, etc).
      
       - Add testing-only DM dust target which simulates a device that has
         failing sectors and/or read failures.
      
       - Fix a DM init error path reference count hang that caused boot hangs
         if user supplied malformed input on kernel commandline.
      
       - Fix a couple issues with DM crypt target's logging being overly
         verbose or lacking context.
      
       - Various other small fixes to DM init, DM multipath, DM zoned, and DM
         crypt.
      
      * tag 'for-5.2/dm-changes-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: (42 commits)
        dm: fix a couple brace coding style issues
        dm crypt: print device name in integrity error message
        dm crypt: move detailed message into debug level
        dm ioctl: fix hang in early create error condition
        dm integrity: whitespace, coding style and dead code cleanup
        dm integrity: implement synchronous mode for reboot handling
        dm integrity: handle machine reboot in bitmap mode
        dm integrity: add a bitmap mode
        dm integrity: introduce a function add_new_range_and_wait()
        dm integrity: allow large ranges to be described
        dm ingerity: pass size to dm_integrity_alloc_page_list()
        dm integrity: introduce rw_journal_sectors()
        dm integrity: update documentation
        dm integrity: don't report unused options
        dm integrity: don't check null pointer before kvfree and vfree
        dm integrity: correctly calculate the size of metadata area
        dm dust: Make dm_dust_init and dm_dust_exit static
        dm dust: remove redundant unsigned comparison to less than zero
        dm mpath: always free attached_handler_name in parse_path()
        dm init: fix max devices/targets checks
        ...
      311f7128
    • Qian Cai's avatar
      slab: remove /proc/slab_allocators · 7878c231
      Qian Cai authored
      It turned out that DEBUG_SLAB_LEAK is still broken even after recent
      recue efforts that when there is a large number of objects like
      kmemleak_object which is normal on a debug kernel,
      
        # grep kmemleak /proc/slabinfo
        kmemleak_object   2243606 3436210 ...
      
      reading /proc/slab_allocators could easily loop forever while processing
      the kmemleak_object cache and any additional freeing or allocating
      objects will trigger a reprocessing. To make a situation worse,
      soft-lockups could easily happen in this sitatuion which will call
      printk() to allocate more kmemleak objects to guarantee an infinite
      loop.
      
      Also, since it seems no one had noticed when it was totally broken
      more than 2-year ago - see the commit fcf88917 ("slab: fix a crash
      by reading /proc/slab_allocators"), probably nobody cares about it
      anymore due to the decline of the SLAB. Just remove it entirely.
      Suggested-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarQian Cai <cai@lca.pw>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7878c231
    • David Howells's avatar
      afs: Fix application of the results of a inline bulk status fetch · 39db9815
      David Howells authored
      Fix afs_do_lookup() such that when it does an inline bulk status fetch op,
      it will update inodes that are already extant (something that afs_iget()
      doesn't do) and to cache permits for each inode created (thereby avoiding a
      follow up FS.FetchStatus call to determine this).
      
      Extant inodes need looking up in advance so that their cb_break counters
      before and after the operation can be compared.  To this end, the inode
      pointers are cached so that they don't need looking up again after the op.
      
      Fixes: 5cf9dd55 ("afs: Prospectively look up extra files when doing a single lookup")
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      39db9815
    • David Howells's avatar
      afs: Pass pre-fetch server and volume break counts into afs_iget5_set() · b8359153
      David Howells authored
      Pass the server and volume break counts from before the status fetch
      operation that queried the attributes of a file into afs_iget5_set() so
      that the new vnode's break counters can be initialised appropriately.
      
      This allows detection of a volume or server break that happened whilst we
      were fetching the status or setting up the vnode.
      
      Fixes: c435ee34 ("afs: Overhaul the callback handling")
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      b8359153
    • David Howells's avatar
      afs: Fix unlink to handle YFS.RemoveFile2 better · a38a7558
      David Howells authored
      Make use of the status update for the target file that the YFS.RemoveFile2
      RPC op returns to correctly update the vnode as to whether the file was
      actually deleted or just had nlink reduced.
      
      Fixes: 30062bd1 ("afs: Implement YFS support in the fs client")
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      a38a7558
    • David Howells's avatar
      afs: Clear AFS_VNODE_CB_PROMISED if we detect callback expiry · 61c347ba
      David Howells authored
      Fix afs_validate() to clear AFS_VNODE_CB_PROMISED on a vnode if we detect
      any condition that causes the callback promise to be broken implicitly,
      including server break (cb_s_break), volume break (cb_v_break) or callback
      expiry.
      
      Fixes: ae3b7361 ("afs: Fix validation/callback interaction")
      Reported-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      61c347ba
    • David Howells's avatar
      afs: Make vnode->cb_interest RCU safe · f642404a
      David Howells authored
      Use RCU-based freeing for afs_cb_interest struct objects and use RCU on
      vnode->cb_interest.  Use that change to allow afs_check_validity() to use
      read_seqbegin_or_lock() instead of read_seqlock_excl().
      
      This also requires the caller of afs_check_validity() to hold the RCU read
      lock across the call.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      f642404a
    • David Howells's avatar
      afs: Split afs_validate() so first part can be used under LOOKUP_RCU · c925bd0a
      David Howells authored
      Split afs_validate() so that the part that decides if the vnode is still
      valid can be used under LOOKUP_RCU conditions from afs_d_revalidate().
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      c925bd0a
    • David Howells's avatar
      afs: Don't save callback version and type fields · 7c712458
      David Howells authored
      Don't save callback version and type fields as the version is about the
      format of the callback information and the type is relative to the
      particular RPC call.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      7c712458
    • Rob Herring's avatar
      dt-bindings: Convert vendor prefixes to json-schema · 8122de54
      Rob Herring authored
      Convert the vendor prefix registry to a schema. This will enable checking
      that new vendor prefixes are added (in addition to the less than perfect
      checkpatch.pl check) and will also check against adding other prefixes
      which are not vendors.
      
      Converted vendor-prefixes.txt using the following sed script:
      
      sed -e 's/\([a-zA-Z0-9\-]*\)[[:space:]]*\([a-zA-Z0-9].*\)/  "^\1,\.\*\":\n    description: \2/'
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      8122de54
    • Linus Torvalds's avatar
      Merge tag 'media/v5.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media · 01be377c
      Linus Torvalds authored
      Pull media fixes from Mauro Carvalho Chehab:
       "Some fixes for some platform drivers (rockchip, atmel, omap, daVinci,
        tegra-cec, coda and rcar).
      
        Also includes a fix on one of the V4L2 uAPI doc, explaining a border
        case"
      
      * tag 'media/v5.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
        media: rockchip/vpu: Fix/re-order probe-error/remove path
        media: rockchip/vpu: Initialize mdev->bus_info
        media: rockchip/vpu: Get vdev from the file arg in vidioc_querycap()
        media: rockchip/vpu: Add missing dont_use_autosuspend() calls
        media: rockchip/vpu: Do not request id 0 for our video device
        media: tegra-cec: fix cec_notifier_parse_hdmi_phandle return check
        media: davinci/vpbe: array underflow in vpbe_enum_outputs()
        media: field-order.rst: clarify FIELD_ANY and FIELD_NONE
        media: staging/imx: add media device to capture register
        media: rcar-csi2: Propagate the FLD signal for NTSC and PAL
        media: rcar-csi2: restart CSI-2 link if error is detected
        media: omap_vout: potential buffer overflow in vidioc_dqbuf()
        media: coda: fix unset field and fail on invalid field in buf_prepare
        media: atmel: atmel-isc: fix asd memory allocation
        media: atmel: atmel-isc: fix INIT_WORK misplacement
        media: atmel: atmel-isc: limit incoming pixels per frame
      01be377c
    • Linus Torvalds's avatar
      Merge tag 'edac_fixes_for_5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp · 11b11773
      Linus Torvalds authored
      Pull EDAC fixes from Borislav Petkov:
      
       - Do not build mpc85_edac as a module (Michael Ellerman)
      
       - Correct edac_mc_find()'s return value on error (Robert Richter)
      
      * tag 'edac_fixes_for_5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
        EDAC/mc: Fix edac_mc_find() in case no device is found
        EDAC/mpc85xx: Prevent building as a module
      11b11773
    • Linus Torvalds's avatar
      Merge tag 'configfs-for-5.2' of git://git.infradead.org/users/hch/configfs · 4e785e8d
      Linus Torvalds authored
      Pull configfs update from Christoph Hellwig:
      
       - a fix for an error path use after free (YueHaibing)
      
      * tag 'configfs-for-5.2' of git://git.infradead.org/users/hch/configfs:
        configfs: fix possible use-after-free in configfs_register_group
      4e785e8d
    • Linus Torvalds's avatar
      Merge tag 'asm-generic-nommu' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic · 27ebbf9d
      Linus Torvalds authored
      Pull nommu generic uaccess updates from Arnd Bergmann:
       "asm-generic: kill <asm/segment.h> and improve nommu generic uaccess helpers
      
        Christoph Hellwig writes:
      
           This is a series doing two somewhat interwinded things. It improves
           the asm-generic nommu uaccess helper to optionally be entirely
           generic and not require any arch helpers for the actual uaccess.
           For the generic uaccess.h to actually be generically useful I also
           had to kill off the mess we made of <asm/segment.h>, which really
           shouldn't exist on most architectures"
      
      * tag 'asm-generic-nommu' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
        asm-generic: optimize generic uaccess for 8-byte loads and stores
        asm-generic: provide entirely generic nommu uaccess
        arch: mostly remove <asm/segment.h>
        asm-generic: don't include <asm/segment.h> from <asm/uaccess.h>
      27ebbf9d
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · d396360a
      Linus Torvalds authored
      Pull x86 fixes from Ingo Molnar:
       "Misc fixes and updates:
      
         - a handful of MDS documentation/comment updates
      
         - a cleanup related to hweight interfaces
      
         - a SEV guest fix for large pages
      
         - a kprobes LTO fix
      
         - and a final cleanup commit for vDSO HPET support removal"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/speculation/mds: Improve CPU buffer clear documentation
        x86/speculation/mds: Revert CPU buffer clear on double fault exit
        x86/kconfig: Disable CONFIG_GENERIC_HWEIGHT and remove __HAVE_ARCH_SW_HWEIGHT
        x86/mm: Do not use set_{pud, pmd}_safe() when splitting a large page
        x86/kprobes: Make trampoline_handler() global and visible
        x86/vdso: Remove hpet_page from vDSO
      d396360a
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · b2c3dda6
      Linus Torvalds authored
      Pull time fixes from Ingo Molnar:
       "A TIA adjtimex interface extension, and a POSIX compliance ABI fix for
        timespec64 users"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        ntp: Allow TAI-UTC offset to be set to zero
        y2038: Make CONFIG_64BIT_TIME unconditional
      b2c3dda6
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · c77ee64f
      Linus Torvalds authored
      Pull perf fixes from Ingo Molnar:
       "An x86 PMU constraint fix, an interface fix, and a Sparse fix"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86/intel: Allow PEBS multi-entry in watermark mode
        perf/x86/intel: Fix INTEL_FLAGS_EVENT_CONSTRAINT* masking
        perf/x86/amd/iommu: Make the 'amd_iommu_attr_groups' symbol static
      c77ee64f
    • Linus Torvalds's avatar
      Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f57d7715
      Linus Torvalds authored
      Pull locking fix from Ingo Molnar:
       "A single rwsem fix"
      
      * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        locking/rwsem: Prevent decrement of reader count before increment
      f57d7715