Skip to content
  1. Oct 15, 2017
  2. Oct 14, 2017
    • Linus Torvalds's avatar
      Merge branch '4.14-fixes' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · be1f16ba
      Linus Torvalds authored
      Pull MIPS fixes from Ralf Baechle:
       "More MIPS fixes for 4.14:
      
         - Loongson 1: Set the default number of RX and TX queues to
           accomodate for recent changes of stmmac driver.
      
         - BPF: Fix uninitialised target compiler error.
      
         - Fix cmpxchg on 32 bit signed ints for 64 bit kernels with
           !kernel_uses_llsc
      
         - Fix generic-board-config.sh for builds using O=
      
         - Remove pr_err() calls from fpu_emu() for a case which is not a
           kernel error"
      
      * '4.14-fixes' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
        MIPS: math-emu: Remove pr_err() calls from fpu_emu()
        MIPS: Fix generic-board-config.sh for builds using O=
        MIPS: Fix cmpxchg on 32b signed ints for 64b kernel with !kernel_uses_llsc
        MIPS: loongson1: set default number of rx and tx queues for stmmac
        MIPS: bpf: Fix uninitialised target compiler error
      be1f16ba
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-for-v4.14-rc5' of git://people.freedesktop.org/~airlied/linux · 9aa0d2dd
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Couple of the arm people seem to wake up so this has imx and msm
        fixes, along with a bunch of i915 stable bounds fixes and an amdgpu
        regression fix.
      
        All seems pretty okay for now"
      
      * tag 'drm-fixes-for-v4.14-rc5' of git://people.freedesktop.org/~airlied/linux:
        drm/msm: fix _NO_IMPLICIT fencing case
        drm/msm: fix error path cleanup
        drm/msm/mdp5: Remove extra pm_runtime_put call in mdp5_crtc_cursor_set()
        drm/msm/dsi: Use correct pm_runtime_put variant during host_init
        drm/msm: fix return value check in _msm_gem_kernel_new()
        drm/msm: use proper memory barriers for updating tail/head
        drm/msm/mdp5: add missing max size for 8x74 v1
        drm/amdgpu: fix placement flags in amdgpu_ttm_bind
        drm/i915/bios: parse DDI ports also for CHV for HDMI DDC pin and DP AUX channel
        gpu: ipu-v3: pre: implement workaround for ERR009624
        gpu: ipu-v3: prg: wait for double buffers to be filled on channel startup
        gpu: ipu-v3: Allow channel burst locking on i.MX6 only
        drm/i915: Read timings from the correct transcoder in intel_crtc_mode_get()
        drm/i915: Order two completing nop_submit_request
        drm/i915: Silence compiler warning for hsw_power_well_enable()
        drm/i915: Use crtc_state_is_legacy_gamma in intel_color_check
        drm/i915/edp: Increase the T12 delay quirk to 1300ms
        drm/i915/edp: Get the Panel Power Off timestamp after panel is off
        sync_file: Return consistent status in SYNC_IOC_FILE_INFO
        drm/atomic: Unref duplicated drm_atomic_state in drm_atomic_helper_resume()
      9aa0d2dd
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2017-10-11' of... · a480f308
      Dave Airlie authored
      Merge tag 'drm-intel-fixes-2017-10-11' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
      
      drm/i915 fixes for 4.14-rc5:
      
      Three fixes for stable:
      
      - Use crtc_state_is_legacy_gamma in intel_color_check (Maarten)
      - Read timings from the correct transcoder (Ville).
      - Fix HDMI on BSW (Jani).
      
      Other fixes:
      
      - eDP fixes (Manasi)
      - Silence compiler warnings (Chris)
      - Order two completing nop_submit_request (Chris)
      
      * tag 'drm-intel-fixes-2017-10-11' of git://anongit.freedesktop.org/drm/drm-intel:
        drm/i915/bios: parse DDI ports also for CHV for HDMI DDC pin and DP AUX channel
        drm/i915: Read timings from the correct transcoder in intel_crtc_mode_get()
        drm/i915: Order two completing nop_submit_request
        drm/i915: Silence compiler warning for hsw_power_well_enable()
        drm/i915: Use crtc_state_is_legacy_gamma in intel_color_check
        drm/i915/edp: Increase the T12 delay quirk to 1300ms
        drm/i915/edp: Get the Panel Power Off timestamp after panel is off
      a480f308
    • Dave Airlie's avatar
      Merge branch 'msm-fixes-4.14-rc4' of git://people.freedesktop.org/~robclark/linux into drm-fixes · 7a5bea77
      Dave Airlie authored
      bunch of msm fixes
      
      * 'msm-fixes-4.14-rc4' of git://people.freedesktop.org/~robclark/linux:
        drm/msm: fix _NO_IMPLICIT fencing case
        drm/msm: fix error path cleanup
        drm/msm/mdp5: Remove extra pm_runtime_put call in mdp5_crtc_cursor_set()
        drm/msm/dsi: Use correct pm_runtime_put variant during host_init
        drm/msm: fix return value check in _msm_gem_kernel_new()
        drm/msm: use proper memory barriers for updating tail/head
        drm/msm/mdp5: add missing max size for 8x74 v1
      7a5bea77
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 06d97c58
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "18 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        mm, swap: use page-cluster as max window of VMA based swap readahead
        mm: page_vma_mapped: ensure pmd is loaded with READ_ONCE outside of lock
        kmemleak: clear stale pointers from task stacks
        fs/binfmt_misc.c: node could be NULL when evicting inode
        fs/mpage.c: fix mpage_writepage() for pages with buffers
        linux/kernel.h: add/correct kernel-doc notation
        tty: fall back to N_NULL if switching to N_TTY fails during hangup
        Revert "vmalloc: back off when the current task is killed"
        mm/cma.c: take __GFP_NOWARN into account in cma_alloc()
        scripts/kallsyms.c: ignore symbol type 'n'
        userfaultfd: selftest: exercise -EEXIST only in background transfer
        mm: only display online cpus of the numa node
        mm: remove unnecessary WARN_ONCE in page_vma_mapped_walk().
        mm/mempolicy: fix NUMA_INTERLEAVE_HIT counter
        include/linux/of.h: provide of_n_{addr,size}_cells wrappers for !CONFIG_OF
        mm/madvise.c: add description for MADV_WIPEONFORK and MADV_KEEPONFORK
        lib/Kconfig.debug: kernel hacking menu: runtime testing: keep tests together
        mm/migrate: fix indexing bug (off by one) and avoid out of bound access
      06d97c58
    • Huang Ying's avatar
      mm, swap: use page-cluster as max window of VMA based swap readahead · 61b63972
      Huang Ying authored
      When the VMA based swap readahead was introduced, a new knob
      
        /sys/kernel/mm/swap/vma_ra_max_order
      
      was added as the max window of VMA swap readahead.  This is to make it
      possible to use different max window for VMA based readahead and
      original physical readahead.  But Minchan Kim pointed out that this will
      cause a regression because setting page-cluster sysctl to zero cannot
      disable swap readahead with the change.
      
      To fix the regression, the page-cluster sysctl is used as the max window
      of both the VMA based swap readahead and original physical swap
      readahead.  If more fine grained control is needed in the future, more
      knobs can be added as the subordinate knobs of the page-cluster sysctl.
      
      The vma_ra_max_order knob is deleted.  Because the knob was introduced
      in v4.14-rc1, and this patch is targeting being merged before v4.14
      releasing, there should be no existing users of this newly added ABI.
      
      Link: http://lkml.kernel.org/r/20171011070847.16003-1-ying.huang@intel.com
      Fixes: ec560175
      
       ("mm, swap: VMA based swap readahead")
      Signed-off-by: default avatar"Huang, Ying" <ying.huang@intel.com>
      Reported-by: default avatarMinchan Kim <minchan@kernel.org>
      Acked-by: default avatarMinchan Kim <minchan@kernel.org>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Shaohua Li <shli@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Tim Chen <tim.c.chen@intel.com>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      61b63972
    • Will Deacon's avatar
      mm: page_vma_mapped: ensure pmd is loaded with READ_ONCE outside of lock · a7b10095
      Will Deacon authored
      Loading the pmd without holding the pmd_lock exposes us to races with
      concurrent updaters of the page tables but, worse still, it also allows
      the compiler to cache the pmd value in a register and reuse it later on,
      even if we've performed a READ_ONCE in between and seen a more recent
      value.
      
      In the case of page_vma_mapped_walk, this leads to the following crash
      when the pmd loaded for the initial pmd_trans_huge check is all zeroes
      and a subsequent valid table entry is loaded by check_pmd.  We then
      proceed into map_pte, but the compiler re-uses the zero entry inside
      pte_offset_map, resulting in a junk pointer being installed in
      pvmw->pte:
      
        PC is at check_pte+0x20/0x170
        LR is at page_vma_mapped_walk+0x2e0/0x540
        [...]
        Process doio (pid: 2463, stack limit = 0xffff00000f2e8000)
        Call trace:
          check_pte+0x20/0x170
          page_vma_mapped_walk+0x2e0/0x540
          page_mkclean_one+0xac/0x278
          rmap_walk_file+0xf0/0x238
          rmap_walk+0x64/0xa0
          page_mkclean+0x90/0xa8
          clear_page_dirty_for_io+0x84/0x2a8
          mpage_submit_page+0x34/0x98
          mpage_process_page_bufs+0x164/0x170
          mpage_prepare_extent_to_map+0x134/0x2b8
          ext4_writepages+0x484/0xe30
          do_writepages+0x44/0xe8
          __filemap_fdatawrite_range+0xbc/0x110
          file_write_and_wait_range+0x48/0xd8
          ext4_sync_file+0x80/0x4b8
          vfs_fsync_range+0x64/0xc0
          SyS_msync+0x194/0x1e8
      
      This patch fixes the problem by ensuring that READ_ONCE is used before
      the initial checks on the pmd, and this value is subsequently used when
      checking whether or not the pmd is present.  pmd_check is removed and
      the pmd_present check is inlined directly.
      
      Link: http://lkml.kernel.org/r/1507222630-5839-1-git-send-email-will.deacon@arm.com
      Fixes: f27176cf
      
       ("mm: convert page_mkclean_one() to use page_vma_mapped_walk()")
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Tested-by: default avatarYury Norov <ynorov@caviumnetworks.com>
      Tested-by: default avatarRichard Ruigrok <rruigrok@codeaurora.org>
      Acked-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.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>
      a7b10095
    • Konstantin Khlebnikov's avatar
      kmemleak: clear stale pointers from task stacks · ca182551
      Konstantin Khlebnikov authored
      
      
      Kmemleak considers any pointers on task stacks as references.  This
      patch clears newly allocated and reused vmap stacks.
      
      Link: http://lkml.kernel.org/r/150728990124.744199.8403409836394318684.stgit@buzz
      Signed-off-by: default avatarKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
      Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ca182551
    • Eryu Guan's avatar
      fs/binfmt_misc.c: node could be NULL when evicting inode · 7e866006
      Eryu Guan authored
      inode->i_private is assigned by a Node pointer only after registering a
      new binary format, so it could be NULL if inode was created by
      bm_fill_super() (or iput() was called by the error path in
      bm_register_write()), and this could result in NULL pointer dereference
      when evicting such an inode.  e.g.  mount binfmt_misc filesystem then
      umount it immediately:
      
        mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc
        umount /proc/sys/fs/binfmt_misc
      
      will result in
      
        BUG: unable to handle kernel NULL pointer dereference at 0000000000000013
        IP: bm_evict_inode+0x16/0x40 [binfmt_misc]
        ...
        Call Trace:
         evict+0xd3/0x1a0
         iput+0x17d/0x1d0
         dentry_unlink_inode+0xb9/0xf0
         __dentry_kill+0xc7/0x170
         shrink_dentry_list+0x122/0x280
         shrink_dcache_parent+0x39/0x90
         do_one_tree+0x12/0x40
         shrink_dcache_for_umount+0x2d/0x90
         generic_shutdown_super+0x1f/0x120
         kill_litter_super+0x29/0x40
         deactivate_locked_super+0x43/0x70
         deactivate_super+0x45/0x60
         cleanup_mnt+0x3f/0x70
         __cleanup_mnt+0x12/0x20
         task_work_run+0x86/0xa0
         exit_to_usermode_loop+0x6d/0x99
         syscall_return_slowpath+0xba/0xf0
         entry_SYSCALL_64_fastpath+0xa3/0xa
      
      Fix it by making sure Node (e) is not NULL.
      
      Link: http://lkml.kernel.org/r/20171010100642.31786-1-eguan@redhat.com
      Fixes: 83f91827
      
       ("exec: binfmt_misc: shift filp_close(interp_file) from kill_node() to bm_evict_inode()")
      Signed-off-by: default avatarEryu Guan <eguan@redhat.com>
      Acked-by: default avatarOleg Nesterov <oleg@redhat.com>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7e866006
    • Matthew Wilcox's avatar
      fs/mpage.c: fix mpage_writepage() for pages with buffers · f892760a
      Matthew Wilcox authored
      
      
      When using FAT on a block device which supports rw_page, we can hit
      BUG_ON(!PageLocked(page)) in try_to_free_buffers().  This is because we
      call clean_buffers() after unlocking the page we've written.  Introduce
      a new clean_page_buffers() which cleans all buffers associated with a
      page and call it from within bdev_write_page().
      
      [akpm@linux-foundation.org: s/PAGE_SIZE/~0U/ per Linus and Matthew]
      Link: http://lkml.kernel.org/r/20171006211541.GA7409@bombadil.infradead.org
      Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      Reported-by: default avatarToshi Kani <toshi.kani@hpe.com>
      Reported-by: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Tested-by: default avatarToshi Kani <toshi.kani@hpe.com>
      Acked-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.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>
      f892760a
    • Randy Dunlap's avatar
      linux/kernel.h: add/correct kernel-doc notation · e8c97af0
      Randy Dunlap authored
      
      
      Add kernel-doc notation for some macros.  Correct kernel-doc comments &
      typos for a few macros.
      
      Link: http://lkml.kernel.org/r/76fa1403-1511-be4c-e9c4-456b43edfad3@infradead.org
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e8c97af0
    • Johannes Weiner's avatar
      tty: fall back to N_NULL if switching to N_TTY fails during hangup · e65c62b1
      Johannes Weiner authored
      We have seen NULL-pointer dereference crashes in tty->disc_data when the
      N_TTY fallback driver failed to open during hangup.  The immediate cause
      of this open to fail has been addressed in the preceding patch to
      vmalloc(), but this code could be more robust.
      
      As Alan pointed out in commit 8a8dabf2
      
       ("tty: handle the case where
      we cannot restore a line discipline"), the N_TTY driver, historically
      the safe fallback that could never fail, can indeed fail, but the
      surrounding code is not prepared to handle this.  To avoid crashes he
      added a new N_NULL driver to take N_TTY's place as the last resort.
      
      Hook that fallback up to the hangup path.  Update tty_ldisc_reinit() to
      reflect the reality that n_tty_open can indeed fail.
      
      Link: http://lkml.kernel.org/r/20171004185959.GC2136@cmpxchg.org
      Signed-off-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Cc: Alan Cox <alan@llwyncelyn.cymru>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Michal Hocko <mhocko@suse.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e65c62b1
    • Johannes Weiner's avatar
      Revert "vmalloc: back off when the current task is killed" · b8c8a338
      Johannes Weiner authored
      This reverts commits 5d17a73a ("vmalloc: back off when the current
      task is killed") and 171012f5 ("mm: don't warn when vmalloc() fails
      due to a fatal signal").
      
      Commit 5d17a73a ("vmalloc: back off when the current task is
      killed") made all vmalloc allocations from a signal-killed task fail.
      We have seen crashes in the tty driver from this, where a killed task
      exiting tries to switch back to N_TTY, fails n_tty_open because of the
      vmalloc failing, and later crashes when dereferencing tty->disc_data.
      
      Arguably, relying on a vmalloc() call to succeed in order to properly
      exit a task is not the most robust way of doing things.  There will be a
      follow-up patch to the tty code to fall back to the N_NULL ldisc.
      
      But the justification to make that vmalloc() call fail like this isn't
      convincing, either.  The patch mentions an OOM victim exhausting the
      memory reserves and thus deadlocking the machine.  But the OOM killer is
      only one, improbable source of fatal signals.  It doesn't make sense to
      fail allocations preemptively with plenty of memory in most cases.
      
      The patch doesn't mention real-life instances where vmalloc sites would
      exhaust memory, which makes it sound more like a theoretical issue to
      begin with.  But just in case, the OOM access to memory reserves has
      been restricted on the allocator side in cd04ae1e ("mm, oom: do not
      rely on TIF_MEMDIE for memory reserves access"), which should take care
      of any theoretical concerns on that front.
      
      Revert this patch, and the follow-up that suppresses the allocation
      warnings when we fail the allocations due to a signal.
      
      Link: http://lkml.kernel.org/r/20171004185906.GB2136@cmpxchg.org
      Fixes:  171012f5
      
       ("mm: don't warn when vmalloc() fails due to a fatal signal")
      Signed-off-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: Alan Cox <alan@llwyncelyn.cymru>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Dmitry Vyukov <dvyukov@google.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>
      b8c8a338
    • Boris Brezillon's avatar
      mm/cma.c: take __GFP_NOWARN into account in cma_alloc() · ef465014
      Boris Brezillon authored
      
      
      cma_alloc() unconditionally prints an INFO message when the CMA
      allocation fails.  Make this message conditional on the non-presence of
      __GFP_NOWARN in gfp_mask.
      
      This patch aims at removing INFO messages that are displayed when the
      VC4 driver tries to allocate buffer objects.  From the driver
      perspective an allocation failure is acceptable, and the driver can
      possibly do something to make following allocation succeed (like
      flushing the VC4 internal cache).
      
      Link: http://lkml.kernel.org/r/20171004125447.15195-1-boris.brezillon@free-electrons.com
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
      Acked-by: default avatarLaura Abbott <labbott@redhat.com>
      Cc: Jaewon Kim <jaewon31.kim@samsung.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ef465014
    • Guenter Roeck's avatar
      scripts/kallsyms.c: ignore symbol type 'n' · 51962a9d
      Guenter Roeck authored
      
      
      gcc on aarch64 may emit synbols of type 'n' if the kernel is built with
      '-frecord-gcc-switches'.  In most cases, those symbols are reported with
      nm as
      
      	000000000000000e n $d
      
      and with objdump as
      
      	0000000000000000 l    d  .GCC.command.line	0000000000000000 .GCC.command.line
      	000000000000000e l       .GCC.command.line	0000000000000000 $d
      
      Those symbols are detected in is_arm_mapping_symbol() and ignored.
      However, if "--prefix-symbols=<prefix>" is configured as well, the
      situation is different.  For example, in efi/libstub, arm64 images are
      built with
      
      	'--prefix-alloc-sections=.init --prefix-symbols=__efistub_'.
      
      In combination with '-frecord-gcc-switches', the symbols are now reported
      by nm as:
      
      	000000000000000e n __efistub_$d
      and by objdump as:
      	0000000000000000 l    d  .GCC.command.line	0000000000000000 .GCC.command.line
      	000000000000000e l       .GCC.command.line	0000000000000000 __efistub_$d
      
      Those symbols are no longer ignored and included in the base address
      calculation.  This results in a base address of 000000000000000e, which
      in turn causes kallsyms to abort with
      
          kallsyms failure:
      	relative symbol value 0xffffff900800a000 out of range in relative mode
      
      The problem is seen in little endian arm64 builds with CONFIG_EFI
      enabled and with '-frecord-gcc-switches' set in KCFLAGS.
      
      Explicitly ignore symbols of type 'n' since those are clearly debug
      symbols.
      
      Link: http://lkml.kernel.org/r/1507136063-3139-1-git-send-email-linux@roeck-us.net
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Acked-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      51962a9d
    • Andrea Arcangeli's avatar
      userfaultfd: selftest: exercise -EEXIST only in background transfer · 7ddd8faf
      Andrea Arcangeli authored
      
      
      I was stress testing some backports and with high load, after some time,
      the latest version of the selftest showed some false positive in
      connection with the uffdio_copy_retry.  This seems to fix it while still
      exercising -EEXIST in the background transfer once in a while.
      
      The fork child will quit after the last UFFDIO_COPY is run, so a
      repeated UFFDIO_COPY may not return -EEXIST.  This change restricts the
      -EEXIST stress to the background transfer where the memory can't go away
      from under it.
      
      Also updated uffdio_zeropage, so the interface is consistent.
      
      Link: http://lkml.kernel.org/r/20171004171541.1495-2-aarcange@redhat.com
      Signed-off-by: default avatarAndrea Arcangeli <aarcange@redhat.com>
      Cc: Pavel Emelyanov <xemul@virtuozzo.com>
      Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
      Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
      Cc: Mike Kravetz <mike.kravetz@oracle.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7ddd8faf
    • Zhen Lei's avatar
      mm: only display online cpus of the numa node · 064f0e93
      Zhen Lei authored
      
      
      When I execute numactl -H (which reads /sys/devices/system/node/nodeX/cpumap
      and displays cpumask_of_node for each node), I get different result
      on X86 and arm64.  For each numa node, the former only displayed online
      CPUs, and the latter displayed all possible CPUs.  Unfortunately, both
      Linux documentation and numactl manual have not described it clear.
      
      I sent a mail to ask for help, and Michal Hocko replied that he
      preferred to print online cpus because it doesn't really make much sense
      to bind anything on offline nodes.
      
      Will said:
       "I suspect the vast majority (if not all) code that reads this file was
        developed for x86, so having the same behaviour for arm64 sounds like
        something we should do ASAP before people try to special case with
        things like #ifdef __aarch64__. I'd rather have this in 4.14 if
        possible."
      
      Link: http://lkml.kernel.org/r/1506678805-15392-2-git-send-email-thunder.leizhen@huawei.com
      Signed-off-by: default avatarZhen Lei <thunder.leizhen@huawei.com>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Tianhong Ding <dingtianhong@huawei.com>
      Cc: Hanjun Guo <guohanjun@huawei.com>
      Cc: Libin <huawei.libin@huawei.com>
      Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      064f0e93
    • Zi Yan's avatar
      mm: remove unnecessary WARN_ONCE in page_vma_mapped_walk(). · af0db981
      Zi Yan authored
      A non present pmd entry can appear after pmd_lock is taken in
      page_vma_mapped_walk(), even if THP migration is not enabled.  The
      WARN_ONCE is unnecessary.
      
      Link: http://lkml.kernel.org/r/20171003142606.12324-1-zi.yan@sent.com
      Fixes: 616b8371
      
       ("mm: thp: enable thp migration in generic path")
      Signed-off-by: default avatarZi Yan <zi.yan@cs.rutgers.edu>
      Reported-by: default avatarAbdul Haleem <abdhalee@linux.vnet.ibm.com>
      Tested-by: default avatarAbdul Haleem <abdhalee@linux.vnet.ibm.com>
      Acked-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      af0db981
    • Andrey Ryabinin's avatar
      mm/mempolicy: fix NUMA_INTERLEAVE_HIT counter · de55c8b2
      Andrey Ryabinin authored
      Commit 3a321d2a ("mm: change the call sites of numa statistics
      items") separated NUMA counters from zone counters, but the
      NUMA_INTERLEAVE_HIT call site wasn't updated to use the new interface.
      So alloc_page_interleave() actually increments NR_ZONE_INACTIVE_FILE
      instead of NUMA_INTERLEAVE_HIT.
      
      Fix this by using __inc_numa_state() interface to increment
      NUMA_INTERLEAVE_HIT.
      
      Link: http://lkml.kernel.org/r/20171003191003.8573-1-aryabinin@virtuozzo.com
      Fixes: 3a321d2a
      
       ("mm: change the call sites of numa statistics items")
      Signed-off-by: default avatarAndrey Ryabinin <aryabinin@virtuozzo.com>
      Acked-by: default avatarMel Gorman <mgorman@techsingularity.net>
      Cc: Kemi Wang <kemi.wang@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      de55c8b2
    • Arnd Bergmann's avatar
      include/linux/of.h: provide of_n_{addr,size}_cells wrappers for !CONFIG_OF · 8a1ac5dc
      Arnd Bergmann authored
      The pci-rcar driver is enabled for compile tests, and this has shown that
      the driver cannot build without CONFIG_OF, following the inclusion of
      commit f8f2fe73 ("PCI: rcar: Use new OF interrupt mapping when possible"):
      
        drivers/pci/host/pcie-rcar.c: In function 'pci_dma_range_parser_init':
        drivers/pci/host/pcie-rcar.c:1039:2: error: implicit declaration of function 'of_n_addr_cells' [-Werror=implicit-function-declaration]
          parser->pna = of_n_addr_cells(node);
          ^
      
      As pointed out by Ben Dooks and Geert Uytterhoeven, this is actually
      supposed to build fine, which we can achieve if we make the declaration
      of of_irq_parse_and_map_pci conditional on CONFIG_OF and provide an
      empty inline function otherwise, as we do for a lot of other of
      interfaces.
      
      This lets us build the rcar_pci driver again without CONFIG_OF for build
      testing.  All platforms using this driver select OF, so this doesn't
      change anything for the users.
      
      [akpm@linux-foundation.org: be consistent with surrounding code]
      Link: http://lkml.kernel.org/r/20170911200805.3363318-1-arnd@arndb.de
      Fixes: c25da477
      
       ("PCI: rcar: Add Renesas R-Car PCIe driver")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarFrank Rowand <frank.rowand@sony.com>
      Acked-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Magnus Damm <damm@opensource.se>
      Cc: Ben Dooks <ben.dooks@codethink.co.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8a1ac5dc
    • Yang Shi's avatar
      mm/madvise.c: add description for MADV_WIPEONFORK and MADV_KEEPONFORK · c02c3009
      Yang Shi authored
      
      
      mm/madvise.c has a brief description about all MADV_ flags.  Add a
      description for the newly added MADV_WIPEONFORK and MADV_KEEPONFORK.
      
      Although man page has the similar information, but it'd better to keep
      the consistent with other flags.
      
      Link: http://lkml.kernel.org/r/1506117328-88228-1-git-send-email-yang.s@alibaba-inc.com
      Signed-off-by: default avatarYang Shi <yang.s@alibaba-inc.com>
      Reviewed-by: default avatarRik van Riel <riel@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c02c3009
    • Randy Dunlap's avatar
      lib/Kconfig.debug: kernel hacking menu: runtime testing: keep tests together · cc3fa840
      Randy Dunlap authored
      
      
      Expand the "Runtime testing" menu by including more entries inside it
      instead of after it.  This is just Kconfig symbol movement.
      
      This causes the (arch-independent) Runtime tests to be presented
      (listed) all in one place instead of in multiple places.
      
      Link: http://lkml.kernel.org/r/c194e5c4-2042-bf94-a2d8-7aa13756e257@infradead.org
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: "Luis R. Rodriguez" <mcgrof@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cc3fa840
    • Mark Hairgrove's avatar
      mm/migrate: fix indexing bug (off by one) and avoid out of bound access · e20d103b
      Mark Hairgrove authored
      Index was incremented before last use and thus the second array could
      dereference to an invalid address (not mentioning the fact that it did
      not properly clear the entry we intended to clear).
      
      Link: http://lkml.kernel.org/r/1506973525-16491-1-git-send-email-jglisse@redhat.com
      Fixes: 8315ada7
      
       ("mm/migrate: allow migrate_vma() to alloc new page on empty entry")
      Signed-off-by: default avatarMark Hairgrove <mhairgrove@nvidia.com>
      Signed-off-by: default avatarJérôme Glisse <jglisse@redhat.com>
      Cc: Reza Arbab <arbab@linux.vnet.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e20d103b
    • Linus Torvalds's avatar
      Merge tag 'pci-v4.14-fixes-5' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · e837d913
      Linus Torvalds authored
      Pull PCI fixes from Bjorn Helgaas:
      
       - revert Tegra MSI change that caused a regression on TrimSlice
         (Thierry Reding)
      
       - finish Aardvark conversion to host bridge IRQ mapping. We missed
         Aardvark the first time around so it regressed (Thomas Petazzoni)
      
      * tag 'pci-v4.14-fixes-5' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        PCI: aardvark: Move to struct pci_host_bridge IRQ mapping functions
        Revert "PCI: tegra: Do not allocate MSI target memory"
      e837d913
    • Linus Torvalds's avatar
      Merge tag 'iommu-fixes-v4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · 997301a8
      Linus Torvalds authored
      Pull IOMMU fixes from Joerg Roedel:
      
       - keep an important data structure in the Exynos driver around after
         kernel-init to fix a kernel-oops
      
       - keep SWIOTLB enabled when SME is active in the AMD IOMMU driver
      
       - add a missing IOTLB sync to the AMD IOMMU driver
      
      * tag 'iommu-fixes-v4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
        iommu/amd: Finish TLB flush in amd_iommu_unmap()
        iommu/exynos: Remove initconst attribute to avoid potential kernel oops
        iommu/amd: Do not disable SWIOTLB if SME is active
      997301a8
    • Linus Torvalds's avatar
      Merge tag 'devicetree-fixes-for-4.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · 0c080cee
      Linus Torvalds authored
      Pull DeviceTree fixes from Rob Herring:
      
       - Fix memory leak in error case of of_console_check
      
       - Increase number of reserved memory regions to 32. 16 was not enough
         on some Power systems.
      
       - Fix OF node refcounting for of_fwnode_graph_get_port_parent
      
      * tag 'devicetree-fixes-for-4.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
        device property: preserve usecount for node passed to of_fwnode_graph_get_port_parent()
        drivers: of: increase MAX_RESERVED_REGIONS to 32
        of: do not leak console options
      0c080cee
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.14-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · e18e8844
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "A fix for a bad bug (written by me) in our livepatch handler. Removal
        of an over-zealous lockdep_assert_cpus_held() in our topology code. A
        fix to the recently added emulation of cntlz[wd]. And three small
        fixes to the recently added IMC PMU driver.
      
        Thanks to: Anju T Sudhakar, Balbir Singh, Kamalesh Babulal, Naveen N.
        Rao, Sandipan Das, Santosh Sivaraj, Thiago Jung Bauermann"
      
      * tag 'powerpc-4.14-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/perf: Fix IMC initialization crash
        powerpc/perf: Add ___GFP_NOWARN flag to alloc_pages_node()
        powerpc/perf: Fix for core/nest imc call trace on cpuhotplug
        powerpc: Don't call lockdep_assert_cpus_held() from arch_update_cpu_topology()
        powerpc/lib/sstep: Fix count leading zeros instructions
        powerpc/livepatch: Fix livepatch stack access
      e18e8844
    • Linus Torvalds's avatar
      Merge tag 'for-linus-4.14c-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 3be5f884
      Linus Torvalds authored
      Pull xen fixlet from Juergen Gross:
       "A minor fix correcting the cpu hotplug name for Xen guests"
      
      * tag 'for-linus-4.14c-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen/vcpu: Use a unified name about cpu hotplug state for pv and pvhvm
      3be5f884
  3. Oct 13, 2017
    • Joerg Roedel's avatar
      iommu/amd: Finish TLB flush in amd_iommu_unmap() · ce76353f
      Joerg Roedel authored
      The function only sends the flush command to the IOMMU(s),
      but does not wait for its completion when it returns. Fix
      that.
      
      Fixes: 601367d7
      
       ('x86/amd-iommu: Remove iommu_flush_domain function')
      Cc: stable@vger.kernel.org # >= 2.6.33
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      ce76353f
    • Anju T Sudhakar's avatar
      powerpc/perf: Fix IMC initialization crash · 0d8ba162
      Anju T Sudhakar authored
      
      
      Panic observed with latest firmware, and upstream kernel:
      
       NIP init_imc_pmu+0x8c/0xcf0
       LR  init_imc_pmu+0x2f8/0xcf0
       Call Trace:
         init_imc_pmu+0x2c8/0xcf0 (unreliable)
         opal_imc_counters_probe+0x300/0x400
         platform_drv_probe+0x64/0x110
         driver_probe_device+0x3d8/0x580
         __driver_attach+0x14c/0x1a0
         bus_for_each_dev+0x8c/0xf0
         driver_attach+0x34/0x50
         bus_add_driver+0x298/0x350
         driver_register+0x9c/0x180
         __platform_driver_register+0x5c/0x70
         opal_imc_driver_init+0x2c/0x40
         do_one_initcall+0x64/0x1d0
         kernel_init_freeable+0x280/0x374
         kernel_init+0x24/0x160
         ret_from_kernel_thread+0x5c/0x74
      
      While registering nest imc at init, cpu-hotplug callback
      nest_pmu_cpumask_init() makes an OPAL call to stop the engine. And if
      the OPAL call fails, imc_common_cpuhp_mem_free() is invoked to cleanup
      memory and cpuhotplug setup.
      
      But when cleaning up the attribute group, we are dereferencing the
      attribute element array without checking whether the backing element
      is not NULL. This causes the kernel panic.
      
      Add a check for the backing element prior to dereferencing the
      attribute element, to handle the failing case gracefully.
      
      Signed-off-by: default avatarAnju T Sudhakar <anju@linux.vnet.ibm.com>
      Reported-by: default avatarPridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
      [mpe: Trim change log]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      0d8ba162
    • Dave Airlie's avatar
      Merge tag 'imx-drm-fixes-2017-10-12' of git://git.pengutronix.de/git/pza/linux into drm-fixes · a6402e80
      Dave Airlie authored
      drm/imx: i.MX5 regression fix and i.MX6QP PRE/PRG stability fixes
      
      - Disable channel burst locking on IPUv3EX (i.MX51) and IPUv3M (i.MX53).
        This fixes a regression introduced by commit 790cb4c7 ("drm/imx: lock
        scanout transfers for consecutive bursts").
      - Give PRG a head start. Waiting for both double buffers to fill up before
        enabling the IPU improves startup reliability.
      - Avoid PRE control register updates during unsafe window, workaround for
        ERR009624.
      
      * tag 'imx-drm-fixes-2017-10-12' of git://git.pengutronix.de/git/pza/linux:
        gpu: ipu-v3: pre: implement workaround for ERR009624
        gpu: ipu-v3: prg: wait for double buffers to be filled on channel startup
        gpu: ipu-v3: Allow channel burst locking on i.MX6 only
      a6402e80
    • Dave Airlie's avatar
      Merge branch 'drm-fixes-4.14' of git://people.freedesktop.org/~agd5f/linux into drm-fixes · 09980771
      Dave Airlie authored
      single amdgpu regression fix.
      
      * 'drm-fixes-4.14' of git://people.freedesktop.org/~agd5f/linux:
        drm/amdgpu: fix placement flags in amdgpu_ttm_bind
      09980771
    • Linus Torvalds's avatar
      Merge tag 'devprop-4.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 3d788276
      Linus Torvalds authored
      Pull device properties framework fixes from Rafael Wysocki:
       "These fix an issue related to device removal introduced during the 4.9
        cycle and fix up new functionality added recently.
      
        Specifics:
      
         - Fix a device properties management issue, introduced during the 4.9
           cycle, that causes device properties associated with a parent
           device to go away on a removal of its child in some cases (Jarkko
           Nikula).
      
         - Fix inconsistencies in error codes returned by a new function
           helper in the device properties framework depending on the
           underlying low-level firmware interface, DT or ACPI, by making the
           meaning of error codes returned in the ACPI case agree with the
           meaning of DT error codes in analogous situations (Sakari Ailus)"
      
      * tag 'devprop-4.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: properties: Fix __acpi_node_get_property_reference() return codes
        ACPI: properties: Align return codes of __acpi_node_get_property_reference()
        device property: Track owner device of device property
      3d788276
    • Linus Torvalds's avatar
      Merge tag 'xfs-4.14-fixes-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 8ff0b97c
      Linus Torvalds authored
      Pull xfs fixes from Darrick Wong:
      
       - Fix a stale kernel memory exposure when logging inodes.
      
       - Fix some build problems with CONFIG_XFS_RT=n
      
       - Don't change inode mode if the acl write fails, leaving the file
         totally inaccessible.
      
       - Fix a dangling pointer problem when removing an attr fork under
         memory pressure.
      
       - Don't crash while trying to invalidate a null buffer associated with
         a corrupt metadata pointer.
      
      * tag 'xfs-4.14-fixes-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: handle error if xfs_btree_get_bufs fails
        xfs: reinit btree pointer on attr tree inactivation walk
        xfs: Fix bool initialization/comparison
        xfs: don't change inode mode if ACL update fails
        xfs: move more RT specific code under CONFIG_XFS_RT
        xfs: Don't log uninitialised fields in inode structures
      8ff0b97c
    • NeilBrown's avatar
      scripts: fix faddr2line to work on last symbol · 2aab9c3c
      NeilBrown authored
      
      
      If faddr2line is given a function name which is the last one listed by
      "nm -n", it will fail because it never finds the next symbol.
      
      So teach the awk script to catch that possibility, and use 'size' to
      provide the end point of the last function.
      
      Signed-off-by: default avatarNeilBrown <neilb@suse.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2aab9c3c
    • Rob Clark's avatar
      drm/msm: fix _NO_IMPLICIT fencing case · 06451a3d
      Rob Clark authored
      We need to call reservation_object_reserve_shared() in both cases, but
      this wasn't happening in the _NO_IMPLICIT submit case.
      
      Fixes: f0a42bb5
      
       ("drm/msm: submit support for in-fences")
      Reported-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      06451a3d
    • Rob Clark's avatar
      drm/msm: fix error path cleanup · 6bd6ae2d
      Rob Clark authored
      
      
      If we fail to attach iommu, gpu->aspace could be IS_ERR()..
      
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      6bd6ae2d
    • Linus Torvalds's avatar
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · 3206e7d5
      Linus Torvalds authored
      Pull quota fix from Jan Kara:
       "A fix for a regression in handling of quota grace times and warnings"
      
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        quota: Generate warnings for DQUOT_SPACE_NOFAIL allocations
      3206e7d5
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · cbaff876
      Linus Torvalds authored
      Pull kvm fixes from Paolo Bonzini:
       "Another latent bug related to PCID, an out-of-bounds access, and a
        submaintainer change being finally made official"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        MAINTAINERS: Add Paul Mackerras as maintainer for KVM/powerpc
        KVM: nVMX: fix guest CR4 loading when emulating L2 to L1 exit
        KVM: MMU: always terminate page walks at level 1
        KVM: nVMX: update last_nonleaf_level when initializing nested EPT
      cbaff876