Skip to content
  1. Feb 06, 2021
    • Roman Gushchin's avatar
      memblock: do not start bottom-up allocations with kernel_end · 2dcb3964
      Roman Gushchin authored
      With kaslr the kernel image is placed at a random place, so starting the
      bottom-up allocation with the kernel_end can result in an allocation
      failure and a warning like this one:
      
        hugetlb_cma: reserve 2048 MiB, up to 2048 MiB per node
        ------------[ cut here ]------------
        memblock: bottom-up allocation failed, memory hotremove may be affected
        WARNING: CPU: 0 PID: 0 at mm/memblock.c:332 memblock_find_in_range_node+0x178/0x25a
        Modules linked in:
        CPU: 0 PID: 0 Comm: swapper Not tainted 5.10.0+ #1169
        Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-1.fc33 04/01/2014
        RIP: 0010:memblock_find_in_range_node+0x178/0x25a
        Code: e9 6d ff ff ff 48 85 c0 0f 85 da 00 00 00 80 3d 9b 35 df 00 00 75 15 48 c7 c7 c0 75 59 88 c6 05 8b 35 df 00 01 e8 25 8a fa ff <0f> 0b 48 c7 44 24 20 ff ff ff ff 44 89 e6 44 89 ea 48 c7 c1 70 5c
        RSP: 0000:ffffffff88803d18 EFLAGS: 00010086 ORIG_RAX: 0000000000000000
        RAX: 0000000000000000 RBX: 0000000240000000 RCX: 00000000ffffdfff
        RDX: 00000000ffffdfff RSI: 00000000ffffffea RDI: 0000000000000046
        RBP: 0000000100000000 R08: ffffffff88922788 R09: 0000000000009ffb
        R10: 00000000ffffe000 R11: 3fffffffffffffff R12: 0000000000000000
        R13: 0000000000000000 R14: 0000000080000000 R15: 00000001fb42c000
        FS:  0000000000000000(0000) GS:ffffffff88f71000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        CR2: ffffa080fb401000 CR3: 00000001fa80a000 CR4: 00000000000406b0
        Call Trace:
          memblock_alloc_range_nid+0x8d/0x11e
          cma_declare_contiguous_nid+0x2c4/0x38c
          hugetlb_cma_reserve+0xdc/0x128
          flush_tlb_one_kernel+0xc/0x20
          native_set_fixmap+0x82/0xd0
          flat_get_apic_id+0x5/0x10
          register_lapic_address+0x8e/0x97
          setup_arch+0x8a5/0xc3f
          start_kernel+0x66/0x547
          load_ucode_bsp+0x4c/0xcd
          secondary_startup_64_no_verify+0xb0/0xbb
        random: get_random_bytes called from __warn+0xab/0x110 with crng_init=0
        ---[ end trace f151227d0b39be70 ]---
      
      At the same time, the kernel image is protected with memblock_reserve(),
      so we can just start searching at PAGE_SIZE.  In this case the bottom-up
      allocation has the same chances to success as a top-down allocation, so
      there is no reason to fallback in the case of a failure.  All together it
      simplifies the logic.
      
      Link: https://lkml.kernel.org/r/20201217201214.3414100-2-guro@fb.com
      Fixes: 8fabc623
      
       ("powerpc: Ensure that swiotlb buffer is allocated from low memory")
      Signed-off-by: default avatarRoman Gushchin <guro@fb.com>
      Reviewed-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Wonhyuk Yang <vvghjk1234@gmail.com>
      Cc: Thiago Jung Bauermann <bauerman@linux.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2dcb3964
    • Hugh Dickins's avatar
      mm: thp: fix MADV_REMOVE deadlock on shmem THP · 1c2f6730
      Hugh Dickins authored
      Sergey reported deadlock between kswapd correctly doing its usual
      lock_page(page) followed by down_read(page->mapping->i_mmap_rwsem), and
      madvise(MADV_REMOVE) on an madvise(MADV_HUGEPAGE) area doing
      down_write(page->mapping->i_mmap_rwsem) followed by lock_page(page).
      
      This happened when shmem_fallocate(punch hole)'s unmap_mapping_range()
      reaches zap_pmd_range()'s call to __split_huge_pmd().  The same deadlock
      could occur when partially truncating a mapped huge tmpfs file, or using
      fallocate(FALLOC_FL_PUNCH_HOLE) on it.
      
      __split_huge_pmd()'s page lock was added in 5.8, to make sure that any
      concurrent use of reuse_swap_page() (holding page lock) could not catch
      the anon THP's mapcounts and swapcounts while they were being split.
      
      Fortunately, reuse_swap_page() is never applied to a shmem or file THP
      (not even by khugepaged, which checks PageSwapCache before calling), and
      anonymous THPs are never created in shmem or file areas: so that
      __split_huge_pmd()'s page lock can only be necessary for anonymous THPs,
      on which there is no risk of deadlock with i_mmap_rwsem.
      
      Link: https://lkml.kernel.org/r/alpine.LSU.2.11.2101161409470.2022@eggly.anvils
      Fixes: c444eb56
      
       ("mm: thp: make the THP mapcount atomic against __split_huge_pmd_locked()")
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Reported-by: default avatarSergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
      Reviewed-by: default avatarAndrea Arcangeli <aarcange@redhat.com>
      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>
      1c2f6730
    • Johannes Berg's avatar
      init/gcov: allow CONFIG_CONSTRUCTORS on UML to fix module gcov · 55b6f763
      Johannes Berg authored
      
      
      On ARCH=um, loading a module doesn't result in its constructors getting
      called, which breaks module gcov since the debugfs files are never
      registered.  On the other hand, in-kernel constructors have already been
      called by the dynamic linker, so we can't call them again.
      
      Get out of this conundrum by allowing CONFIG_CONSTRUCTORS to be
      selected, but avoiding the in-kernel constructor calls.
      
      Also remove the "if !UML" from GCOV selecting CONSTRUCTORS now, since we
      really do want CONSTRUCTORS, just not kernel binary ones.
      
      Link: https://lkml.kernel.org/r/20210120172041.c246a2cac2fb.I1358f584b76f1898373adfed77f4462c8705b736@changeid
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Reviewed-by: default avatarPeter Oberparleiter <oberpar@linux.ibm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Jessica Yu <jeyu@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      55b6f763
    • Rick Edgecombe's avatar
      mm/vmalloc: separate put pages and flush VM flags · 4f6ec860
      Rick Edgecombe authored
      When VM_MAP_PUT_PAGES was added, it was defined with the same value as
      VM_FLUSH_RESET_PERMS.  This doesn't seem like it will cause any big
      functional problems other than some excess flushing for VM_MAP_PUT_PAGES
      allocations.
      
      Redefine VM_MAP_PUT_PAGES to have its own value.  Also, rearrange things
      so flags are less likely to be missed in the future.
      
      Link: https://lkml.kernel.org/r/20210122233706.9304-1-rick.p.edgecombe@intel.com
      Fixes: b944afc9
      
       ("mm: add a VM_MAP_PUT_PAGES flag for vmap")
      Signed-off-by: default avatarRick Edgecombe <rick.p.edgecombe@intel.com>
      Suggested-by: default avatarMatthew Wilcox <willy@infradead.org>
      Cc: Miaohe Lin <linmiaohe@huawei.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Daniel Axtens <dja@axtens.net>
      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>
      4f6ec860
    • Rokudo Yan's avatar
      mm, compaction: move high_pfn to the for loop scope · 74e21484
      Rokudo Yan authored
      In fast_isolate_freepages, high_pfn will be used if a prefered one (ie
      PFN >= low_fn) not found.
      
      But the high_pfn is not reset before searching an free area, so when it
      was used as freepage, it may from another free area searched before.  As
      a result move_freelist_head(freelist, freepage) will have unexpected
      behavior (eg corrupt the MOVABLE freelist)
      
        Unable to handle kernel paging request at virtual address dead000000000200
        Mem abort info:
          ESR = 0x96000044
          Exception class = DABT (current EL), IL = 32 bits
          SET = 0, FnV = 0
          EA = 0, S1PTW = 0
        Data abort info:
          ISV = 0, ISS = 0x00000044
          CM = 0, WnR = 1
        [dead000000000200] address between user and kernel address ranges
      
        -000|list_cut_before(inline)
        -000|move_freelist_head(inline)
        -000|fast_isolate_freepages(inline)
        -000|isolate_freepages(inline)
        -000|compaction_alloc(?, ?)
        -001|unmap_and_move(inline)
        -001|migrate_pages([NSD:0xFFFFFF80088CBBD0] from = 0xFFFFFF80088CBD88, [NSD:0xFFFFFF80088CBBC8] get_new_p
        -002|__read_once_size(inline)
        -002|static_key_count(inline)
        -002|static_key_false(inline)
        -002|trace_mm_compaction_migratepages(inline)
        -002|compact_zone(?, [NSD:0xFFFFFF80088CBCB0] capc = 0x0)
        -003|kcompactd_do_work(inline)
        -003|kcompactd([X19] p = 0xFFFFFF93227FBC40)
        -004|kthread([X20] _create = 0xFFFFFFE1AFB26380)
        -005|ret_from_fork(asm)
      
      The issue was reported on an smart phone product with 6GB ram and 3GB
      zram as swap device.
      
      This patch fixes the issue by reset high_pfn before searching each free
      area, which ensure freepage and freelist match when call
      move_freelist_head in fast_isolate_freepages().
      
      Link: http://lkml.kernel.org/r/20190118175136.31341-12-mgorman@techsingularity.net
      Link: https://lkml.kernel.org/r/20210112094720.1238444-1-wu-yan@tcl.com
      Fixes: 5a811889
      
       ("mm, compaction: use free lists to quickly locate a migration target")
      Signed-off-by: default avatarRokudo Yan <wu-yan@tcl.com>
      Acked-by: default avatarMel Gorman <mgorman@techsingularity.net>
      Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
      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>
      74e21484
    • Muchun Song's avatar
      mm: migrate: do not migrate HugeTLB page whose refcount is one · 71a64f61
      Muchun Song authored
      
      
      All pages isolated for the migration have an elevated reference count and
      therefore seeing a reference count equal to 1 means that the last user of
      the page has dropped the reference and the page has became unused and
      there doesn't make much sense to migrate it anymore.
      
      This has been done for regular pages and this patch does the same for
      hugetlb pages.  Although the likelihood of the race is rather small for
      hugetlb pages it makes sense the two code paths in sync.
      
      Link: https://lkml.kernel.org/r/20210115124942.46403-2-songmuchun@bytedance.com
      Signed-off-by: default avatarMuchun Song <songmuchun@bytedance.com>
      Reviewed-by: default avatarMike Kravetz <mike.kravetz@oracle.com>
      Acked-by: default avatarYang Shi <shy828301@gmail.com>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
      Reviewed-by: default avatarOscar Salvador <osalvador@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      71a64f61
    • Muchun Song's avatar
      mm: hugetlb: remove VM_BUG_ON_PAGE from page_huge_active · ecbf4724
      Muchun Song authored
      The page_huge_active() can be called from scan_movable_pages() which do
      not hold a reference count to the HugeTLB page.  So when we call
      page_huge_active() from scan_movable_pages(), the HugeTLB page can be
      freed parallel.  Then we will trigger a BUG_ON which is in the
      page_huge_active() when CONFIG_DEBUG_VM is enabled.  Just remove the
      VM_BUG_ON_PAGE.
      
      Link: https://lkml.kernel.org/r/20210115124942.46403-6-songmuchun@bytedance.com
      Fixes: 7e1f049e
      
       ("mm: hugetlb: cleanup using paeg_huge_active()")
      Signed-off-by: default avatarMuchun Song <songmuchun@bytedance.com>
      Reviewed-by: default avatarMike Kravetz <mike.kravetz@oracle.com>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Reviewed-by: default avatarOscar Salvador <osalvador@suse.de>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Yang Shi <shy828301@gmail.com>
      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>
      ecbf4724
    • Muchun Song's avatar
      mm: hugetlb: fix a race between isolating and freeing page · 0eb2df2b
      Muchun Song authored
      There is a race between isolate_huge_page() and __free_huge_page().
      
        CPU0:                                     CPU1:
      
        if (PageHuge(page))
                                                  put_page(page)
                                                    __free_huge_page(page)
                                                        spin_lock(&hugetlb_lock)
                                                        update_and_free_page(page)
                                                          set_compound_page_dtor(page,
                                                            NULL_COMPOUND_DTOR)
                                                        spin_unlock(&hugetlb_lock)
          isolate_huge_page(page)
            // trigger BUG_ON
            VM_BUG_ON_PAGE(!PageHead(page), page)
            spin_lock(&hugetlb_lock)
            page_huge_active(page)
              // trigger BUG_ON
              VM_BUG_ON_PAGE(!PageHuge(page), page)
            spin_unlock(&hugetlb_lock)
      
      When we isolate a HugeTLB page on CPU0.  Meanwhile, we free it to the
      buddy allocator on CPU1.  Then, we can trigger a BUG_ON on CPU0, because
      it is already freed to the buddy allocator.
      
      Link: https://lkml.kernel.org/r/20210115124942.46403-5-songmuchun@bytedance.com
      Fixes: c8721bbb
      
       ("mm: memory-hotplug: enable memory hotplug to handle hugepage")
      Signed-off-by: default avatarMuchun Song <songmuchun@bytedance.com>
      Reviewed-by: default avatarMike Kravetz <mike.kravetz@oracle.com>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Reviewed-by: default avatarOscar Salvador <osalvador@suse.de>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Yang Shi <shy828301@gmail.com>
      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>
      0eb2df2b
    • Muchun Song's avatar
      mm: hugetlb: fix a race between freeing and dissolving the page · 7ffddd49
      Muchun Song authored
      There is a race condition between __free_huge_page()
      and dissolve_free_huge_page().
      
        CPU0:                         CPU1:
      
        // page_count(page) == 1
        put_page(page)
          __free_huge_page(page)
                                      dissolve_free_huge_page(page)
                                        spin_lock(&hugetlb_lock)
                                        // PageHuge(page) && !page_count(page)
                                        update_and_free_page(page)
                                        // page is freed to the buddy
                                        spin_unlock(&hugetlb_lock)
            spin_lock(&hugetlb_lock)
            clear_page_huge_active(page)
            enqueue_huge_page(page)
            // It is wrong, the page is already freed
            spin_unlock(&hugetlb_lock)
      
      The race window is between put_page() and dissolve_free_huge_page().
      
      We should make sure that the page is already on the free list when it is
      dissolved.
      
      As a result __free_huge_page would corrupt page(s) already in the buddy
      allocator.
      
      Link: https://lkml.kernel.org/r/20210115124942.46403-4-songmuchun@bytedance.com
      Fixes: c8721bbb
      
       ("mm: memory-hotplug: enable memory hotplug to handle hugepage")
      Signed-off-by: default avatarMuchun Song <songmuchun@bytedance.com>
      Reviewed-by: default avatarMike Kravetz <mike.kravetz@oracle.com>
      Reviewed-by: default avatarOscar Salvador <osalvador@suse.de>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Yang Shi <shy828301@gmail.com>
      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>
      7ffddd49
    • Muchun Song's avatar
      mm: hugetlbfs: fix cannot migrate the fallocated HugeTLB page · 585fc0d2
      Muchun Song authored
      If a new hugetlb page is allocated during fallocate it will not be
      marked as active (set_page_huge_active) which will result in a later
      isolate_huge_page failure when the page migration code would like to
      move that page.  Such a failure would be unexpected and wrong.
      
      Only export set_page_huge_active, just leave clear_page_huge_active as
      static.  Because there are no external users.
      
      Link: https://lkml.kernel.org/r/20210115124942.46403-3-songmuchun@bytedance.com
      Fixes: 70c3547e
      
       (hugetlbfs: add hugetlbfs_fallocate())
      Signed-off-by: default avatarMuchun Song <songmuchun@bytedance.com>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Reviewed-by: default avatarMike Kravetz <mike.kravetz@oracle.com>
      Reviewed-by: default avatarOscar Salvador <osalvador@suse.de>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Yang Shi <shy828301@gmail.com>
      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>
      585fc0d2
  2. Feb 05, 2021
    • Mike Rapoport's avatar
      Revert "x86/setup: don't remove E820_TYPE_RAM for pfn 0" · 5c279c4c
      Mike Rapoport authored
      This reverts commit bde9cfa3
      
      .
      
      Changing the first memory page type from E820_TYPE_RESERVED to
      E820_TYPE_RAM makes it a part of "System RAM" resource rather than a
      reserved resource and this in turn causes devmem_is_allowed() to treat
      is as area that can be accessed but it is filled with zeroes instead of
      the actual data as previously.
      
      The change in /dev/mem output causes lilo to fail as was reported at
      slakware users forum, and probably other legacy applications will
      experience similar problems.
      
      Link: https://www.linuxquestions.org/questions/slackware-14/slackware-current-lilo-vesa-warnings-after-recent-updates-4175689617/#post6214439
      Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5c279c4c
    • Linus Torvalds's avatar
      Merge tag 'acpi-5.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 927002ed
      Linus Torvalds authored
      Pull ACPI fix from Rafael Wysocki:
       "Address recent regression causing battery devices to be never bound to
        a driver on some systems (Hans de Goede)"
      
      * tag 'acpi-5.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: scan: Fix battery devices sometimes never binding
      927002ed
    • Linus Torvalds's avatar
      Merge tag 'ovl-fixes-5.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs · 4cb2c00c
      Linus Torvalds authored
      Pull overlayfs fixes from Miklos Szeredi:
      
       - Fix capability conversion and minor overlayfs bugs that are related
         to the unprivileged overlay mounts introduced in this cycle.
      
       - Fix two recent (v5.10) and one old (v4.10) bug.
      
       - Clean up security xattr copy-up (related to a SELinux regression).
      
      * tag 'ovl-fixes-5.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs:
        ovl: implement volatile-specific fsync error behaviour
        ovl: skip getxattr of security labels
        ovl: fix dentry leak in ovl_get_redirect
        ovl: avoid deadlock on directory ioctl
        cap: fix conversions on getxattr
        ovl: perform vfs_getxattr() with mounter creds
        ovl: add warning on user_ns mismatch
      4cb2c00c
  3. Feb 04, 2021
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml · 61556703
      Linus Torvalds authored
      Pull UML fixes from Richard Weinberger:
      
       - Make sure to set a default console, otherwise ttynull is selected
      
       - Revert initial ARCH_HAS_SET_MEMORY support, this needs more work
      
       - Fix a regression due to ubd refactoring
      
       - Various small fixes
      
      * tag 'for-linus-5.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
        um: time: fix initialization in time-travel mode
        um: fix os_idle_sleep() to not hang
        Revert "um: support some of ARCH_HAS_SET_MEMORY"
        Revert "um: allocate a guard page to helper threads"
        um: virtio: free vu_dev only with the contained struct device
        um: kmsg_dumper: always dump when not tty console
        um: stdio_console: Make preferred console
        um: return error from ioremap()
        um: ubd: fix command line handling of ubd
      61556703
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 3afe9076
      Linus Torvalds authored
      Pull arm64 fixes from Catalin Marinas:
       "Fix the arm64 linear map range detection for tagged addresses and
        replace the bitwise operations with subtract (virt_addr_valid(),
        __is_lm_address(), __lm_to_phys())"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: Use simpler arithmetics for the linear map macros
        arm64: Do not pass tagged addresses to __is_lm_address()
      3afe9076
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · dbc15d24
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
      
       - Initialize tracing-graph-pause at task creation, not start of
         function tracing, to avoid corrupting the pause counter.
      
       - Set "pause-on-trace" for latency tracers as that option breaks their
         output (regression).
      
       - Fix the wrong error return for setting kretprobes on future modules
         (before they are loaded).
      
       - Fix re-registering the same kretprobe.
      
       - Add missing value check for added RCU variable reload.
      
      * tag 'trace-v5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracepoint: Fix race between tracing and removing tracepoint
        kretprobe: Avoid re-registration of the same kretprobe earlier
        tracing/kprobe: Fix to support kretprobe events on unloaded modules
        tracing: Use pause-on-trace with the latency tracers
        fgraph: Initialize tracing_graph_pause at task creation
      dbc15d24
    • Linus Torvalds's avatar
      Merge tag 'arm-soc-fixes-v5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · 54fe3ffe
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "The code fixes in this round are all for the Texas Instruments OMAP
        platform, addressing several regressions related to the ti-sysc
        interconnect changes that was merged in linux-5.11 and one recently
        introduced RCU usage warning.
      
        Tero Kristo updates his maintainer file entries as he is changing to a
        new employer.
      
        The other changes are for devicetree files across eight different
        platforms:
      
        TI OMAP:
         - multiple gpio related one-line fixes
      
        Allwinner/sunxi:
         - ARM: dts: sun7i: a20: bananapro: Fix ethernet phy-mode
         - soc: sunxi: mbus: Remove DE2 display engine compatibles
      
        NXP lpc32xx:
         - ARM: dts: lpc32xx: Revert set default clock rate of HCLK PLL
      
        STMicroelectronics stm32
         - multiple minor fixes for DHCOM/DHCOR boards
      
        NXP Layerscape:
         - Fix DCFG address range on LS1046A SoC
      
        Amlogic meson:
         - fix reboot issue on odroid C4
         - revert an ethernet change that caused a regression
         - meson-g12: Set FL-adj property value
      
        Rockchip:
         - multiple minor fixes on 64-bit rockchip machines
      
        Qualcomm:
         - Regression fixes for Lenovo Yoga touchpad and for interconnect
           configuration
         - Boot fixes for 'LPASS' clock configuration on two machines"
      
      * tag 'arm-soc-fixes-v5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (31 commits)
        ARM: dts: lpc32xx: Revert set default clock rate of HCLK PLL
        ARM: dts: sun7i: a20: bananapro: Fix ethernet phy-mode
        arm64: dts: ls1046a: fix dcfg address range
        soc: sunxi: mbus: Remove DE2 display engine compatibles
        arm64: dts: meson: switch TFLASH_VDD_EN pin to open drain on Odroid-C4
        Revert "arm64: dts: amlogic: add missing ethernet reset ID"
        arm64: dts: rockchip: Disable display for NanoPi R2S
        ARM: dts: omap4-droid4: Fix lost keypad slide interrupts for droid4
        arm64: dts: rockchip: remove interrupt-names property from rk3399 vdec node
        drivers: bus: simple-pm-bus: Fix compatibility with simple-bus for auxdata
        ARM: OMAP2+: Fix booting for am335x after moving to simple-pm-bus
        ARM: OMAP2+: Fix suspcious RCU usage splats for omap_enter_idle_coupled
        ARM: dts: stm32: Fix GPIO hog flags on DHCOM DRC02
        ARM: dts: stm32: Fix GPIO hog flags on DHCOM PicoITX
        ARM: dts: stm32: Fix GPIO hog names on DHCOM
        ARM: dts: stm32: Disable optional TSC2004 on DRC02 board
        ARM: dts: stm32: Disable WP on DHCOM uSD slot
        ARM: dts: stm32: Connect card-detect signal on DHCOM
        ARM: dts: stm32: Fix polarity of the DH DRC02 uSD card detect
        arm64: dts: qcom: sdm845: Reserve LPASS clocks in gcc
        ...
      54fe3ffe
    • Linus Torvalds's avatar
      Merge tag 'gpio-fixes-for-v5.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux · 40615974
      Linus Torvalds authored
      Pull gpio fixes from Bartosz Golaszewski:
       "Some more fixes from the GPIO subsystem for this release. This time
        it's only core fixes:
      
         - fix a memory leak in error path in gpiolib
      
         - clear debounce period in output mode in the character device code
      
         - remove shadowed variable"
      
      * tag 'gpio-fixes-for-v5.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
        gpio: gpiolib: remove shadowed variable
        gpiolib: free device name on error path to fix kmemleak
        gpiolib: cdev: clear debounce period if line set to output
      40615974
    • Linus Torvalds's avatar
      Merge tag 'platform-drivers-x86-v5.11-3' of... · 4aa2fb4e
      Linus Torvalds authored
      Merge tag 'platform-drivers-x86-v5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
      
      Pull x86 platform driver fixes from Hans de Goede:
       "Two last minute small but important fixes.
      
        The hp-wmi change fixes an issue which is actively being hit by users:
      
          https://bugzilla.redhat.com/show_bug.cgi?id=1918255
          https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3564
      
        And the dell-wmi-sysman patch fixes a bug in the new dell-wmi-sysman
        driver which causes some systems to hang at boot when the driver
        loads"
      
      * tag 'platform-drivers-x86-v5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
        platform/x86: dell-wmi-sysman: fix a NULL pointer dereference
        platform/x86: hp-wmi: Disable tablet-mode reporting by default
      4aa2fb4e
  4. Feb 03, 2021
    • Arnd Bergmann's avatar
      Merge tag 'sunxi-fixes-for-5.11-2' of... · 459630a3
      Arnd Bergmann authored
      
      Merge tag 'sunxi-fixes-for-5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into arm/fixes
      
      One fix for a phy-mode ethernet issue, and one to fix the display output on
      SoCs with the Display Engine 2
      
      * tag 'sunxi-fixes-for-5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
        ARM: dts: sun7i: a20: bananapro: Fix ethernet phy-mode
        soc: sunxi: mbus: Remove DE2 display engine compatibles
      
      Link: https://lore.kernel.org/r/f8298059-f9ca-43b4-9e29-35bc0e0c9b15.lettre@localhost
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      459630a3
    • Alexandre Belloni's avatar
      ARM: dts: lpc32xx: Revert set default clock rate of HCLK PLL · 5638159f
      Alexandre Belloni authored
      This reverts commit c17e9377
      
      .
      
      The lpc32xx clock driver is not able to actually change the PLL rate as
      this would require reparenting ARM_CLK, DDRAM_CLK, PERIPH_CLK to SYSCLK,
      then stop the PLL, update the register, restart the PLL and wait for the
      PLL to lock and finally reparent ARM_CLK, DDRAM_CLK, PERIPH_CLK to HCLK
      PLL.
      
      Currently, the HCLK driver simply updates the registers but this has no
      real effect and all the clock rate calculation end up being wrong. This is
      especially annoying for the peripheral (e.g. UARTs, I2C, SPI).
      
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      Tested-by: default avatarGregory CLEMENT <gregory.clement@bootlin.com>
      Link: https://lore.kernel.org/r/20210203090320.GA3760268@piout.net'
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      5638159f
    • Hermann Lauer's avatar
      ARM: dts: sun7i: a20: bananapro: Fix ethernet phy-mode · a900cac3
      Hermann Lauer authored
      BPi Pro needs TX and RX delay for Gbit to work reliable and avoid high
      packet loss rates. The realtek phy driver overrides the settings of the
      pull ups for the delays, so fix this for BananaPro.
      
      Fix the phy-mode description to correctly reflect this so that the
      implementation doesn't reconfigure the delays incorrectly. This
      happened with commit bbc4d71d ("net: phy: realtek: fix rtl8211e
      rx/tx delay config").
      
      Fixes: 10662a33
      
       ("ARM: dts: sun7i: Add dts file for Bananapro board")
      Signed-off-by: default avatarHermann Lauer <Hermann.Lauer@uni-heidelberg.de>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20210128111842.GA11919@lemon.iwr.uni-heidelberg.de
      a900cac3
    • Arnd Bergmann's avatar
      Merge tag 'imx-fixes-5.11-3' of... · 62c31574
      Arnd Bergmann authored
      
      Merge tag 'imx-fixes-5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes
      
      i.MX fixes for 5.11, round 3:
      
      - Fix DCFG address range on LS1046A SoC.
      
      * tag 'imx-fixes-5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
        arm64: dts: ls1046a: fix dcfg address range
      
      Link: https://lore.kernel.org/r/20210202071441.GP907@dragon
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      62c31574
    • Linus Torvalds's avatar
      Merge tag 'clang-format-for-linux-v5.11-rc7' of git://github.com/ojeda/linux · 3aaf0a27
      Linus Torvalds authored
      Pull clang-format update from Miguel Ojeda:
       "Update with the latest for_each macro list"
      
      * tag 'clang-format-for-linux-v5.11-rc7' of git://github.com/ojeda/linux:
        clang-format: Update with the latest for_each macro list
      3aaf0a27
    • Linus Torvalds's avatar
      Merge tag 'dma-mapping-5.11-1' of git://git.infradead.org/users/hch/dma-mapping · 7d36ccd4
      Linus Torvalds authored
      Pull dma-mapping fix from Christoph Hellwig:
       "Fix a kernel crash in the new dma-mapping benchmark test (Barry Song)"
      
      * tag 'dma-mapping-5.11-1' of git://git.infradead.org/users/hch/dma-mapping:
        dma-mapping: benchmark: fix kernel crash when dma_map_single fails
      7d36ccd4
    • Linus Torvalds's avatar
      Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost · 2e02677e
      Linus Torvalds authored
      Pull vdpa fix from Michael Tsirkin:
       "A single mlx bugfix"
      
      * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
        vdpa/mlx5: Fix memory key MTT population
      2e02677e
    • Linus Torvalds's avatar
      Merge tag 'net-5.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · a9925628
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Networking fixes for 5.11-rc7, including fixes from bpf and mac80211
        trees.
      
        Current release - regressions:
      
         - ip_tunnel: fix mtu calculation
      
         - mlx5: fix function calculation for page trees
      
        Previous releases - regressions:
      
         - vsock: fix the race conditions in multi-transport support
      
         - neighbour: prevent a dead entry from updating gc_list
      
         - dsa: mv88e6xxx: override existent unicast portvec in port_fdb_add
      
        Previous releases - always broken:
      
         - bpf, cgroup: two copy_{from,to}_user() warn_on_once splats for BPF
           cgroup getsockopt infra when user space is trying to race against
           optlen, from Loris Reiff.
      
         - bpf: add missing fput() in BPF inode storage map update helper
      
         - udp: ipv4: manipulate network header of NATed UDP GRO fraglist
      
         - mac80211: fix station rate table updates on assoc
      
         - r8169: work around RTL8125 UDP HW bug
      
         - igc: report speed and duplex as unknown when device is runtime
           suspended
      
         - rxrpc: fix deadlock around release of dst cached on udp tunnel"
      
      * tag 'net-5.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (36 commits)
        net: hsr: align sup_multicast_addr in struct hsr_priv to u16 boundary
        net: ipa: fix two format specifier errors
        net: ipa: use the right accessor in ipa_endpoint_status_skip()
        net: ipa: be explicit about endianness
        net: ipa: add a missing __iomem attribute
        net: ipa: pass correct dma_handle to dma_free_coherent()
        r8169: fix WoL on shutdown if CONFIG_DEBUG_SHIRQ is set
        net/rds: restrict iovecs length for RDS_CMSG_RDMA_ARGS
        net: mvpp2: TCAM entry enable should be written after SRAM data
        net: lapb: Copy the skb before sending a packet
        net/mlx5e: Release skb in case of failure in tc update skb
        net/mlx5e: Update max_opened_tc also when channels are closed
        net/mlx5: Fix leak upon failure of rule creation
        net/mlx5: Fix function calculation for page trees
        docs: networking: swap words in icmp_errors_use_inbound_ifaddr doc
        udp: ipv4: manipulate network header of NATed UDP GRO fraglist
        net: ip_tunnel: fix mtu calculation
        vsock: fix the race conditions in multi-transport support
        net: sched: replaced invalid qdisc tree flush helper in qdisc_replace
        ibmvnic: device remove has higher precedence over reset
        ...
      a9925628
    • Catalin Marinas's avatar
      arm64: Use simpler arithmetics for the linear map macros · 22cd5edb
      Catalin Marinas authored
      
      
      Because of the tagged addresses, the __is_lm_address() and
      __lm_to_phys() macros grew to some harder to understand bitwise
      operations using PAGE_OFFSET. Since these macros only accept untagged
      addresses, use a simple subtract operation.
      
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Cc: Will Deacon <will@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Link: https://lore.kernel.org/r/20210201190634.22942-3-catalin.marinas@arm.com
      22cd5edb
    • Catalin Marinas's avatar
      arm64: Do not pass tagged addresses to __is_lm_address() · 91cb2c8b
      Catalin Marinas authored
      Commit 519ea6f1 ("arm64: Fix kernel address detection of
      __is_lm_address()") fixed the incorrect validation of addresses below
      PAGE_OFFSET. However, it no longer allowed tagged addresses to be passed
      to virt_addr_valid().
      
      Fix this by explicitly resetting the pointer tag prior to invoking
      __is_lm_address(). This is consistent with the __lm_to_phys() macro.
      
      Fixes: 519ea6f1
      
       ("arm64: Fix kernel address detection of __is_lm_address()")
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Cc: <stable@vger.kernel.org> # 5.4.x
      Cc: Will Deacon <will@kernel.org>
      Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Link: https://lore.kernel.org/r/20210201190634.22942-2-catalin.marinas@arm.com
      91cb2c8b
    • Andreas Oetken's avatar
      net: hsr: align sup_multicast_addr in struct hsr_priv to u16 boundary · 6c9f18f2
      Andreas Oetken authored
      
      
      sup_multicast_addr is passed to ether_addr_equal for address comparison
      which casts the address inputs to u16 leading to an unaligned access.
      Aligning the sup_multicast_addr to u16 boundary fixes the issue.
      
      Signed-off-by: default avatarAndreas Oetken <andreas.oetken@siemens.com>
      Link: https://lore.kernel.org/r/20210202090304.2740471-1-ennoerlangen@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6c9f18f2
    • Jakub Kicinski's avatar
      Merge tag 'mlx5-fixes-2021-02-01' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · 5a4cb546
      Jakub Kicinski authored
      
      
      Saeed Mahameed says:
      
      ====================
      mlx5 fixes 2021-02-01
      
      Please note the first patch in this series
      ("Fix function calculation for page trees") is fixing a regression
      due to previous fix in net which you didn't include in your previous
      rc pr. So I hope this series will make it into your next rc pr,
      so mlx5 won't be broken in the next rc.
      
      * tag 'mlx5-fixes-2021-02-01' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux:
        net/mlx5e: Release skb in case of failure in tc update skb
        net/mlx5e: Update max_opened_tc also when channels are closed
        net/mlx5: Fix leak upon failure of rule creation
        net/mlx5: Fix function calculation for page trees
      ====================
      
      Link: https://lore.kernel.org/r/20210202070703.617251-1-saeed@kernel.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      5a4cb546
    • Jakub Kicinski's avatar
      Merge branch 'net-ipa-a-few-bug-fixes' · f2539e14
      Jakub Kicinski authored
      
      
      Alex Elder says:
      
      ====================
      net: ipa: a few bug fixes
      
      This series fixes four minor bugs.  The first two are things that
      sparse points out.  All four are very simple and each patch should
      explain itself pretty well.
      ====================
      
      Link: https://lore.kernel.org/r/20210201232609.3524451-1-elder@linaro.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f2539e14
    • Alex Elder's avatar
      net: ipa: fix two format specifier errors · 113b6ea0
      Alex Elder authored
      
      
      Fix two format specifiers that used %lu for a size_t in "ipa_mem.c".
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      113b6ea0
    • Alex Elder's avatar
      net: ipa: use the right accessor in ipa_endpoint_status_skip() · c13899f1
      Alex Elder authored
      
      
      When extracting the destination endpoint ID from the status in
      ipa_endpoint_status_skip(), u32_get_bits() is used.  This happens to
      work, but it's wrong: the structure field is only 8 bits wide
      instead of 32.
      
      Fix this by using u8_get_bits() to get the destination endpoint ID.
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      c13899f1
    • Alex Elder's avatar
      net: ipa: be explicit about endianness · 088f8a23
      Alex Elder authored
      
      
      Sparse warns that the assignment of the metadata mask for a QMAP
      endpoint in ipa_endpoint_init_hdr_metadata_mask() is a bad
      assignment.  We know we want the mask value to be big endian, even
      though the value we write is in host byte order.  Use a __force
      tag to indicate we really mean it.
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      088f8a23
    • Alex Elder's avatar
      net: ipa: add a missing __iomem attribute · e6cdd6d8
      Alex Elder authored
      
      
      The virt local variable in gsi_channel_state() does not have an
      __iomem attribute but should.  Fix this.
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Reviewed-by: default avatarAmy Parker <enbyamy@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      e6cdd6d8
    • Dan Carpenter's avatar
      net: ipa: pass correct dma_handle to dma_free_coherent() · 4ace7a6e
      Dan Carpenter authored
      The "ring->addr = addr;" assignment is done a few lines later so we
      can't use "ring->addr" yet.  The correct dma_handle is "addr".
      
      Fixes: 650d1603
      
       ("soc: qcom: ipa: the generic software interface")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: default avatarAlex Elder <elder@linaro.org>
      Link: https://lore.kernel.org/r/YBjpTU2oejkNIULT@mwanda
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4ace7a6e
    • Heiner Kallweit's avatar
      r8169: fix WoL on shutdown if CONFIG_DEBUG_SHIRQ is set · cc9f07a8
      Heiner Kallweit authored
      So far phy_disconnect() is called before free_irq(). If CONFIG_DEBUG_SHIRQ
      is set and interrupt is shared, then free_irq() creates an "artificial"
      interrupt by calling the interrupt handler. The "link change" flag is set
      in the interrupt status register, causing phylib to eventually call
      phy_suspend(). Because the net_device is detached from the PHY already,
      the PHY driver can't recognize that WoL is configured and powers down the
      PHY.
      
      Fixes: f1e911d5
      
       ("r8169: add basic phylib support")
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Link: https://lore.kernel.org/r/fe732c2c-a473-9088-3974-df83cfbd6efd@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      cc9f07a8
    • Sabyrzhan Tasbolatov's avatar
      net/rds: restrict iovecs length for RDS_CMSG_RDMA_ARGS · a11148e6
      Sabyrzhan Tasbolatov authored
      
      
      syzbot found WARNING in rds_rdma_extra_size [1] when RDS_CMSG_RDMA_ARGS
      control message is passed with user-controlled
      0x40001 bytes of args->nr_local, causing order >= MAX_ORDER condition.
      
      The exact value 0x40001 can be checked with UIO_MAXIOV which is 0x400.
      So for kcalloc() 0x400 iovecs with sizeof(struct rds_iovec) = 0x10
      is the closest limit, with 0x10 leftover.
      
      Same condition is currently done in rds_cmsg_rdma_args().
      
      [1] WARNING: mm/page_alloc.c:5011
      [..]
      Call Trace:
       alloc_pages_current+0x18c/0x2a0 mm/mempolicy.c:2267
       alloc_pages include/linux/gfp.h:547 [inline]
       kmalloc_order+0x2e/0xb0 mm/slab_common.c:837
       kmalloc_order_trace+0x14/0x120 mm/slab_common.c:853
       kmalloc_array include/linux/slab.h:592 [inline]
       kcalloc include/linux/slab.h:621 [inline]
       rds_rdma_extra_size+0xb2/0x3b0 net/rds/rdma.c:568
       rds_rm_size net/rds/send.c:928 [inline]
      
      Reported-by: default avatar <syzbot+1bd2b07f93745fa38425@syzkaller.appspotmail.com>
      Signed-off-by: default avatarSabyrzhan Tasbolatov <snovitoll@gmail.com>
      Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@oracle.com>
      Link: https://lore.kernel.org/r/20210201203233.1324704-1-snovitoll@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a11148e6
    • Stefan Chulski's avatar
      net: mvpp2: TCAM entry enable should be written after SRAM data · 43f4a20a
      Stefan Chulski authored
      Last TCAM data contains TCAM enable bit.
      It should be written after SRAM data before entry enabled.
      
      Fixes: 3f518509
      
       ("ethernet: Add new driver for Marvell Armada 375 network unit")
      Signed-off-by: default avatarStefan Chulski <stefanc@marvell.com>
      Link: https://lore.kernel.org/r/1612172139-28343-1-git-send-email-stefanc@marvell.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      43f4a20a