Skip to content
  1. Aug 18, 2018
    • Arnd Bergmann's avatar
      shmem: use monotonic time for i_generation · 46c9a946
      Arnd Bergmann authored
      
      
      get_seconds() is deprecated because it will lead to a 32-bit overflow in
      2038 or 2106.  We don't need the i_generation to be strictly monotonic
      anyway, and other file systems like ext4 and xfs just use prandom_u32(),
      so let's use the same one here.
      
      If this is considered too slow, we could also use ktime_get_seconds() or
      ktime_get_real_seconds() to keep the previous behavior.  Both of these
      return a time64_t and are not deprecated, but only return a unique value
      once per second, and are predictable.
      
      Link: http://lkml.kernel.org/r/20180620082556.581543-1-arnd@arndb.de
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Mike Kravetz <mike.kravetz@oracle.com>
      Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.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>
      46c9a946
    • Vlastimil Babka's avatar
      mm, page_alloc: actually ignore mempolicies for high priority allocations · d6a24df0
      Vlastimil Babka authored
      __alloc_pages_slowpath() has for a long time contained code to ignore
      node restrictions from memory policies for high priority allocations.
      The current code that resets the zonelist iterator however does
      effectively nothing after commit 7810e678 ("mm, page_alloc: do not
      break __GFP_THISNODE by zonelist reset") removed a buggy zonelist reset.
      Even before that commit, mempolicy restrictions were still not ignored,
      as they are passed in ac->nodemask which is untouched by the code.
      
      We can either remove the code, or make it work as intended.  Since
      ac->nodemask can be set from task's mempolicy via alloc_pages_current()
      and thus also alloc_pages(), it may indeed affect kernel allocations,
      and it makes sense to ignore it to allow progress for high priority
      allocations.
      
      Thus, this patch resets ac->nodemask to NULL in such cases.  This
      assumes all callers can handle it (i.e.  there are no guarantees as in
      the case of __GFP_THISNODE) which seems to be the case.  The same
      assumption is already present in check_retry_cpuset() for some time.
      
      The expected effect is that high priority kernel allocations in the
      context of userspace tasks (e.g.  OOM victims) restricted by mempolicies
      will have higher chance to succeed if they are restricted to nodes with
      depleted memory, while there are other nodes with free memory left.
      
      It's not a new intention, but for the first time the code will match the
      intention, AFAICS.  It was intended by commit 183f6371 ("mm: ignore
      mempolicies when using ALLOC_NO_WATERMARK") in v3.6 but I think it never
      really worked, as mempolicy restriction was already encoded in nodemask,
      not zonelist, at that time.
      
      So originally that was for ALLOC_NO_WATERMARK only.  Then it was
      adjusted by e46e7b77 ("mm, page_alloc: recalculate the preferred
      zoneref if the context can ignore memory policies") and cd04ae1e
      
      
      ("mm, oom: do not rely on TIF_MEMDIE for memory reserves access") to the
      current state.  So even GFP_ATOMIC would now ignore mempolicies after
      the initial attempts fail - if the code worked as people thought it
      does.
      
      Link: http://lkml.kernel.org/r/20180612122624.8045-1-vbabka@suse.cz
      Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Acked-by: default avatarMichal Hocko <mhocko@suse.com>
      Acked-by: default avatarMel Gorman <mgorman@techsingularity.net>
      Cc: David Rientjes <rientjes@google.com>
      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>
      d6a24df0
    • Christian Hansen's avatar
      tools/vm/page-types.c: add support for idle page tracking · 59ae96ff
      Christian Hansen authored
      
      
      Add a flag which causes page-types to use the kernels's idle page
      tracking to mark pages idle.  As the tool already prints the idle flag
      if set, subsequent runs will show which pages have been accessed since
      last run.
      
      [akpm@linux-foundation.org: simplify mark_page_idle()]
      [chansen3@cisco.com: reorganize mark_page_idle() logic, add docs]
        Link: http://lkml.kernel.org/r/20180706172237.21691-1-chansen3@cisco.com
      Link: http://lkml.kernel.org/r/20180612153223.13174-1-chansen3@cisco.com
      Signed-off-by: default avatarChristian Hansen <chansen3@cisco.com>
      Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      59ae96ff
    • Christian Hansen's avatar
      tools/vm/page-types.c: include shared map counts · 7f1d23e6
      Christian Hansen authored
      
      
      Add a new flag that will read kpagecount for each PFN and print out the
      number of times the page is mapped along with the flags in the listing
      view.
      
      This information is useful in understanding and optimizing memory usage.
      Identifying pages which are not shared allows us to focus on adjusting
      the memory layout or access patterns for the sole owning process.
      Knowing the number of processes that share a page tells us how many
      other times we must make the same adjustments or how many processes to
      potentially disable.
      
      Truncated sample output:
      
        voffset map-cnt offset  len     flags
        561a3591e       1       15fe8   1       ___U_lA____Ma_b___________________________
        561a3591f       1       2b103   1       ___U_lA____Ma_b___________________________
        561a36ca4       1       2cc78   1       ___U_lA____Ma_b___________________________
        7f588bb4e       14      2273c   1       __RU_lA____M______________________________
      
      [akpm@linux-foundation.org: coding-style fixes]
      [chansen3@cisco.com: add documentation, tweak whitespace]
        Link: http://lkml.kernel.org/r/20180705181204.5529-1-chansen3@cisco.com
      Link: http://lkml.kernel.org/r/20180612153205.12879-1-chansen3@cisco.com
      Signed-off-by: default avatarChristian Hansen <chansen3@cisco.com>
      Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7f1d23e6
    • Yang Shi's avatar
      thp: use mm_file_counter to determine update which rss counter · fadae295
      Yang Shi authored
      Since commit eca56ff9 ("mm, shmem: add internal shmem resident
      memory accounting"), MM_SHMEMPAGES is added to separate the shmem
      accounting from regular files.  So, all shmem pages should be accounted
      to MM_SHMEMPAGES instead of MM_FILEPAGES.
      
      And, normal 4K shmem pages have been accounted to MM_SHMEMPAGES, so
      shmem thp pages should be not treated differently.  Account them to
      MM_SHMEMPAGES via mm_counter_file() since shmem pages are swap backed to
      keep consistent with normal 4K shmem pages.
      
      This will not change the rss counter of processes since shmem pages are
      still a part of it.
      
      The /proc/pid/status and /proc/pid/statm counters will however be more
      accurate wrt shmem usage, as originally intended.  And as eca56ff9
      
      
      ("mm, shmem: add internal shmem resident memory accounting") mentioned,
      oom also could report more accurate "shmem-rss".
      
      Link: http://lkml.kernel.org/r/1529442518-17398-1-git-send-email-yang.shi@linux.alibaba.com
      Signed-off-by: default avatarYang Shi <yang.shi@linux.alibaba.com>
      Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fadae295
    • Pavel Tatashin's avatar
      mm: skip invalid pages block at a time in zero_resv_unresv() · 720e14eb
      Pavel Tatashin authored
      
      
      The role of zero_resv_unavail() is to make sure that every struct page
      that is allocated but is not backed by memory that is accessible by
      kernel is zeroed and not in some uninitialized state.
      
      Since struct pages are allocated in blocks (2M pages in x86 case), we
      can skip pageblock_nr_pages at a time, when the first one is found to be
      invalid.
      
      This optimization may help since now on x86 every hole in e820 maps is
      marked as reserved in memblock, and thus will go through this function.
      
      This function is called before sched_clock() is initialized, so I used
      my x86 early boot clock patches to measure the performance improvement.
      
      With 1T hole on i7-8700 currently we would take 0.606918s of boot time,
      but with this optimization 0.001103s.
      
      Link: http://lkml.kernel.org/r/20180615155733.1175-1-pasha.tatashin@oracle.com
      Signed-off-by: default avatarPavel Tatashin <pasha.tatashin@oracle.com>
      Reviewed-by: default avatarOscar Salvador <osalvador@suse.de>
      Reviewed-by: default avatarNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Cc: Pasha Tatashin <Pavel.Tatashin@microsoft.com>
      Cc: Steven Sistare <steven.sistare@oracle.com>
      Cc: Daniel Jordan <daniel.m.jordan@oracle.com>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: "Huang, Ying" <ying.huang@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      720e14eb
    • Souptick Joarder's avatar
      mm: convert return type of handle_mm_fault() caller to vm_fault_t · 50a7ca3c
      Souptick Joarder authored
      Use new return type vm_fault_t for fault handler.  For now, this is just
      documenting that the function returns a VM_FAULT value rather than an
      errno.  Once all instances are converted, vm_fault_t will become a
      distinct type.
      
      Ref-> commit 1c8f4220
      
       ("mm: change return type to vm_fault_t")
      
      In this patch all the caller of handle_mm_fault() are changed to return
      vm_fault_t type.
      
      Link: http://lkml.kernel.org/r/20180617084810.GA6730@jordon-HP-15-Notebook-PC
      Signed-off-by: default avatarSouptick Joarder <jrdr.linux@gmail.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Richard Kuo <rkuo@codeaurora.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Ley Foon Tan <lftan@altera.com>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: James E.J. Bottomley <jejb@parisc-linux.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Palmer Dabbelt <palmer@sifive.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      50a7ca3c
    • Vlastimil Babka's avatar
      mm, slub: restore the original intention of prefetch_freepointer() · 0882ff91
      Vlastimil Babka authored
      In SLUB, prefetch_freepointer() is used when allocating an object from
      cache's freelist, to make sure the next object in the list is cache-hot,
      since it's probable it will be allocated soon.
      
      Commit 2482ddec ("mm: add SLUB free list pointer obfuscation") has
      unintentionally changed the prefetch in a way where the prefetch is
      turned to a real fetch, and only the next->next pointer is prefetched.
      In case there is not a stream of allocations that would benefit from
      prefetching, the extra real fetch might add a useless cache miss to the
      allocation.  Restore the previous behavior.
      
      Link: http://lkml.kernel.org/r/20180809085245.22448-1-vbabka@suse.cz
      Fixes: 2482ddec
      
       ("mm: add SLUB free list pointer obfuscation")
      Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      Cc: Daniel Micay <danielmicay@gmail.com>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      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>
      0882ff91
    • NeilBrown's avatar
      fs/seq_file.c: simplify seq_file iteration code and interface · 1f4aace6
      NeilBrown authored
      The documentation for seq_file suggests that it is necessary to be able
      to move the iterator to a given offset, however that is not the case.
      If the iterator is stored in the private data and is stable from one
      read() syscall to the next, it is only necessary to support first/next
      interactions.  Implementing this in a client is a little clumsy.
      
       - if ->start() is given a pos of zero, it should go to start of
         sequence.
      
       - if ->start() is given the name pos that was given to the most recent
         next() or start(), it should restore the iterator to state just
         before that last call
      
       - if ->start is given another number, it should set the iterator one
         beyond the start just before the last ->start or ->next call.
      
      Also, the documentation says that the implementation can interpret the
      pos however it likes (other than zero meaning start), but seq_file
      increments the pos sometimes which does impose on the implementation.
      
      This patch simplifies...
      1f4aace6
    • NeilBrown's avatar
      vfs: discard ATTR_ATTR_FLAG · 4cdfffc8
      NeilBrown authored
      
      
      This flag was introduce in 2.1.37pre1 and the only place it was tested
      was removed in 2.1.43pre1.  The flag was never set.
      
      Let's discard it properly.
      
      Link: http://lkml.kernel.org/r/877en0hewz.fsf@notabene.neil.brown.name
      Signed-off-by: default avatarNeilBrown <neilb@suse.com>
      Cc: Al 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>
      4cdfffc8
    • Tetsuo Handa's avatar
      fs/dcache.c: fix kmemcheck splat at take_dentry_name_snapshot() · 6cd00a01
      Tetsuo Handa authored
      
      
      Since only dentry->d_name.len + 1 bytes out of DNAME_INLINE_LEN bytes
      are initialized at __d_alloc(), we can't copy the whole size
      unconditionally.
      
       WARNING: kmemcheck: Caught 32-bit read from uninitialized memory (ffff8fa27465ac50)
       636f6e66696766732e746d70000000000010000000000000020000000188ffff
        i i i i i i i i i i i i i u u u u u u u u u u i i i i i u u u u
                                        ^
       RIP: 0010:take_dentry_name_snapshot+0x28/0x50
       RSP: 0018:ffffa83000f5bdf8 EFLAGS: 00010246
       RAX: 0000000000000020 RBX: ffff8fa274b20550 RCX: 0000000000000002
       RDX: ffffa83000f5be40 RSI: ffff8fa27465ac50 RDI: ffffa83000f5be60
       RBP: ffffa83000f5bdf8 R08: ffffa83000f5be48 R09: 0000000000000001
       R10: ffff8fa27465ac00 R11: ffff8fa27465acc0 R12: ffff8fa27465ac00
       R13: ffff8fa27465acc0 R14: 0000000000000000 R15: 0000000000000000
       FS:  00007f79737ac8c0(0000) GS:ffffffff8fc30000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: ffff8fa274c0b000 CR3: 0000000134aa7002 CR4: 00000000000606f0
        take_dentry_name_snapshot+0x28/0x50
        vfs_rename+0x128/0x870
        SyS_rename+0x3b2/0x3d0
        entry_SYSCALL_64_fastpath+0x1a/0xa4
        0xffffffffffffffff
      
      Link: http://lkml.kernel.org/r/201709131912.GBG39012.QMJLOVFSFFOOtH@I-love.SAKURA.ne.jp
      Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: Vegard Nossum <vegard.nossum@gmail.com>
      Cc: Al 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>
      6cd00a01
    • Colin Ian King's avatar
      ocfs2: make several functions and variables static (and some const) · 480bd564
      Colin Ian King authored
      
      
      There are a variety of functions and variables that are local to the
      source and do not need to be in global scope, so make them static.  Also
      make a couple of char arrays static const.
      
      Cleans up sparse warnings:
        symbol 'o2hb_heartbeat_mode_desc' was not declared. Should it be static?
        symbol 'o2hb_heartbeat_mode' was not declared. Should it be static?
        symbol 'o2hb_dependent_users' was not declared. Should it be static?
        symbol 'o2hb_region_dec_user' was not declared. Should it be static?
        symbol 'o2nm_fence_method_desc' was not declared. Should it be static?
        symbol 'lockdep_keys' was not declared. Should it be static?
      
      Link: http://lkml.kernel.org/r/20180628131659.12133-1-colin.king@canonical.com
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Cc: Mark Fasheh <mfasheh@versity.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Junxiao Bi <junxiao.bi@oracle.com>
      Cc: Joseph Qi <joseph.qi@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      480bd564
    • wangyan's avatar
      ocfs2: clean up some unnecessary code · 229ba1f8
      wangyan authored
      
      
      Several functions have some unnecessary code, clean up these code.
      
      Link: http://lkml.kernel.org/r/5B14DF72.5020800@huawei.com
      Signed-off-by: default avatarYan Wang <wangyan122@huawei.com>
      Reviewed-by: default avatarJun Piao <piaojun@huawei.com>
      Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Mark Fasheh <mark@fasheh.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Junxiao Bi <junxiao.bi@oracle.com>
      Cc: Joseph Qi <jiangqi903@gmail.com>
      Cc: Changwei Ge <ge.changwei@h3c.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      229ba1f8
    • Jun Piao's avatar
      ocfs2: return -EROFS when filesystem becomes read-only · 93f5920d
      Jun Piao authored
      
      
      We should return -EROFS rather than other errno if filesystem becomes
      read-only.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Link: http://lkml.kernel.org/r/5B191B26.9010501@huawei.com
      Signed-off-by: default avatarJun Piao <piaojun@huawei.com>
      Reviewed-by: default avatarYiwen Jiang <jiangyiwen@huawei.com>
      Acked-by: default avatarJoseph Qi <jiangqi903@gmail.com>
      Cc: Mark Fasheh <mark@fasheh.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Junxiao Bi <junxiao.bi@oracle.com>
      Cc: Changwei Ge <ge.changwei@h3c.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      93f5920d
    • Nick Desaulniers's avatar
      sh: prefer _THIS_IP_ to current_text_addr · 8d00d0c0
      Nick Desaulniers authored
      
      
      As part of the effort to reduce the code duplication between _THIS_IP_
      and current_text_addr(), let's consolidate callers of
      current_text_addr() to use _THIS_IP_.
      
      Link: http://lkml.kernel.org/r/20180801185331.39535-1-ndesaulniers@google.com
      Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Rich Felker <dalias@libc.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8d00d0c0
    • Dmitry Torokhov's avatar
      sh: make use of for_each_node_by_type() · 82f7c510
      Dmitry Torokhov authored
      
      
      Instead of open-coding the loop, let's use canned macro.
      
      Also make sure we are not leaking "cpus" node reference.
      
      Link: http://lkml.kernel.org/r/20180624224252.GA220395@dtor-ws
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Rich Felker <dalias@libc.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      82f7c510
    • Kees Cook's avatar
      ntfs: mft: remove VLA usage · ab62ef82
      Kees Cook authored
      
      
      In the quest to remove all stack VLA usage from the kernel[1], this
      allocates the maximum size stack buffer.  Existing checks already
      require that blocksize >= NTFS_BLOCK_SIZE and mft_record_size <=
      PAGE_SIZE, so max_bhs can be at most PAGE_SIZE / NTFS_BLOCK_SIZE.
      Sanity checks are added for robustness.
      
      [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com
      
      Link: http://lkml.kernel.org/r/20180626172909.41453-4-keescook@chromium.org
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Cc: Anton Altaparmakov <anton@tuxera.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ab62ef82
    • Kees Cook's avatar
      ntfs: decompress: remove VLA usage · 2c27ce91
      Kees Cook authored
      
      
      In the quest to remove all stack VLA usage from the kernel[1], this
      moves the stack buffer used during decompression to be allocated
      externally.
      
      The existing "dest_max_index" used in the VLA is bounded by cb_max_page.
      cb_max_page is bounded by max_page, and max_page is bounded by nr_pages.
      Since nr_pages is used for the "pages" allocation, it can similarly be
      used for the "completed_pages" allocation and passed into the
      decompression function.  The error paths are updated to free the new
      allocation.
      
      [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com
      
      Link: http://lkml.kernel.org/r/20180626172909.41453-3-keescook@chromium.org
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Cc: Anton Altaparmakov <anton@tuxera.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2c27ce91
    • Kees Cook's avatar
      ntfs: aops: remove VLA usage · ac4ecf96
      Kees Cook authored
      
      
      In the quest to remove all stack VLA usage from the kernel[1], this uses
      the maximum size needed on the stack and adds a sanity check for
      robustness: index.block_size cannot be larger than PAGE_SIZE nor less
      than NTFS_BLOCK_SIZE.
      
      [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com
      
      Link: http://lkml.kernel.org/r/20180626172909.41453-2-keescook@chromium.org
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Cc: Anton Altaparmakov <anton@tuxera.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ac4ecf96
    • Sebastian Andrzej Siewior's avatar
      fs/ntfs/aops.c: don't disable interrupts during kmap_atomic() · a10dceba
      Sebastian Andrzej Siewior authored
      ntfs_end_buffer_async_read() disables interrupts around kmap_atomic().
      This is a leftover from the old kmap_atomic() implementation which
      relied on fixed mapping slots, so the caller had to make sure that the
      same slot could not be reused from an interrupting context.
      
      kmap_atomic() was changed to dynamic slots long ago and commit
      1ec9c5dd
      
       ("include/linux/highmem.h: remove the second argument of
      k[un]map_atomic()") removed the slot assignements, but the callers were
      not checked for now redundant interrupt disabling.
      
      Remove the conditional interrupt disable.
      
      Link: http://lkml.kernel.org/r/20180611144913.gln5mklhqcrfsoom@linutronix.de
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Anton Altaparmakov <anton@tuxera.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a10dceba
    • Jeremy Cline's avatar
      scripts: add Python 3 compatibility to spdxcheck.py · bed95c43
      Jeremy Cline authored
      
      
      "dict.has_key(key)" on dictionaries has been replaced with "key in
      dict".  Additionally, when run under Python 3 some files don't decode
      with the default encoding (tested with UTF-8).  To handle that, don't
      open the file in text mode and decode text line-by-line, ignoring
      encoding errors.
      
      This remains compatible with Python 2 and should have no functional
      change.
      
      Link: http://lkml.kernel.org/r/20180717190635.29467-1-jcline@redhat.com
      Signed-off-by: default avatarJeremy Cline <jcline@redhat.com>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      bed95c43
    • Joe Perches's avatar
      scripts/spdxcheck.py: work with current HEAD LICENSES/ directory · fde5e903
      Joe Perches authored
      
      
      Depending on how old your -next tree is, it may not have a master that
      has the LICENSES directory.
      
      Change the lookup to HEAD and find whatever LICENSE directory files are
      used in that branch.
      
      Miscellanea:
      
       - Remove the checkpatch test as it will have its own SPDX license
         identifier.
      
      Link: http://lkml.kernel.org/r/7eeefc862194930c773e662cb2152e178441d3b8.camel@perches.com
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fde5e903
    • Arnd Bergmann's avatar
      fs/hpfs: extend gmt_to_local() conversion to 64-bit times · f08957d0
      Arnd Bergmann authored
      
      
      The VFS timestamps are all 64-bit now, the only missing piece for hpfs
      is the internal conversion function.  One interesting bit about hpfs is
      that it can already deal with moving the 136 year window of its
      timestamps to support a much wider range than other file systems with
      32-bit timestamps.  It also treats the timestamps as 'unsigned' on
      64-bit architectures (but signed on 32-bit, because time_t always around
      to negative numbers in 2038).
      
      Changing the conversion to use time64_t makes 32-bit architectures
      behave the same way as 64-bit.  For completeness, this also adds a
      clamp_t call for each conversion, so we don't wrap the timestamps but
      instead stay within the [0..U32_MAX] range of the on-disk timestamps.
      
      Link: http://lkml.kernel.org/r/20180718115017.742609-3-arnd@arndb.de
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f08957d0
    • Arnd Bergmann's avatar
      fs/ntfs: use timespec64 directly for timestamp conversion · bcf451ec
      Arnd Bergmann authored
      
      
      Now that the VFS has been converted from timespec to timespec64
      timestamps, only the conversion to/from ntfs timestamps uses 32-bit
      seconds.
      
      This changes that last missing piece to get the ntfs implementation
      y2038 safe on 32-bit architectures.
      
      Link: http://lkml.kernel.org/r/20180718115017.742609-2-arnd@arndb.de
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Anton Altaparmakov <anton@tuxera.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      bcf451ec
    • Arnd Bergmann's avatar
      fs/ufs: use ktime_get_real_seconds for sb and cg timestamps · a3fda0ff
      Arnd Bergmann authored
      
      
      get_seconds() is deprecated because of the 32-bit overflow and will be
      removed.  All callers in ufs also truncate to a 32-bit number, so
      nothing changes during the conversion, but this should be harmless as
      the superblock and cylinder group timestamps are not visible to user
      space, except for checking the fs-dirty state, wich works fine across
      the overflow.
      
      This moves the call to get_seconds() into a new inline function, with a
      comment explaining the constraints, while converting it to
      ktime_get_real_seconds().
      
      Link: http://lkml.kernel.org/r/20180718115017.742609-1-arnd@arndb.de
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a3fda0ff
    • Arnd Bergmann's avatar
      firewire: use 64-bit time_t based interfaces · 2c1bb29a
      Arnd Bergmann authored
      
      
      32-bit CLOCK_REALTIME timestamps overflow in year 2038, so all such
      interfaces are deprecated now.  For the FW_CDEV_IOC_GET_CYCLE_TIMER2
      ioctl, we already support 64-bit timestamps, but the implementation
      still uses timespec.
      
      This changes the code to use timespec64 instead with the appropriate
      accessor functions.
      
      Link: http://lkml.kernel.org/r/20180711124456.1023039-1-arnd@arndb.de
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2c1bb29a
    • Dave Jiang's avatar
      dax: remove VM_MIXEDMAP for fsdax and device dax · e1fb4a08
      Dave Jiang authored
      
      
      This patch is reworked from an earlier patch that Dan has posted:
      https://patchwork.kernel.org/patch/10131727/
      
      VM_MIXEDMAP is used by dax to direct mm paths like vm_normal_page() that
      the memory page it is dealing with is not typical memory from the linear
      map.  The get_user_pages_fast() path, since it does not resolve the vma,
      is already using {pte,pmd}_devmap() as a stand-in for VM_MIXEDMAP, so we
      use that as a VM_MIXEDMAP replacement in some locations.  In the cases
      where there is no pte to consult we fallback to using vma_is_dax() to
      detect the VM_MIXEDMAP special case.
      
      Now that we have explicit driver pfn_t-flag opt-in/opt-out for
      get_user_pages() support for DAX we can stop setting VM_MIXEDMAP.  This
      also means we no longer need to worry about safely manipulating vm_flags
      in a future where we support dynamically changing the dax mode of a
      file.
      
      DAX should also now be supported with madvise_behavior(), vma_merge(),
      and copy_page_range().
      
      This patch has been tested against ndctl unit test.  It has also been
      tested against xfstests commit: 625515d using fake pmem created by
      memmap and no additional issues have been observed.
      
      Link: http://lkml.kernel.org/r/152847720311.55924.16999195879201817653.stgit@djiang5-desk3.ch.intel.com
      Signed-off-by: default avatarDave Jiang <dave.jiang@intel.com>
      Acked-by: default avatarDan Williams <dan.j.williams@intel.com>
      Cc: Jan Kara <jack@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e1fb4a08
    • Arnd Bergmann's avatar
      bitfield: avoid gcc-8 -Wint-in-bool-context warning · e36488c8
      Arnd Bergmann authored
      Passing an enum into FIELD_GET() produces a long but harmless warning on
      newer compilers:
      
                         from include/linux/linkage.h:7,
                         from include/linux/kernel.h:7,
                         from include/linux/skbuff.h:17,
                         from include/linux/if_ether.h:23,
                         from include/linux/etherdevice.h:25,
                         from drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c:63:
        drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c: In function 'iwl_mvm_rx_mpdu_mq':
        include/linux/bitfield.h:56:20: error: enum constant in boolean context [-Werror=int-in-bool-context]
           BUILD_BUG_ON_MSG(!(_mask), _pfx "mask is zero"); \
                            ^
        ...
        include/linux/bitfield.h:103:3: note: in expansion of macro '__BF_FIELD_CHECK'
           __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: "); \
           ^~~~~~~~~~~~~~~~
        drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c:1025:21: note: in expansion of macro 'FIELD_GET'
            le16_encode_bits(FIELD_GET(IWL_RX_HE_PHY_SIBG_SYM_OR_USER_NUM_MASK,
      
      The problem here is that the caller has no idea how the macro gets
      expanding, leading to a false-positive.  It can be trivially avoided by
      doing a comparison against zero.
      
      This only recently started appearing as the iwlwifi driver was patched
      to use FIELD_GET.
      
      Link: http://lkml.kernel.org/r/20180813220950.194841-1-arnd@arndb.de
      Fixes: 514c3069
      
       ("iwlwifi: add support for IEEE802.11ax")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Johannes Berg <johannes@sipsolutions.net>
      Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: David Laight <David.Laight@ACULAB.COM>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e36488c8
    • Dominique Martinet's avatar
      9p: add Dominique Martinet to MAINTAINERS · 6ed191ca
      Dominique Martinet authored
      
      
      Link: http://lkml.kernel.org/r/1533869305-29325-1-git-send-email-asmadeus@codewreck.org
      Signed-off-by: default avatarDominique Martinet <dominique.martinet@cea.fr>
      Acked-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Eric Van Hensbergen <ericvh@gmail.com>
      Cc: Latchesar Ionkov <lucho@ionkov.net>
      Cc: Ron Minnich <rminnich@sandia.gov>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6ed191ca
    • Dominique Martinet's avatar
      9p: remove Ron Minnich from MAINTAINERS · 6b69cbd8
      Dominique Martinet authored
      
      
      Ron Minnich has left Sandia in 2011, and has not been involved in any 9p
      commit in recent years.  Also add a CREDITS entry to record his
      contributions.
      
      Link: http://lkml.kernel.org/r/1534486244-1055-1-git-send-email-asmadeus@codewreck.org
      Signed-off-by: default avatarDominique Martinet <dominique.martinet@cea.fr>
      Cc: Eric Van Hensbergen <ericvh@gmail.com>
      Cc: Ron Minnich <rminnich@sandia.gov>
      Cc: Ronald G. Minnich <rminnich@gmail.com>
      Cc: Latchesar Ionkov <lucho@ionkov.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6b69cbd8
  2. Aug 17, 2018
    • Linus Torvalds's avatar
      Merge tag 'for-linus-4.19-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux · 5c60a738
      Linus Torvalds authored
      Pull orangefs updates from Mike Marshall:
       "Orangefs: one cleanup and Souptick's vm_fault_t patch:
      
         - add new return type vm_fault_t (Souptick Joarder)
      
         - remove redundant pointer (Colin Ian King)"
      
      * tag 'for-linus-4.19-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux:
        orangefs: remove redundant pointer orangefs_inode
        orangefs: Adding new return type vm_fault_t
      5c60a738
    • Linus Torvalds's avatar
      Merge tag 'vfio-v4.19-rc1' of git://github.com/awilliam/linux-vfio · b6d6a307
      Linus Torvalds authored
      Pull VFIO updates from Alex Williamson:
      
       - mark switch fall-through cases (Gustavo A. R. Silva)
      
       - disable binding SR-IOV enabled PFs (Alex Williamson)
      
      * tag 'vfio-v4.19-rc1' of git://github.com/awilliam/linux-vfio:
        vfio-pci: Disable binding to PFs with SR-IOV enabled
        vfio: Mark expected switch fall-throughs
      b6d6a307
    • Linus Torvalds's avatar
      Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal · d01e12dd
      Linus Torvalds authored
      Pull thermal management updates from Eduardo Valentin:
      
       - rework tsens driver to add support for tsens-v2 (Amit Kucheria)
      
       - rework armada thermal driver to use syscon and multichannel support
         (Miquel Raynal)
      
       - fixes to TI SoC, IMX, Exynos, RCar, and hwmon drivers
      
      * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal: (34 commits)
        thermal: armada: fix copy-paste error in armada_thermal_probe()
        thermal: rcar_thermal: avoid NULL dereference in absence of IRQ resources
        thermal: samsung: Remove Exynos5440 clock handling left-overs
        thermal: tsens: Fix negative temperature reporting
        thermal: tsens: switch from of_iomap() to devm_ioremap_resource()
        thermal: tsens: Rename variable
        thermal: tsens: Add generic support for TSENS v2 IP
        thermal: tsens: Rename tsens-8996 to tsens-v2 for reuse
        thermal: tsens: Add support to split up register address space into two
        dt: thermal: tsens: Document the fallback DT property for v2 of TSENS IP
        thermal: tsens: Get rid of unused fields in structure
        thermal_hwmon: Pass the originating device down to hwmon_device_register_with_info
        thermal_hwmon: Sanitize attribute name passed to hwmon
        dt-bindings: thermal: armada: add reference to new bindings
        dt-bindings: cp110: add the thermal node in the syscon file
        dt-bindings: cp110: update documentation since DT de-duplication
        dt-bindings: ap806: add the thermal node in the syscon file
        dt-bindings: cp110: prepare the syscon file to list other syscons nodes
        dt-bindings: ap806: prepare the syscon file to list other syscons nodes
        dt-bindings: cp110: rename cp110 syscon file
        ...
      d01e12dd
    • Linus Torvalds's avatar
      Merge tag 'mailbox-v4.19' of git://git.linaro.org/landing-teams/working/fujitsu/integration · 9502f0d1
      Linus Torvalds authored
      Pull mailbox updates from Jassi Brar:
      
       - xgene: potential null pointer fix
      
       - omap: switch to spdx license and use of_device_get_match_data() to
         match data
      
       - ti-msgmgr: cleanup and optimisation. New TI specific feature - secure
         proxy thread.
      
       - mediatek: add driver for CMDQ controller.
      
       - nxp: add driver for MU controller
      
      * tag 'mailbox-v4.19' of git://git.linaro.org/landing-teams/working/fujitsu/integration:
        mailbox: Add support for i.MX messaging unit
        dt-bindings: mailbox: imx-mu: add generic MU channel support
        dt-bindings: arm: fsl: add mu binding doc
        mailbox: add MODULE_LICENSE() for mtk-cmdq-mailbox.c
        mailbox: mediatek: Add Mediatek CMDQ driver
        dt-bindings: soc: Add documentation for the MediaTek GCE unit
        mailbox: ti-msgmgr: Add support for Secure Proxy
        dt-bindings: mailbox: Add support for secure proxy threads
        mailbox: ti-msgmgr: Move the memory region name to descriptor
        mailbox: ti-msgmgr: Change message count mask to be descriptor based
        mailbox: ti-msgmgr: Allocate Rx channel resources only on request
        mailbox: ti-msgmgr: Get rid of unused structure members
        mailbox/omap: use of_device_get_match_data() to get match data
        mailbox/omap: switch to SPDX license identifier
        mailbox: xgene-slimpro: Fix potential NULL pointer dereference
      9502f0d1
    • Yannik Sembritzki's avatar
      Fix kexec forbidding kernels signed with keys in the secondary keyring to boot · ea93102f
      Yannik Sembritzki authored
      The split of .system_keyring into .builtin_trusted_keys and
      .secondary_trusted_keys broke kexec, thereby preventing kernels signed by
      keys which are now in the secondary keyring from being kexec'd.
      
      Fix this by passing VERIFY_USE_SECONDARY_KEYRING to
      verify_pefile_signature().
      
      Fixes: d3bfe841
      
       ("certs: Add a secondary system keyring that can be added to dynamically")
      Signed-off-by: default avatarYannik Sembritzki <yannik@sembritzki.me>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Cc: kexec@lists.infradead.org
      Cc: keyrings@vger.kernel.org
      Cc: linux-security-module@vger.kernel.org
      Cc: stable@kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ea93102f
    • Yannik Sembritzki's avatar
      Replace magic for trusting the secondary keyring with #define · 817aef26
      Yannik Sembritzki authored
      
      
      Replace the use of a magic number that indicates that verify_*_signature()
      should use the secondary keyring with a symbol.
      
      Signed-off-by: default avatarYannik Sembritzki <yannik@sembritzki.me>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Cc: keyrings@vger.kernel.org
      Cc: linux-security-module@vger.kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      817aef26
    • Linus Torvalds's avatar
      Merge tag 'pci-v4.19-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · 4e31843f
      Linus Torvalds authored
      Pull pci updates from Bjorn Helgaas:
      
       - Decode AER errors with names similar to "lspci" (Tyler Baicar)
      
       - Expose AER statistics in sysfs (Rajat Jain)
      
       - Clear AER status bits selectively based on the type of recovery (Oza
         Pawandeep)
      
       - Honor "pcie_ports=native" even if HEST sets FIRMWARE_FIRST (Alexandru
         Gagniuc)
      
       - Don't clear AER status bits if we're using the "Firmware-First"
         strategy where firmware owns the registers (Alexandru Gagniuc)
      
       - Use sysfs_match_string() to simplify ASPM sysfs parsing (Andy
         Shevchenko)
      
       - Remove unnecessary includes of <linux/pci-aspm.h> (Bjorn Helgaas)
      
       - Defer DPC event handling to work queue (Keith Busch)
      
       - Use threaded IRQ for DPC bottom half (Keith Busch)
      
       - Print AER status while handling DPC events (Keith Busch)
      
       - Work around IDT switch ACS Source Validation erratum (James
         Puthukattukaran)
      
       - Emit diagnostics for all cases of PCIe Link downtraining (Links
         operating slower than they're capable of) (Alexandru Gagniuc)
      
       - Skip VFs when configuring Max Payload Size (Myron Stowe)
      
       - Reduce Root Port Max Payload Size if necessary when hot-adding a
         device below it (Myron Stowe)
      
       - Simplify SHPC existence/permission checks (Bjorn Helgaas)
      
       - Remove hotplug sample skeleton driver (Lukas Wunner)
      
       - Convert pciehp to threaded IRQ handling (Lukas Wunner)
      
       - Improve pciehp tolerance of missed events and initially unstable
         links (Lukas Wunner)
      
       - Clear spurious pciehp events on resume (Lukas Wunner)
      
       - Add pciehp runtime PM support, including for Thunderbolt controllers
         (Lukas Wunner)
      
       - Support interrupts from pciehp bridges in D3hot (Lukas Wunner)
      
       - Mark fall-through switch cases before enabling -Wimplicit-fallthrough
         (Gustavo A. R. Silva)
      
       - Move DMA-debug PCI init from arch code to PCI core (Christoph
         Hellwig)
      
       - Fix pci_request_irq() usage of IRQF_ONESHOT when no handler is
         supplied (Heiner Kallweit)
      
       - Unify PCI and DMA direction #defines (Shunyong Yang)
      
       - Add PCI_DEVICE_DATA() macro (Andy Shevchenko)
      
       - Check for VPD completion before checking for timeout (Bert Kenward)
      
       - Limit Netronome NFP5000 config space size to work around erratum
         (Jakub Kicinski)
      
       - Set IRQCHIP_ONESHOT_SAFE for PCI MSI irqchips (Heiner Kallweit)
      
       - Document ACPI description of PCI host bridges (Bjorn Helgaas)
      
       - Add "pci=disable_acs_redir=" parameter to disable ACS redirection for
         peer-to-peer DMA support (we don't have the peer-to-peer support yet;
         this is just one piece) (Logan Gunthorpe)
      
       - Clean up devm_of_pci_get_host_bridge_resources() resource allocation
         (Jan Kiszka)
      
       - Fixup resizable BARs after suspend/resume (Christian König)
      
       - Make "pci=earlydump" generic (Sinan Kaya)
      
       - Fix ROM BAR access routines to stay in bounds and check for signature
         correctly (Rex Zhu)
      
       - Add DMA alias quirk for Microsemi Switchtec NTB (Doug Meyer)
      
       - Expand documentation for pci_add_dma_alias() (Logan Gunthorpe)
      
       - To avoid bus errors, enable PASID only if entire path supports
         End-End TLP prefixes (Sinan Kaya)
      
       - Unify slot and bus reset functions and remove hotplug knowledge from
         callers (Sinan Kaya)
      
       - Add Function-Level Reset quirks for Intel and Samsung NVMe devices to
         fix guest reboot issues (Alex Williamson)
      
       - Add function 1 DMA alias quirk for Marvell 88SS9183 PCIe SSD
         Controller (Bjorn Helgaas)
      
       - Remove Xilinx AXI-PCIe host bridge arch dependency (Palmer Dabbelt)
      
       - Remove Aardvark outbound window configuration (Evan Wang)
      
       - Fix Aardvark bridge window sizing issue (Zachary Zhang)
      
       - Convert Aardvark to use pci_host_probe() to reduce code duplication
         (Thomas Petazzoni)
      
       - Correct the Cadence cdns_pcie_writel() signature (Alan Douglas)
      
       - Add Cadence support for optional generic PHYs (Alan Douglas)
      
       - Add Cadence power management ops (Alan Douglas)
      
       - Remove redundant variable from Cadence driver (Colin Ian King)
      
       - Add Kirin MSI support (Xiaowei Song)
      
       - Drop unnecessary root_bus_nr setting from exynos, imx6, keystone,
         armada8k, artpec6, designware-plat, histb, qcom, spear13xx (Shawn
         Guo)
      
       - Move link notification settings from DesignWare core to individual
         drivers (Gustavo Pimentel)
      
       - Add endpoint library MSI-X interfaces (Gustavo Pimentel)
      
       - Correct signature of endpoint library IRQ interfaces (Gustavo
         Pimentel)
      
       - Add DesignWare endpoint library MSI-X callbacks (Gustavo Pimentel)
      
       - Add endpoint library MSI-X test support (Gustavo Pimentel)
      
       - Remove unnecessary GFP_ATOMIC from Hyper-V "new child" allocation
         (Jia-Ju Bai)
      
       - Add more devices to Broadcom PAXC quirk (Ray Jui)
      
       - Work around corrupted Broadcom PAXC config space to enable SMMU and
         GICv3 ITS (Ray Jui)
      
       - Disable MSI parsing to work around broken Broadcom PAXC logic in some
         devices (Ray Jui)
      
       - Hide unconfigured functions to work around a Broadcom PAXC defect
         (Ray Jui)
      
       - Lower iproc log level to reduce console output during boot (Ray Jui)
      
       - Fix mobiveil iomem/phys_addr_t type usage (Lorenzo Pieralisi)
      
       - Fix mobiveil missing include file (Lorenzo Pieralisi)
      
       - Add mobiveil Kconfig/Makefile support (Lorenzo Pieralisi)
      
       - Fix mvebu I/O space remapping issues (Thomas Petazzoni)
      
       - Use generic pci_host_bridge in mvebu instead of ARM-specific API
         (Thomas Petazzoni)
      
       - Whitelist VMD devices with fast interrupt handlers to avoid sharing
         vectors with slow handlers (Keith Busch)
      
      * tag 'pci-v4.19-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (153 commits)
        PCI/AER: Don't clear AER bits if error handling is Firmware-First
        PCI: Limit config space size for Netronome NFP5000
        PCI/MSI: Set IRQCHIP_ONESHOT_SAFE for PCI-MSI irqchips
        PCI/VPD: Check for VPD access completion before checking for timeout
        PCI: Add PCI_DEVICE_DATA() macro to fully describe device ID entry
        PCI: Match Root Port's MPS to endpoint's MPSS as necessary
        PCI: Skip MPS logic for Virtual Functions (VFs)
        PCI: Add function 1 DMA alias quirk for Marvell 88SS9183
        PCI: Check for PCIe Link downtraining
        PCI: Add ACS Redirect disable quirk for Intel Sunrise Point
        PCI: Add device-specific ACS Redirect disable infrastructure
        PCI: Convert device-specific ACS quirks from NULL termination to ARRAY_SIZE
        PCI: Add "pci=disable_acs_redir=" parameter for peer-to-peer support
        PCI: Allow specifying devices using a base bus and path of devfns
        PCI: Make specifying PCI devices in kernel parameters reusable
        PCI: Hide ACS quirk declarations inside PCI core
        PCI: Delay after FLR of Intel DC P3700 NVMe
        PCI: Disable Samsung SM961/PM961 NVMe before FLR
        PCI: Export pcie_has_flr()
        PCI: mvebu: Drop bogus comment above mvebu_pcie_map_registers()
        ...
      4e31843f
  3. Aug 16, 2018
    • Linus Torvalds's avatar
      Merge branch 'next-integrity' of... · f91e6544
      Linus Torvalds authored
      Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
      
      Pull integrity updates from James Morris:
       "This adds support for EVM signatures based on larger digests, contains
        a new audit record AUDIT_INTEGRITY_POLICY_RULE to differentiate the
        IMA policy rules from the IMA-audit messages, addresses two deadlocks
        due to either loading or searching for crypto algorithms, and cleans
        up the audit messages"
      
      * 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
        EVM: fix return value check in evm_write_xattrs()
        integrity: prevent deadlock during digsig verification.
        evm: Allow non-SHA1 digital signatures
        evm: Don't deadlock if a crypto algorithm is unavailable
        integrity: silence warning when CONFIG_SECURITYFS is not enabled
        ima: Differentiate auditing policy rules from "audit" actions
        ima: Do not audit if CONFIG_INTEGRITY_AUDIT is not set
        ima: Use audit_log_format() rather than audit_log_string()
        ima: Call audit_log_string() rather than logging it untrusted
      f91e6544
    • Linus Torvalds's avatar
      Merge branch 'next-tpm' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security · c715ebeb
      Linus Torvalds authored
      Pull TPM updates from James Morris:
      
       - Migrate away from PM runtime as explicit cmdReady/goIdle transactions
         for every command is a spec requirement. PM runtime adds only a layer
         of complexity on our case.
      
       - tpm_tis drivers can now specify the hwrng quality.
      
       - TPM 2.0 code uses now tpm_buf for constructing messages. Jarkko
         thinks Tomas Winkler has done the same for TPM 1.2, and will start
         digging those changes from the patchwork in the near future.
      
       - Bug fixes and clean ups
      
      * 'next-tpm' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
        ima: Get rid of ima_used_chip and use ima_tpm_chip != NULL instead
        ima: Use tpm_default_chip() and call TPM functions with a tpm_chip
        tpm: replace TPM_TRANSMIT_RAW with TPM_TRANSMIT_NESTED
        tpm: Convert tpm_find_get_ops() to use tpm_default_chip()
        tpm: Implement tpm_default_chip() to find a TPM chip
        tpm: rename tpm_chip_find_get() to tpm_find_get_ops()
        tpm: Allow tpm_tis drivers to set hwrng quality.
        tpm: Return the actual size when receiving an unsupported command
        tpm: separate cmd_ready/go_idle from runtime_pm
        tpm/tpm_i2c_infineon: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT)
        tpm_tis_spi: Pass the SPI IRQ down to the driver
        tpm: migrate tpm2_get_random() to use struct tpm_buf
        tpm: migrate tpm2_get_tpm_pt() to use struct tpm_buf
        tpm: migrate tpm2_probe() to use struct tpm_buf
        tpm: migrate tpm2_shutdown() to use struct tpm_buf
      c715ebeb
    • Linus Torvalds's avatar
      Merge branch 'next-smack' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security · 04743f89
      Linus Torvalds authored
      Pull smack updates from James Morris:
       "Minor fixes from Piotr Sawicki"
      
      * 'next-smack' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
        Smack: Inform peer that IPv6 traffic has been blocked
        Smack: Check UDP-Lite and DCCP protocols during IPv6 handling
        Smack: Fix handling of IPv4 traffic received by PF_INET6 sockets
      04743f89