18 Jan, 2020

2 commits

  • [ Upstream commit 63e80314ab7cf4783526d2e44ee57a90514911c9 ]

    Clang cannot translate the string "r30" into a valid register yet.

    Link: https://github.com/ClangBuiltLinux/linux/issues/755
    Link: http://lkml.kernel.org/r/20191028155722.23419-1-ndesaulniers@google.com
    Signed-off-by: Nick Desaulniers
    Suggested-by: Sid Manning
    Reviewed-by: Brian Cain
    Cc: Allison Randal
    Cc: Greg Kroah-Hartman
    Cc: Richard Fontana
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Sasha Levin

    Nick Desaulniers
     
  • [ Upstream commit 780a0cfda9006a9a22d6473c2d4c527f5c68eb2e ]

    Hexagon requires that register predicates in assembly be parenthesized.

    Link: https://github.com/ClangBuiltLinux/linux/issues/754
    Link: http://lkml.kernel.org/r/20191209222956.239798-3-ndesaulniers@google.com
    Signed-off-by: Nick Desaulniers
    Suggested-by: Sid Manning
    Acked-by: Brian Cain
    Cc: Lee Jones
    Cc: Andy Shevchenko
    Cc: Tuowen Zhao
    Cc: Mika Westerberg
    Cc: Luis Chamberlain
    Cc: Greg Kroah-Hartman
    Cc: Alexios Zavras
    Cc: Allison Randal
    Cc: Will Deacon
    Cc: Richard Fontana
    Cc: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: Boqun Feng
    Cc: Ingo Molnar
    Cc: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Sasha Levin

    Nick Desaulniers
     

09 Jul, 2019

1 commit

  • …iederm/user-namespace

    Pull force_sig() argument change from Eric Biederman:
    "A source of error over the years has been that force_sig has taken a
    task parameter when it is only safe to use force_sig with the current
    task.

    The force_sig function is built for delivering synchronous signals
    such as SIGSEGV where the userspace application caused a synchronous
    fault (such as a page fault) and the kernel responded with a signal.

    Because the name force_sig does not make this clear, and because the
    force_sig takes a task parameter the function force_sig has been
    abused for sending other kinds of signals over the years. Slowly those
    have been fixed when the oopses have been tracked down.

    This set of changes fixes the remaining abusers of force_sig and
    carefully rips out the task parameter from force_sig and friends
    making this kind of error almost impossible in the future"

    * 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (27 commits)
    signal/x86: Move tsk inside of CONFIG_MEMORY_FAILURE in do_sigbus
    signal: Remove the signal number and task parameters from force_sig_info
    signal: Factor force_sig_info_to_task out of force_sig_info
    signal: Generate the siginfo in force_sig
    signal: Move the computation of force into send_signal and correct it.
    signal: Properly set TRACE_SIGNAL_LOSE_INFO in __send_signal
    signal: Remove the task parameter from force_sig_fault
    signal: Use force_sig_fault_to_task for the two calls that don't deliver to current
    signal: Explicitly call force_sig_fault on current
    signal/unicore32: Remove tsk parameter from __do_user_fault
    signal/arm: Remove tsk parameter from __do_user_fault
    signal/arm: Remove tsk parameter from ptrace_break
    signal/nds32: Remove tsk parameter from send_sigtrap
    signal/riscv: Remove tsk parameter from do_trap
    signal/sh: Remove tsk parameter from force_sig_info_fault
    signal/um: Remove task parameter from send_sigtrap
    signal/x86: Remove task parameter from send_sigtrap
    signal: Remove task parameter from force_sig_mceerr
    signal: Remove task parameter from force_sig
    signal: Remove task parameter from force_sigsegv
    ...

    Linus Torvalds
     

05 Jun, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 and
    only version 2 as published by the free software foundation this
    program is distributed in the hope that it will be useful but
    without any warranty without even the implied warranty of
    merchantability or fitness for a particular purpose see the gnu
    general public license for more details you should have received a
    copy of the gnu general public license along with this program if
    not write to the free software foundation inc 51 franklin street
    fifth floor boston ma 02110 1301 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 94 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Richard Fontana
    Reviewed-by: Alexios Zavras
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190529141334.043630402@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

29 May, 2019

1 commit

  • As synchronous exceptions really only make sense against the current
    task (otherwise how are you synchronous) remove the task parameter
    from from force_sig_fault to make it explicit that is what is going
    on.

    The two known exceptions that deliver a synchronous exception to a
    stopped ptraced task have already been changed to
    force_sig_fault_to_task.

    The callers have been changed with the following emacs regular expression
    (with obvious variations on the architectures that take more arguments)
    to avoid typos:

    force_sig_fault[(]\([^,]+\)[,]\([^,]+\)[,]\([^,]+\)[,]\W+current[)]
    ->
    force_sig_fault(\1,\2,\3)

    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     

27 May, 2019

1 commit


04 Jan, 2019

1 commit

  • Nobody has actually used the type (VERIFY_READ vs VERIFY_WRITE) argument
    of the user address range verification function since we got rid of the
    old racy i386-only code to walk page tables by hand.

    It existed because the original 80386 would not honor the write protect
    bit when in kernel mode, so you had to do COW by hand before doing any
    user access. But we haven't supported that in a long time, and these
    days the 'type' argument is a purely historical artifact.

    A discussion about extending 'user_access_begin()' to do the range
    checking resulted this patch, because there is no way we're going to
    move the old VERIFY_xyz interface to that model. And it's best done at
    the end of the merge window when I've done most of my merges, so let's
    just get this done once and for all.

    This patch was mostly done with a sed-script, with manual fix-ups for
    the cases that weren't of the trivial 'access_ok(VERIFY_xyz' form.

    There were a couple of notable cases:

    - csky still had the old "verify_area()" name as an alias.

    - the iter_iov code had magical hardcoded knowledge of the actual
    values of VERIFY_{READ,WRITE} (not that they mattered, since nothing
    really used it)

    - microblaze used the type argument for a debug printout

    but other than those oddities this should be a total no-op patch.

    I tried to fix up all architectures, did fairly extensive grepping for
    access_ok() uses, and the changes are trivial, but I may have missed
    something. Any missed conversion should be trivially fixable, though.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

30 Dec, 2018

3 commits

  • checkpatch.pl reports the following:

    WARNING: struct kgdb_arch should normally be const
    #28: FILE: arch/mips/kernel/kgdb.c:397:
    +struct kgdb_arch arch_kgdb_ops = {

    This report makes sense, as all other ops struct, this
    one should also be const. This patch does the change.

    Cc: Vineet Gupta
    Cc: Russell King
    Cc: Catalin Marinas
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Cc: Richard Kuo
    Cc: Michal Simek
    Cc: Ralf Baechle
    Cc: Paul Burton
    Cc: James Hogan
    Cc: Ley Foon Tan
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: Rich Felker
    Cc: "David S. Miller"
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Borislav Petkov
    Cc: x86@kernel.org
    Acked-by: Daniel Thompson
    Acked-by: Paul Burton
    Signed-off-by: Christophe Leroy
    Acked-by: Borislav Petkov
    Acked-by: Michael Ellerman (powerpc)
    Signed-off-by: Daniel Thompson

    Christophe Leroy
     
  • When I had lockdep turned on and dropped into kgdb I got a nice splat
    on my system. Specifically it hit:
    DEBUG_LOCKS_WARN_ON(current->hardirq_context)

    Specifically it looked like this:
    sysrq: SysRq : DEBUG
    ------------[ cut here ]------------
    DEBUG_LOCKS_WARN_ON(current->hardirq_context)
    WARNING: CPU: 0 PID: 0 at .../kernel/locking/lockdep.c:2875 lockdep_hardirqs_on+0xf0/0x160
    CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.19.0 #27
    pstate: 604003c9 (nZCv DAIF +PAN -UAO)
    pc : lockdep_hardirqs_on+0xf0/0x160
    ...
    Call trace:
    lockdep_hardirqs_on+0xf0/0x160
    trace_hardirqs_on+0x188/0x1ac
    kgdb_roundup_cpus+0x14/0x3c
    kgdb_cpu_enter+0x53c/0x5cc
    kgdb_handle_exception+0x180/0x1d4
    kgdb_compiled_brk_fn+0x30/0x3c
    brk_handler+0x134/0x178
    do_debug_exception+0xfc/0x178
    el1_dbg+0x18/0x78
    kgdb_breakpoint+0x34/0x58
    sysrq_handle_dbg+0x54/0x5c
    __handle_sysrq+0x114/0x21c
    handle_sysrq+0x30/0x3c
    qcom_geni_serial_isr+0x2dc/0x30c
    ...
    ...
    irq event stamp: ...45
    hardirqs last enabled at (...44): [...] __do_softirq+0xd8/0x4e4
    hardirqs last disabled at (...45): [...] el1_irq+0x74/0x130
    softirqs last enabled at (...42): [...] _local_bh_enable+0x2c/0x34
    softirqs last disabled at (...43): [...] irq_exit+0xa8/0x100
    ---[ end trace adf21f830c46e638 ]---

    Looking closely at it, it seems like a really bad idea to be calling
    local_irq_enable() in kgdb_roundup_cpus(). If nothing else that seems
    like it could violate spinlock semantics and cause a deadlock.

    Instead, let's use a private csd alongside
    smp_call_function_single_async() to round up the other CPUs. Using
    smp_call_function_single_async() doesn't require interrupts to be
    enabled so we can remove the offending bit of code.

    In order to avoid duplicating this across all the architectures that
    use the default kgdb_roundup_cpus(), we'll add a "weak" implementation
    to debug_core.c.

    Looking at all the people who previously had copies of this code,
    there were a few variants. I've attempted to keep the variants
    working like they used to. Specifically:
    * For arch/arc we passed NULL to kgdb_nmicallback() instead of
    get_irq_regs().
    * For arch/mips there was a bit of extra code around
    kgdb_nmicallback()

    NOTE: In this patch we will still get into trouble if we try to round
    up a CPU that failed to round up before. We'll try to round it up
    again and potentially hang when we try to grab the csd lock. That's
    not new behavior but we'll still try to do better in a future patch.

    Suggested-by: Daniel Thompson
    Signed-off-by: Douglas Anderson
    Cc: Vineet Gupta
    Cc: Russell King
    Cc: Catalin Marinas
    Cc: Will Deacon
    Cc: Richard Kuo
    Cc: Ralf Baechle
    Cc: Paul Burton
    Cc: James Hogan
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: Yoshinori Sato
    Cc: Rich Felker
    Cc: "David S. Miller"
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Borislav Petkov
    Cc: "H. Peter Anvin"
    Acked-by: Will Deacon
    Signed-off-by: Daniel Thompson

    Douglas Anderson
     
  • The function kgdb_roundup_cpus() was passed a parameter that was
    documented as:

    > the flags that will be used when restoring the interrupts. There is
    > local_irq_save() call before kgdb_roundup_cpus().

    Nobody used those flags. Anyone who wanted to temporarily turn on
    interrupts just did local_irq_enable() and local_irq_disable() without
    looking at them. So we can definitely remove the flags.

    Signed-off-by: Douglas Anderson
    Cc: Vineet Gupta
    Cc: Russell King
    Cc: Catalin Marinas
    Cc: Will Deacon
    Cc: Richard Kuo
    Cc: Ralf Baechle
    Cc: Paul Burton
    Cc: James Hogan
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: Yoshinori Sato
    Cc: Rich Felker
    Cc: "David S. Miller"
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Borislav Petkov
    Cc: "H. Peter Anvin"
    Acked-by: Will Deacon
    Signed-off-by: Daniel Thompson

    Douglas Anderson
     

31 Oct, 2018

1 commit

  • Move remaining definitions and declarations from include/linux/bootmem.h
    into include/linux/memblock.h and remove the redundant header.

    The includes were replaced with the semantic patch below and then
    semi-automated removal of duplicated '#include

    @@
    @@
    - #include
    + #include

    [sfr@canb.auug.org.au: dma-direct: fix up for the removal of linux/bootmem.h]
    Link: http://lkml.kernel.org/r/20181002185342.133d1680@canb.auug.org.au
    [sfr@canb.auug.org.au: powerpc: fix up for removal of linux/bootmem.h]
    Link: http://lkml.kernel.org/r/20181005161406.73ef8727@canb.auug.org.au
    [sfr@canb.auug.org.au: x86/kaslr, ACPI/NUMA: fix for linux/bootmem.h removal]
    Link: http://lkml.kernel.org/r/20181008190341.5e396491@canb.auug.org.au
    Link: http://lkml.kernel.org/r/1536927045-23536-30-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Signed-off-by: Stephen Rothwell
    Acked-by: Michal Hocko
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     

23 Oct, 2018

1 commit

  • Pull dma mapping updates from Christoph Hellwig:
    "First batch of dma-mapping changes for 4.20.

    There will be a second PR as some big changes were only applied just
    before the end of the merge window, and I want to give them a few more
    days in linux-next.

    Summary:

    - mostly more consolidation of the direct mapping code, including
    converting over hexagon, and merging the coherent and non-coherent
    code into a single dma_map_ops instance (me)

    - cleanups for the dma_configure/dma_unconfigure callchains (me)

    - better handling of dma_masks in odd setups (me, Alexander Duyck)

    - better debugging of passing vmalloc address to the DMA API (Stephen
    Boyd)

    - CMA command line parsing fix (He Zhe)"

    * tag 'dma-mapping-4.20' of git://git.infradead.org/users/hch/dma-mapping: (27 commits)
    dma-direct: respect DMA_ATTR_NO_WARN
    dma-mapping: translate __GFP_NOFAIL to DMA_ATTR_NO_WARN
    dma-direct: document the zone selection logic
    dma-debug: Check for drivers mapping invalid addresses in dma_map_single()
    dma-direct: fix return value of dma_direct_supported
    dma-mapping: move dma_default_get_required_mask under ifdef
    dma-direct: always allow dma mask t select DMA_MAYBE_COHERENT from DMA_PERDEV_COHERENT
    dma-mapping: add the missing ARCH_HAS_SYNC_DMA_FOR_CPU_ALL declaration
    dma-mapping: fix panic caused by passing empty cma command line argument
    ...

    Linus Torvalds
     

11 Sep, 2018

1 commit

  • Fix build warning in arch/hexagon/kernel/dma.c by casting a void *
    to unsigned long to match the function parameter type.

    ../arch/hexagon/kernel/dma.c: In function 'arch_dma_alloc':
    ../arch/hexagon/kernel/dma.c:51:5: warning: passing argument 2 of 'gen_pool_add' makes integer from pointer without a cast [enabled by default]
    ../include/linux/genalloc.h:112:19: note: expected 'long unsigned int' but argument is of type 'void *'

    Signed-off-by: Randy Dunlap
    Cc: Yoshinori Sato
    Cc: Rich Felker
    Cc: linux-sh@vger.kernel.org
    Patch-mainline: linux-kernel @ 07/20/2018, 20:17
    [rkuo@codeaurora.org: fixed architecture name]
    Signed-off-by: Richard Kuo

    Randy Dunlap
     

08 Sep, 2018

3 commits


15 Jun, 2018

1 commit

  • Fix printk format warning in hexagon/kernel/setup.c:

    ../arch/hexagon/kernel/setup.c: In function 'setup_arch':
    ../arch/hexagon/kernel/setup.c:69:2: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat]

    where:
    extern unsigned long __phys_offset;
    #define PHYS_OFFSET __phys_offset

    Link: http://lkml.kernel.org/r/adce8db5-4b01-dc10-7fbb-6a64e0787eb5@infradead.org
    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     

05 Jun, 2018

1 commit

  • …iederm/user-namespace

    Pull siginfo updates from Eric Biederman:
    "This set of changes close the known issues with setting si_code to an
    invalid value, and with not fully initializing struct siginfo. There
    remains work to do on nds32, arc, unicore32, powerpc, arm, arm64, ia64
    and x86 to get the code that generates siginfo into a simpler and more
    maintainable state. Most of that work involves refactoring the signal
    handling code and thus careful code review.

    Also not included is the work to shrink the in kernel version of
    struct siginfo. That depends on getting the number of places that
    directly manipulate struct siginfo under control, as it requires the
    introduction of struct kernel_siginfo for the in kernel things.

    Overall this set of changes looks like it is making good progress, and
    with a little luck I will be wrapping up the siginfo work next
    development cycle"

    * 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (46 commits)
    signal/sh: Stop gcc warning about an impossible case in do_divide_error
    signal/mips: Report FPE_FLTUNK for undiagnosed floating point exceptions
    signal/um: More carefully relay signals in relay_signal.
    signal: Extend siginfo_layout with SIL_FAULT_{MCEERR|BNDERR|PKUERR}
    signal: Remove unncessary #ifdef SEGV_PKUERR in 32bit compat code
    signal/signalfd: Add support for SIGSYS
    signal/signalfd: Remove __put_user from signalfd_copyinfo
    signal/xtensa: Use force_sig_fault where appropriate
    signal/xtensa: Consistenly use SIGBUS in do_unaligned_user
    signal/um: Use force_sig_fault where appropriate
    signal/sparc: Use force_sig_fault where appropriate
    signal/sparc: Use send_sig_fault where appropriate
    signal/sh: Use force_sig_fault where appropriate
    signal/s390: Use force_sig_fault where appropriate
    signal/riscv: Replace do_trap_siginfo with force_sig_fault
    signal/riscv: Use force_sig_fault where appropriate
    signal/parisc: Use force_sig_fault where appropriate
    signal/parisc: Use force_sig_mceerr where appropriate
    signal/openrisc: Use force_sig_fault where appropriate
    signal/nios2: Use force_sig_fault where appropriate
    ...

    Linus Torvalds
     

07 May, 2018

1 commit

  • This was used by the ide, scsi and networking code in the past to
    determine if they should bounce payloads. Now that the dma mapping
    always have to support dma to all physical memory (thanks to swiotlb
    for non-iommu systems) there is no need to this crude hack any more.

    Signed-off-by: Christoph Hellwig
    Acked-by: Palmer Dabbelt (for riscv)
    Reviewed-by: Jens Axboe

    Christoph Hellwig
     

25 Apr, 2018

2 commits

  • Filling in struct siginfo before calling force_sig_info a tedious and
    error prone process, where once in a great while the wrong fields
    are filled out, and siginfo has been inconsistently cleared.

    Simplify this process by using the helper force_sig_fault. Which
    takes as a parameters all of the information it needs, ensures
    all of the fiddly bits of filling in struct siginfo are done properly
    and then calls force_sig_info.

    In short about a 5 line reduction in code for every time force_sig_info
    is called, which makes the calling function clearer.

    Cc: Richard Kuo
    Cc: linux-hexagon@vger.kernel.org
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     
  • Call clear_siginfo to ensure every stack allocated siginfo is properly
    initialized before being passed to the signal sending functions.

    Note: It is not safe to depend on C initializers to initialize struct
    siginfo on the stack because C is allowed to skip holes when
    initializing a structure.

    The initialization of struct siginfo in tracehook_report_syscall_exit
    was moved from the helper user_single_step_siginfo into
    tracehook_report_syscall_exit itself, to make it clear that the local
    variable siginfo gets fully initialized.

    In a few cases the scope of struct siginfo has been reduced to make it
    clear that siginfo siginfo is not used on other paths in the function
    in which it is declared.

    Instances of using memset to initialize siginfo have been replaced
    with calls clear_siginfo for clarity.

    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     

01 Feb, 2018

1 commit

  • Pull dma mapping updates from Christoph Hellwig:
    "Except for a runtime warning fix from Christian this is all about
    consolidation of the generic no-IOMMU code, a well as the glue code
    for swiotlb.

    All the code is based on the x86 implementation with hooks to allow
    all architectures that aren't cache coherent to use it.

    The x86 conversion itself has been deferred because the x86
    maintainers were a little busy in the last months"

    * tag 'dma-mapping-4.16' of git://git.infradead.org/users/hch/dma-mapping: (57 commits)
    MAINTAINERS: add the iommu list for swiotlb and xen-swiotlb
    arm64: use swiotlb_alloc and swiotlb_free
    arm64: replace ZONE_DMA with ZONE_DMA32
    mips: use swiotlb_{alloc,free}
    mips/netlogic: remove swiotlb support
    tile: use generic swiotlb_ops
    tile: replace ZONE_DMA with ZONE_DMA32
    unicore32: use generic swiotlb_ops
    ia64: remove an ifdef around the content of pci-dma.c
    ia64: clean up swiotlb support
    ia64: use generic swiotlb_ops
    ia64: replace ZONE_DMA with ZONE_DMA32
    swiotlb: remove various exports
    swiotlb: refactor coherent buffer allocation
    swiotlb: refactor coherent buffer freeing
    swiotlb: wire up ->dma_supported in swiotlb_dma_ops
    swiotlb: add common swiotlb_map_ops
    swiotlb: rename swiotlb_free to swiotlb_exit
    x86: rename swiotlb_dma_ops
    powerpc: rename swiotlb_dma_ops
    ...

    Linus Torvalds
     

10 Jan, 2018

2 commits


18 Nov, 2017

1 commit

  • Pull Kbuild updates from Masahiro Yamada:
    "One of the most remarkable improvements in this cycle is, Kbuild is
    now able to cache the result of shell commands. Some variables are
    expensive to compute, for example, $(call cc-option,...) invokes the
    compiler. It is not efficient to redo this computation every time,
    even when we are not actually building anything. Kbuild creates a
    hidden file ".cache.mk" that contains invoked shell commands and their
    results. The speed-up should be noticeable.

    Summary:

    - Fix arch build issues (hexagon, sh)

    - Clean up various Makefiles and scripts

    - Fix wrong usage of {CFLAGS,LDFLAGS}_MODULE in arch Makefiles

    - Cache variables that are expensive to compute

    - Improve cc-ldopton and ld-option for Clang

    - Optimize output directory creation"

    * tag 'kbuild-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (30 commits)
    kbuild: move coccicheck help from scripts/Makefile.help to top Makefile
    sh: decompressor: add shipped files to .gitignore
    frv: .gitignore: ignore vmlinux.lds
    selinux: remove unnecessary assignment to subdir-
    kbuild: specify FORCE in Makefile.headersinst as .PHONY target
    kbuild: remove redundant mkdir from ./Kbuild
    kbuild: optimize object directory creation for incremental build
    kbuild: create object directories simpler and faster
    kbuild: filter-out PHONY targets from "targets"
    kbuild: remove redundant $(wildcard ...) for cmd_files calculation
    kbuild: create directory for make cache only when necessary
    sh: select KBUILD_DEFCONFIG depending on ARCH
    kbuild: fix linker feature test macros when cross compiling with Clang
    kbuild: shrink .cache.mk when it exceeds 1000 lines
    kbuild: do not call cc-option before KBUILD_CFLAGS initialization
    kbuild: Cache a few more calls to the compiler
    kbuild: Add a cache for generated variables
    kbuild: add forward declaration of default target to Makefile.asm-generic
    kbuild: remove KBUILD_SUBDIR_ASFLAGS and KBUILD_SUBDIR_CCFLAGS
    hexagon/kbuild: replace CFLAGS_MODULE with KBUILD_CFLAGS_MODULE
    ...

    Linus Torvalds
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

09 Oct, 2017

1 commit

  • is created (or updated) when Kbuild descends
    into the init/ directory. In parallel building from a pristine
    source tree, there is no guarantee exists when
    arch/hexagon/kernel/ptrace.c is compiled.

    For hexagon architecture, we know UTS_MACHINE is a fixed string
    "hexagon", so let's hard-code it, like many architectures do.

    Signed-off-by: Masahiro Yamada
    Acked-by: Richard Kuo

    Masahiro Yamada
     

07 Jul, 2017

3 commits

  • Merge misc updates from Andrew Morton:

    - a few hotfixes

    - various misc updates

    - ocfs2 updates

    - most of MM

    * emailed patches from Andrew Morton : (108 commits)
    mm, memory_hotplug: move movable_node to the hotplug proper
    mm, memory_hotplug: drop CONFIG_MOVABLE_NODE
    mm, memory_hotplug: drop artificial restriction on online/offline
    mm: memcontrol: account slab stats per lruvec
    mm: memcontrol: per-lruvec stats infrastructure
    mm: memcontrol: use generic mod_memcg_page_state for kmem pages
    mm: memcontrol: use the node-native slab memory counters
    mm: vmstat: move slab statistics from zone to node counters
    mm/zswap.c: delete an error message for a failed memory allocation in zswap_dstmem_prepare()
    mm/zswap.c: improve a size determination in zswap_frontswap_init()
    mm/zswap.c: delete an error message for a failed memory allocation in zswap_pool_create()
    mm/swapfile.c: sort swap entries before free
    mm/oom_kill: count global and memory cgroup oom kills
    mm: per-cgroup memory reclaim stats
    mm: kmemleak: treat vm_struct as alternative reference to vmalloc'ed objects
    mm: kmemleak: factor object reference updating out of scan_block()
    mm: kmemleak: slightly reduce the size of some structures on 64-bit architectures
    mm, mempolicy: don't check cpuset seqlock where it doesn't matter
    mm, cpuset: always use seqlock when changing task's nodemask
    mm, mempolicy: simplify rebinding mempolicies when updating cpusets
    ...

    Linus Torvalds
     
  • Pull dma-mapping infrastructure from Christoph Hellwig:
    "This is the first pull request for the new dma-mapping subsystem

    In this new subsystem we'll try to properly maintain all the generic
    code related to dma-mapping, and will further consolidate arch code
    into common helpers.

    This pull request contains:

    - removal of the DMA_ERROR_CODE macro, replacing it with calls to
    ->mapping_error so that the dma_map_ops instances are more self
    contained and can be shared across architectures (me)

    - removal of the ->set_dma_mask method, which duplicates the
    ->dma_capable one in terms of functionality, but requires more
    duplicate code.

    - various updates for the coherent dma pool and related arm code
    (Vladimir)

    - various smaller cleanups (me)"

    * tag 'dma-mapping-4.13' of git://git.infradead.org/users/hch/dma-mapping: (56 commits)
    ARM: dma-mapping: Remove traces of NOMMU code
    ARM: NOMMU: Set ARM_DMA_MEM_BUFFERABLE for M-class cpus
    ARM: NOMMU: Introduce dma operations for noMMU
    drivers: dma-mapping: allow dma_common_mmap() for NOMMU
    drivers: dma-coherent: Introduce default DMA pool
    drivers: dma-coherent: Account dma_pfn_offset when used with device tree
    dma: Take into account dma_pfn_offset
    dma-mapping: replace dmam_alloc_noncoherent with dmam_alloc_attrs
    dma-mapping: remove dmam_free_noncoherent
    crypto: qat - avoid an uninitialized variable warning
    au1100fb: remove a bogus dma_free_nonconsistent call
    MAINTAINERS: add entry for dma mapping helpers
    powerpc: merge __dma_set_mask into dma_set_mask
    dma-mapping: remove the set_dma_mask method
    powerpc/cell: use the dma_supported method for ops switching
    powerpc/cell: clean up fixed mapping dma_ops initialization
    tile: remove dma_supported and mapping_error methods
    xen-swiotlb: remove xen_swiotlb_set_dma_mask
    arm: implement ->dma_supported instead of ->set_dma_mask
    mips/loongson64: implement ->dma_supported instead of ->set_dma_mask
    ...

    Linus Torvalds
     
  • lruvecs are at the intersection of the NUMA node and memcg, which is the
    scope for most paging activity.

    Introduce a convenient accounting infrastructure that maintains
    statistics per node, per memcg, and the lruvec itself.

    Then convert over accounting sites for statistics that are already
    tracked in both nodes and memcgs and can be easily switched.

    [hannes@cmpxchg.org: fix crash in the new cgroup stat keeping code]
    Link: http://lkml.kernel.org/r/20170531171450.GA10481@cmpxchg.org
    [hannes@cmpxchg.org: don't track uncharged pages at all
    Link: http://lkml.kernel.org/r/20170605175254.GA8547@cmpxchg.org
    [hannes@cmpxchg.org: add missing free_percpu()]
    Link: http://lkml.kernel.org/r/20170605175354.GB8547@cmpxchg.org
    [linux@roeck-us.net: hexagon: fix build error caused by include file order]
    Link: http://lkml.kernel.org/r/20170617153721.GA4382@roeck-us.net
    Link: http://lkml.kernel.org/r/20170530181724.27197-6-hannes@cmpxchg.org
    Signed-off-by: Johannes Weiner
    Signed-off-by: Guenter Roeck
    Acked-by: Vladimir Davydov
    Cc: Josef Bacik
    Cc: Michal Hocko
    Cc: Rik van Riel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     

29 Jun, 2017

1 commit

  • The only user of thread_saved_pc() in non-arch-specific code was removed
    in commit 8243d5597793 ("sched/core: Remove pointless printout in
    sched_show_task()"). Remove the implementations as well.

    Some architectures use thread_saved_pc() in their arch-specific code.
    Leave their thread_saved_pc() intact.

    Signed-off-by: Tobias Klauser
    Acked-by: Geert Uytterhoeven
    Cc: Ingo Molnar
    Signed-off-by: Linus Torvalds

    Tobias Klauser
     

28 Jun, 2017

2 commits


02 May, 2017

1 commit

  • Pull timer updates from Thomas Gleixner:
    "The timer departement delivers:

    - more year 2038 rework

    - a massive rework of the arm achitected timer

    - preparatory patches to allow NTP correction of clock event devices
    to avoid early expiry

    - the usual pile of fixes and enhancements all over the place"

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (91 commits)
    timer/sysclt: Restrict timer migration sysctl values to 0 and 1
    arm64/arch_timer: Mark errata handlers as __maybe_unused
    Clocksource/mips-gic: Remove redundant non devicetree init
    MIPS/Malta: Probe gic-timer via devicetree
    clocksource: Use GENMASK_ULL in definition of CLOCKSOURCE_MASK
    acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver
    clocksource: arm_arch_timer: add GTDT support for memory-mapped timer
    acpi/arm64: Add memory-mapped timer support in GTDT driver
    clocksource: arm_arch_timer: simplify ACPI support code.
    acpi/arm64: Add GTDT table parse driver
    clocksource: arm_arch_timer: split MMIO timer probing.
    clocksource: arm_arch_timer: add structs to describe MMIO timer
    clocksource: arm_arch_timer: move arch_timer_needs_of_probing into DT init call
    clocksource: arm_arch_timer: refactor arch_timer_needs_probing
    clocksource: arm_arch_timer: split dt-only rate handling
    x86/uv/time: Set ->min_delta_ticks and ->max_delta_ticks
    unicore32/time: Set ->min_delta_ticks and ->max_delta_ticks
    um/time: Set ->min_delta_ticks and ->max_delta_ticks
    tile/time: Set ->min_delta_ticks and ->max_delta_ticks
    score/time: Set ->min_delta_ticks and ->max_delta_ticks
    ...

    Linus Torvalds
     

25 Apr, 2017

1 commit


15 Apr, 2017

1 commit

  • In preparation for making the clockevents core NTP correction aware,
    all clockevent device drivers must set ->min_delta_ticks and
    ->max_delta_ticks rather than ->min_delta_ns and ->max_delta_ns: a
    clockevent device's rate is going to change dynamically and thus, the
    ratio of ns to ticks ceases to stay invariant.

    Make the hexagon arch's clockevent driver initialize these fields
    properly.

    This patch alone doesn't introduce any change in functionality as the
    clockevents core still looks exclusively at the (untouched) ->min_delta_ns
    and ->max_delta_ns. As soon as this has changed, a followup patch will
    purge the initialization of ->min_delta_ns and ->max_delta_ns from this
    driver.

    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Daniel Lezcano
    Cc: Richard Cochran
    Cc: Prarit Bhargava
    Cc: Stephen Boyd
    Cc: Richard Kuo
    Cc: linux-hexagon@vger.kernel.org
    Acked-by: Richard Kuo
    Signed-off-by: Nicolai Stange
    Signed-off-by: John Stultz

    Nicolai Stange
     

03 Mar, 2017

1 commit

  • Move the following task->mm helper APIs into a new header file,
    , to further reduce the size and complexity
    of .

    Here are how the APIs are used in various kernel files:

    # mm_alloc():
    arch/arm/mach-rpc/ecard.c
    fs/exec.c
    include/linux/sched/mm.h
    kernel/fork.c

    # __mmdrop():
    arch/arc/include/asm/mmu_context.h
    include/linux/sched/mm.h
    kernel/fork.c

    # mmdrop():
    arch/arm/mach-rpc/ecard.c
    arch/m68k/sun3/mmu_emu.c
    arch/x86/mm/tlb.c
    drivers/gpu/drm/amd/amdkfd/kfd_process.c
    drivers/gpu/drm/i915/i915_gem_userptr.c
    drivers/infiniband/hw/hfi1/file_ops.c
    drivers/vfio/vfio_iommu_spapr_tce.c
    fs/exec.c
    fs/proc/base.c
    fs/proc/task_mmu.c
    fs/proc/task_nommu.c
    fs/userfaultfd.c
    include/linux/mmu_notifier.h
    include/linux/sched/mm.h
    kernel/fork.c
    kernel/futex.c
    kernel/sched/core.c
    mm/khugepaged.c
    mm/ksm.c
    mm/mmu_context.c
    mm/mmu_notifier.c
    mm/oom_kill.c
    virt/kvm/kvm_main.c

    # mmdrop_async_fn():
    include/linux/sched/mm.h

    # mmdrop_async():
    include/linux/sched/mm.h
    kernel/fork.c

    # mmget_not_zero():
    fs/userfaultfd.c
    include/linux/sched/mm.h
    mm/oom_kill.c

    # mmput():
    arch/arc/include/asm/mmu_context.h
    arch/arc/kernel/troubleshoot.c
    arch/frv/mm/mmu-context.c
    arch/powerpc/platforms/cell/spufs/context.c
    arch/sparc/include/asm/mmu_context_32.h
    drivers/android/binder.c
    drivers/gpu/drm/etnaviv/etnaviv_gem.c
    drivers/gpu/drm/i915/i915_gem_userptr.c
    drivers/infiniband/core/umem.c
    drivers/infiniband/core/umem_odp.c
    drivers/infiniband/core/uverbs_main.c
    drivers/infiniband/hw/mlx4/main.c
    drivers/infiniband/hw/mlx5/main.c
    drivers/infiniband/hw/usnic/usnic_uiom.c
    drivers/iommu/amd_iommu_v2.c
    drivers/iommu/intel-svm.c
    drivers/lguest/lguest_user.c
    drivers/misc/cxl/fault.c
    drivers/misc/mic/scif/scif_rma.c
    drivers/oprofile/buffer_sync.c
    drivers/vfio/vfio_iommu_type1.c
    drivers/vhost/vhost.c
    drivers/xen/gntdev.c
    fs/exec.c
    fs/proc/array.c
    fs/proc/base.c
    fs/proc/task_mmu.c
    fs/proc/task_nommu.c
    fs/userfaultfd.c
    include/linux/sched/mm.h
    kernel/cpuset.c
    kernel/events/core.c
    kernel/events/uprobes.c
    kernel/exit.c
    kernel/fork.c
    kernel/ptrace.c
    kernel/sys.c
    kernel/trace/trace_output.c
    kernel/tsacct.c
    mm/memcontrol.c
    mm/memory.c
    mm/mempolicy.c
    mm/migrate.c
    mm/mmu_notifier.c
    mm/nommu.c
    mm/oom_kill.c
    mm/process_vm_access.c
    mm/rmap.c
    mm/swapfile.c
    mm/util.c
    virt/kvm/async_pf.c

    # mmput_async():
    include/linux/sched/mm.h
    kernel/fork.c
    mm/oom_kill.c

    # get_task_mm():
    arch/arc/kernel/troubleshoot.c
    arch/powerpc/platforms/cell/spufs/context.c
    drivers/android/binder.c
    drivers/gpu/drm/etnaviv/etnaviv_gem.c
    drivers/infiniband/core/umem.c
    drivers/infiniband/core/umem_odp.c
    drivers/infiniband/hw/mlx4/main.c
    drivers/infiniband/hw/mlx5/main.c
    drivers/infiniband/hw/usnic/usnic_uiom.c
    drivers/iommu/amd_iommu_v2.c
    drivers/iommu/intel-svm.c
    drivers/lguest/lguest_user.c
    drivers/misc/cxl/fault.c
    drivers/misc/mic/scif/scif_rma.c
    drivers/oprofile/buffer_sync.c
    drivers/vfio/vfio_iommu_type1.c
    drivers/vhost/vhost.c
    drivers/xen/gntdev.c
    fs/proc/array.c
    fs/proc/base.c
    fs/proc/task_mmu.c
    include/linux/sched/mm.h
    kernel/cpuset.c
    kernel/events/core.c
    kernel/exit.c
    kernel/fork.c
    kernel/ptrace.c
    kernel/sys.c
    kernel/trace/trace_output.c
    kernel/tsacct.c
    mm/memcontrol.c
    mm/memory.c
    mm/mempolicy.c
    mm/migrate.c
    mm/mmu_notifier.c
    mm/nommu.c
    mm/util.c

    # mm_access():
    fs/proc/base.c
    include/linux/sched/mm.h
    kernel/fork.c
    mm/process_vm_access.c

    # mm_release():
    arch/arc/include/asm/mmu_context.h
    fs/exec.c
    include/linux/sched/mm.h
    include/uapi/linux/sched.h
    kernel/exit.c
    kernel/fork.c

    Acked-by: Linus Torvalds
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

02 Mar, 2017

3 commits