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
     

27 Sep, 2019

1 commit

  • The naming of pgtable_page_{ctor,dtor}() seems to have confused a few
    people, and until recently arm64 used these erroneously/pointlessly for
    other levels of page table.

    To make it incredibly clear that these only apply to the PTE level, and to
    align with the naming of pgtable_pmd_page_{ctor,dtor}(), let's rename them
    to pgtable_pte_page_{ctor,dtor}().

    These changes were generated with the following shell script:

    ----
    git grep -lw 'pgtable_page_.tor' | while read FILE; do
    sed -i '{s/pgtable_page_ctor/pgtable_pte_page_ctor/}' $FILE;
    sed -i '{s/pgtable_page_dtor/pgtable_pte_page_dtor/}' $FILE;
    done
    ----

    ... with the documentation re-flowed to remain under 80 columns, and
    whitespace fixed up in macros to keep backslashes aligned.

    There should be no functional change as a result of this patch.

    Link: http://lkml.kernel.org/r/20190722141133.3116-1-mark.rutland@arm.com
    Signed-off-by: Mark Rutland
    Reviewed-by: Mike Rapoport
    Acked-by: Geert Uytterhoeven [m68k]
    Cc: Anshuman Khandual
    Cc: Matthew Wilcox
    Cc: Michal Hocko
    Cc: Yu Zhao
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Rutland
     

26 Sep, 2019

1 commit

  • hexagon never reserves or initializes initrd and the only mention of it is
    the empty free_initrd_mem() function.

    As we have a generic implementation of free_initrd_mem(), there is no need
    to define an empty stub for the hexagon implementation and it can be
    dropped.

    Link: http://lkml.kernel.org/r/1565858133-25852-1-git-send-email-rppt@linux.ibm.com
    Signed-off-by: Mike Rapoport
    Reviewed-by: Christoph Hellwig
    Cc: Richard Kuo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     

25 Sep, 2019

2 commits

  • Both pgtable_cache_init() and pgd_cache_init() are used to initialize kmem
    cache for page table allocations on several architectures that do not use
    PAGE_SIZE tables for one or more levels of the page table hierarchy.

    Most architectures do not implement these functions and use __weak default
    NOP implementation of pgd_cache_init(). Since there is no such default
    for pgtable_cache_init(), its empty stub is duplicated among most
    architectures.

    Rename the definitions of pgd_cache_init() to pgtable_cache_init() and
    drop empty stubs of pgtable_cache_init().

    Link: http://lkml.kernel.org/r/1566457046-22637-1-git-send-email-rppt@linux.ibm.com
    Signed-off-by: Mike Rapoport
    Acked-by: Will Deacon [arm64]
    Acked-by: Thomas Gleixner [x86]
    Cc: Catalin Marinas
    Cc: Ingo Molnar
    Cc: Borislav Petkov
    Cc: Matthew Wilcox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • Patch series "mm: remove quicklist page table caches".

    A while ago Nicholas proposed to remove quicklist page table caches [1].

    I've rebased his patch on the curren upstream and switched ia64 and sh to
    use generic versions of PTE allocation.

    [1] https://lore.kernel.org/linux-mm/20190711030339.20892-1-npiggin@gmail.com

    This patch (of 3):

    Remove page table allocator "quicklists". These have been around for a
    long time, but have not got much traction in the last decade and are only
    used on ia64 and sh architectures.

    The numbers in the initial commit look interesting but probably don't
    apply anymore. If anybody wants to resurrect this it's in the git
    history, but it's unhelpful to have this code and divergent allocator
    behaviour for minor archs.

    Also it might be better to instead make more general improvements to page
    allocator if this is still so slow.

    Link: http://lkml.kernel.org/r/1565250728-21721-2-git-send-email-rppt@linux.ibm.com
    Signed-off-by: Nicholas Piggin
    Signed-off-by: Mike Rapoport
    Cc: Tony Luck
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nicholas Piggin
     

22 Jul, 2019

1 commit

  • The hexagon implementation pte_alloc_one(), pte_alloc_one_kernel(),
    pte_free_kernel() and pte_free() is identical to the generic except of
    lack of __GFP_ACCOUNT for the user PTEs allocation.

    Switch hexagon to use generic version of these functions.

    Signed-off-by: Mike Rapoport
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     

17 Jul, 2019

1 commit

  • syscall_get_* functions are required to be implemented on all
    architectures in order to extend the generic ptrace API with
    PTRACE_GET_SYSCALL_INFO request.

    This adds remaining 2 syscall_get_* functions as documented in
    asm-generic/syscall.h: syscall_get_error and syscall_get_return_value.

    Link: http://lkml.kernel.org/r/20190510152756.GB28558@altlinux.org
    Signed-off-by: Dmitry V. Levin
    Cc: Richard Kuo
    Cc: Elvira Khabirova
    Cc: Eugene Syromyatnikov
    Cc: Oleg Nesterov
    Cc: Andy Lutomirski
    Cc: Benjamin Herrenschmidt
    Cc: Greentime Hu
    Cc: Helge Deller [parisc]
    Cc: James E.J. Bottomley
    Cc: James Hogan
    Cc: kbuild test robot
    Cc: Kees Cook
    Cc: Michael Ellerman
    Cc: Paul Burton
    Cc: Paul Mackerras
    Cc: Ralf Baechle
    Cc: Shuah Khan
    Cc: Vincent Chen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitry V. Levin
     

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
     

31 May, 2019

1 commit

  • Add SPDX license identifiers to all Make/Kconfig files which:

    - Have no license information of any form

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0

    Reported-by: Masahiro Yamada
    Signed-off-by: Greg Kroah-Hartman
    Reviewed-by: Kate Stewart
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

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


21 May, 2019

1 commit


17 May, 2019

1 commit

  • Pull nommu generic uaccess updates from Arnd Bergmann:
    "asm-generic: kill and improve nommu generic uaccess helpers

    Christoph Hellwig writes:

    This is a series doing two somewhat interwinded things. It improves
    the asm-generic nommu uaccess helper to optionally be entirely
    generic and not require any arch helpers for the actual uaccess.
    For the generic uaccess.h to actually be generically useful I also
    had to kill off the mess we made of , which really
    shouldn't exist on most architectures"

    * tag 'asm-generic-nommu' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
    asm-generic: optimize generic uaccess for 8-byte loads and stores
    asm-generic: provide entirely generic nommu uaccess
    arch: mostly remove
    asm-generic: don't include from

    Linus Torvalds
     

15 May, 2019

3 commits

  • Now that all instances of #include have been replaced with
    #include , we can remove these.

    Link: http://lkml.kernel.org/r/1553267665-27228-2-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     
  • Most architectures do not need the memblock memory after the page
    allocator is initialized, but only few enable ARCH_DISCARD_MEMBLOCK in the
    arch Kconfig.

    Replacing ARCH_DISCARD_MEMBLOCK with ARCH_KEEP_MEMBLOCK and inverting the
    logic makes it clear which architectures actually use memblock after
    system initialization and skips the necessity to add ARCH_DISCARD_MEMBLOCK
    to the architectures that are still missing that option.

    Link: http://lkml.kernel.org/r/1556102150-32517-1-git-send-email-rppt@linux.ibm.com
    Signed-off-by: Mike Rapoport
    Acked-by: Michael Ellerman (powerpc)
    Cc: Russell King
    Cc: Catalin Marinas
    Cc: Will Deacon
    Cc: Richard Kuo
    Cc: Tony Luck
    Cc: Fenghua Yu
    Cc: Geert Uytterhoeven
    Cc: Ralf Baechle
    Cc: Paul Burton
    Cc: James Hogan
    Cc: Ley Foon Tan
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Yoshinori Sato
    Cc: Rich Felker
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Borislav Petkov
    Cc: "H. Peter Anvin"
    Cc: Eric Biederman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • hexagon implementation of free_initmem() is currently empty and marked
    with comment

    * Todo: free pages between __init_begin and __init_end; possibly
    * some devtree related stuff as well.

    Switch it to the generic implementation.

    Link: http://lkml.kernel.org/r/1550515285-17446-3-git-send-email-rppt@linux.ibm.com
    Signed-off-by: Mike Rapoport
    Reviewed-by: Andrew Morton
    Cc: Christoph Hellwig
    Cc: Palmer Dabbelt
    Cc: Richard Kuo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     

08 May, 2019

1 commit

  • Pull audit updates from Paul Moore:
    "We've got a reasonably broad set of audit patches for the v5.2 merge
    window, the highlights are below:

    - The biggest change, and the source of all the arch/* changes, is
    the patchset from Dmitry to help enable some of the work he is
    doing around PTRACE_GET_SYSCALL_INFO.

    To be honest, including this in the audit tree is a bit of a
    stretch, but it does help move audit a little further along towards
    proper syscall auditing for all arches, and everyone else seemed to
    agree that audit was a "good" spot for this to land (or maybe they
    just didn't want to merge it? dunno.).

    - We can now audit time/NTP adjustments.

    - We continue the work to connect associated audit records into a
    single event"

    * tag 'audit-pr-20190507' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: (21 commits)
    audit: fix a memory leak bug
    ntp: Audit NTP parameters adjustment
    timekeeping: Audit clock adjustments
    audit: purge unnecessary list_empty calls
    audit: link integrity evm_write_xattrs record to syscall event
    syscall_get_arch: add "struct task_struct *" argument
    unicore32: define syscall_get_arch()
    Move EM_UNICORE to uapi/linux/elf-em.h
    nios2: define syscall_get_arch()
    nds32: define syscall_get_arch()
    Move EM_NDS32 to uapi/linux/elf-em.h
    m68k: define syscall_get_arch()
    hexagon: define syscall_get_arch()
    Move EM_HEXAGON to uapi/linux/elf-em.h
    h8300: define syscall_get_arch()
    c6x: define syscall_get_arch()
    arc: define syscall_get_arch()
    Move EM_ARCOMPACT and EM_ARCV2 to uapi/linux/elf-em.h
    audit: Make audit_log_cap and audit_copy_inode static
    audit: connect LOGIN record to its syscall record
    ...

    Linus Torvalds
     

07 May, 2019

3 commits

  • Pull mmiowb removal from Will Deacon:
    "Remove Mysterious Macro Intended to Obscure Weird Behaviours (mmiowb())

    Remove mmiowb() from the kernel memory barrier API and instead, for
    architectures that need it, hide the barrier inside spin_unlock() when
    MMIO has been performed inside the critical section.

    The only relatively recent changes have been addressing review
    comments on the documentation, which is in a much better shape thanks
    to the efforts of Ben and Ingo.

    I was initially planning to split this into two pull requests so that
    you could run the coccinelle script yourself, however it's been plain
    sailing in linux-next so I've just included the whole lot here to keep
    things simple"

    * tag 'arm64-mmiowb' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (23 commits)
    docs/memory-barriers.txt: Update I/O section to be clearer about CPU vs thread
    docs/memory-barriers.txt: Fix style, spacing and grammar in I/O section
    arch: Remove dummy mmiowb() definitions from arch code
    net/ethernet/silan/sc92031: Remove stale comment about mmiowb()
    i40iw: Redefine i40iw_mmiowb() to do nothing
    scsi/qla1280: Remove stale comment about mmiowb()
    drivers: Remove explicit invocations of mmiowb()
    drivers: Remove useless trailing comments from mmiowb() invocations
    Documentation: Kill all references to mmiowb()
    riscv/mmiowb: Hook up mmwiob() implementation to asm-generic code
    powerpc/mmiowb: Hook up mmwiob() implementation to asm-generic code
    ia64/mmiowb: Add unconditional mmiowb() to arch_spin_unlock()
    mips/mmiowb: Add unconditional mmiowb() to arch_spin_unlock()
    sh/mmiowb: Add unconditional mmiowb() to arch_spin_unlock()
    m68k/io: Remove useless definition of mmiowb()
    nds32/io: Remove useless definition of mmiowb()
    x86/io: Remove useless definition of mmiowb()
    arm64/io: Remove useless definition of mmiowb()
    ARM/io: Remove useless definition of mmiowb()
    mmiowb: Hook up mmiowb helpers to spinlocks and generic I/O accessors
    ...

    Linus Torvalds
     
  • Pull locking updates from Ingo Molnar:
    "Here are the locking changes in this cycle:

    - rwsem unification and simpler micro-optimizations to prepare for
    more intrusive (and more lucrative) scalability improvements in
    v5.3 (Waiman Long)

    - Lockdep irq state tracking flag usage cleanups (Frederic
    Weisbecker)

    - static key improvements (Jakub Kicinski, Peter Zijlstra)

    - misc updates, cleanups and smaller fixes"

    * 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (26 commits)
    locking/lockdep: Remove unnecessary unlikely()
    locking/static_key: Don't take sleeping locks in __static_key_slow_dec_deferred()
    locking/static_key: Factor out the fast path of static_key_slow_dec()
    locking/static_key: Add support for deferred static branches
    locking/lockdep: Test all incompatible scenarios at once in check_irq_usage()
    locking/lockdep: Avoid bogus Clang warning
    locking/lockdep: Generate LOCKF_ bit composites
    locking/lockdep: Use expanded masks on find_usage_*() functions
    locking/lockdep: Map remaining magic numbers to lock usage mask names
    locking/lockdep: Move valid_state() inside CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING
    locking/rwsem: Prevent unneeded warning during locking selftest
    locking/rwsem: Optimize rwsem structure for uncontended lock acquisition
    locking/rwsem: Enable lock event counting
    locking/lock_events: Don't show pvqspinlock events on bare metal
    locking/lock_events: Make lock_events available for all archs & other locks
    locking/qspinlock_stat: Introduce generic lockevent_*() counting APIs
    locking/rwsem: Enhance DEBUG_RWSEMS_WARN_ON() macro
    locking/rwsem: Add debug check for __down_read*()
    locking/rwsem: Micro-optimize rwsem_try_read_lock_unqueued()
    locking/rwsem: Move rwsem internal function declarations to rwsem-xadd.h
    ...

    Linus Torvalds
     
  • Pull unified TLB flushing from Ingo Molnar:
    "This contains the generic mmu_gather feature from Peter Zijlstra,
    which is an all-arch unification of TLB flushing APIs, via the
    following (broad) steps:

    - enhance the APIs to cover more arch details

    - convert most TLB flushing arch implementations to the generic
    APIs.

    - remove leftovers of per arch implementations

    After this series every single architecture makes use of the unified
    TLB flushing APIs"

    * 'core-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    mm/resource: Use resource_overlaps() to simplify region_intersects()
    ia64/tlb: Eradicate tlb_migrate_finish() callback
    asm-generic/tlb: Remove tlb_table_flush()
    asm-generic/tlb: Remove tlb_flush_mmu_free()
    asm-generic/tlb: Remove CONFIG_HAVE_GENERIC_MMU_GATHER
    asm-generic/tlb: Remove arch_tlb*_mmu()
    s390/tlb: Convert to generic mmu_gather
    asm-generic/tlb: Introduce CONFIG_HAVE_MMU_GATHER_NO_GATHER=y
    arch/tlb: Clean up simple architectures
    um/tlb: Convert to generic mmu_gather
    sh/tlb: Convert SH to generic mmu_gather
    ia64/tlb: Convert to generic mmu_gather
    arm/tlb: Convert to generic mmu_gather
    asm-generic/tlb, arch: Invert CONFIG_HAVE_RCU_TABLE_INVALIDATE
    asm-generic/tlb, ia64: Conditionally provide tlb_migrate_finish()
    asm-generic/tlb: Provide generic tlb_flush() based on flush_tlb_mm()
    asm-generic/tlb, arch: Provide generic tlb_flush() based on flush_tlb_range()
    asm-generic/tlb, arch: Provide generic VIPT cache flush
    asm-generic/tlb, arch: Provide CONFIG_HAVE_MMU_GATHER_PAGE_SIZE
    asm-generic/tlb: Provide a comment

    Linus Torvalds
     

24 Apr, 2019

1 commit


10 Apr, 2019

1 commit


08 Apr, 2019

2 commits


05 Apr, 2019

1 commit

  • At Linux Plumbers, Andy Lutomirski approached me and pointed out that the
    function call syscall_get_arguments() implemented in x86 was horribly
    written and not optimized for the standard case of passing in 0 and 6 for
    the starting index and the number of system calls to get. When looking at
    all the users of this function, I discovered that all instances pass in only
    0 and 6 for these arguments. Instead of having this function handle
    different cases that are never used, simply rewrite it to return the first 6
    arguments of a system call.

    This should help out the performance of tracing system calls by ptrace,
    ftrace and perf.

    Link: http://lkml.kernel.org/r/20161107213233.754809394@goodmis.org

    Cc: Oleg Nesterov
    Cc: Kees Cook
    Cc: Andy Lutomirski
    Cc: Dominik Brodowski
    Cc: Dave Martin
    Cc: "Dmitry V. Levin"
    Cc: x86@kernel.org
    Cc: linux-snps-arc@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-c6x-dev@linux-c6x.org
    Cc: uclinux-h8-devel@lists.sourceforge.jp
    Cc: linux-hexagon@vger.kernel.org
    Cc: linux-ia64@vger.kernel.org
    Cc: linux-mips@vger.kernel.org
    Cc: nios2-dev@lists.rocketboards.org
    Cc: openrisc@lists.librecores.org
    Cc: linux-parisc@vger.kernel.org
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: linux-riscv@lists.infradead.org
    Cc: linux-s390@vger.kernel.org
    Cc: linux-sh@vger.kernel.org
    Cc: sparclinux@vger.kernel.org
    Cc: linux-um@lists.infradead.org
    Cc: linux-xtensa@linux-xtensa.org
    Cc: linux-arch@vger.kernel.org
    Acked-by: Paul Burton # MIPS parts
    Acked-by: Max Filippov # For xtensa changes
    Acked-by: Will Deacon # For the arm64 bits
    Reviewed-by: Thomas Gleixner # for x86
    Reviewed-by: Dmitry V. Levin
    Reported-by: Andy Lutomirski
    Signed-off-by: Steven Rostedt (VMware)

    Steven Rostedt (Red Hat)
     

03 Apr, 2019

3 commits

  • Currently, we have two different implementation of rwsem:

    1) CONFIG_RWSEM_GENERIC_SPINLOCK (rwsem-spinlock.c)
    2) CONFIG_RWSEM_XCHGADD_ALGORITHM (rwsem-xadd.c)

    As we are going to use a single generic implementation for rwsem-xadd.c
    and no architecture-specific code will be needed, there is no point
    in keeping two different implementations of rwsem. In most cases, the
    performance of rwsem-spinlock.c will be worse. It also doesn't get all
    the performance tuning and optimizations that had been implemented in
    rwsem-xadd.c over the years.

    For simplication, we are going to remove rwsem-spinlock.c and make all
    architectures use a single implementation of rwsem - rwsem-xadd.c.

    All references to RWSEM_GENERIC_SPINLOCK and RWSEM_XCHGADD_ALGORITHM
    in the code are removed.

    Suggested-by: Peter Zijlstra
    Signed-off-by: Waiman Long
    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Linus Torvalds
    Cc: Andrew Morton
    Cc: Arnd Bergmann
    Cc: Borislav Petkov
    Cc: Davidlohr Bueso
    Cc: H. Peter Anvin
    Cc: Paul E. McKenney
    Cc: Thomas Gleixner
    Cc: Tim Chen
    Cc: Will Deacon
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-c6x-dev@linux-c6x.org
    Cc: linux-m68k@lists.linux-m68k.org
    Cc: linux-riscv@lists.infradead.org
    Cc: linux-um@lists.infradead.org
    Cc: linux-xtensa@linux-xtensa.org
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: nios2-dev@lists.rocketboards.org
    Cc: openrisc@lists.librecores.org
    Cc: uclinux-h8-devel@lists.sourceforge.jp
    Link: https://lkml.kernel.org/r/20190322143008.21313-3-longman@redhat.com
    Signed-off-by: Ingo Molnar

    Waiman Long
     
  • As the generic rwsem-xadd code is using the appropriate acquire and
    release versions of the atomic operations, the arch specific rwsem.h
    files will not be that much faster than the generic code as long as the
    atomic functions are properly implemented. So we can remove those arch
    specific rwsem.h and stop building asm/rwsem.h to reduce maintenance
    effort.

    Currently, only x86, alpha and ia64 have implemented architecture
    specific fast paths. I don't have access to alpha and ia64 systems for
    testing, but they are legacy systems that are not likely to be updated
    to the latest kernel anyway.

    By using a rwsem microbenchmark, the total locking rates on a 4-socket
    56-core 112-thread x86-64 system before and after the patch were as
    follows (mixed means equal # of read and write locks):

    Before Patch After Patch
    # of Threads wlock rlock mixed wlock rlock mixed
    ------------ ----- ----- ----- ----- ----- -----
    1 29,201 30,143 29,458 28,615 30,172 29,201
    2 6,807 13,299 1,171 7,725 15,025 1,804
    4 6,504 12,755 1,520 7,127 14,286 1,345
    8 6,762 13,412 764 6,826 13,652 726
    16 6,693 15,408 662 6,599 15,938 626
    32 6,145 15,286 496 5,549 15,487 511
    64 5,812 15,495 60 5,858 15,572 60

    There were some run-to-run variations for the multi-thread tests. For
    x86-64, using the generic C code fast path seems to be a little bit
    faster than the assembly version with low lock contention. Looking at
    the assembly version of the fast paths, there are assembly to/from C
    code wrappers that save and restore all the callee-clobbered registers
    (7 registers on x86-64). The assembly generated from the generic C
    code doesn't need to do that. That may explain the slight performance
    gain here.

    The generic asm rwsem.h can also be merged into kernel/locking/rwsem.h
    with no code change as no other code other than those under
    kernel/locking needs to access the internal rwsem macros and functions.

    Signed-off-by: Waiman Long
    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Linus Torvalds
    Cc: Andrew Morton
    Cc: Arnd Bergmann
    Cc: Borislav Petkov
    Cc: Davidlohr Bueso
    Cc: H. Peter Anvin
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Tim Chen
    Cc: Will Deacon
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-c6x-dev@linux-c6x.org
    Cc: linux-m68k@lists.linux-m68k.org
    Cc: linux-riscv@lists.infradead.org
    Cc: linux-um@lists.infradead.org
    Cc: linux-xtensa@linux-xtensa.org
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: nios2-dev@lists.rocketboards.org
    Cc: openrisc@lists.librecores.org
    Cc: uclinux-h8-devel@lists.sourceforge.jp
    Link: https://lkml.kernel.org/r/20190322143008.21313-2-longman@redhat.com
    Signed-off-by: Ingo Molnar

    Waiman Long
     
  • For the architectures that do not implement their own tlb_flush() but
    do already use the generic mmu_gather, there are two options:

    1) the platform has an efficient flush_tlb_range() and
    asm-generic/tlb.h doesn't need any overrides at all.

    2) the platform lacks an efficient flush_tlb_range() and
    we select MMU_GATHER_NO_RANGE to minimize full invalidates.

    Convert all 'simple' architectures to one of these two forms.

    alpha: has no range invalidate -> 2
    arc: already used flush_tlb_range() -> 1
    c6x: has no range invalidate -> 2
    hexagon: has an efficient flush_tlb_range() -> 1
    (flush_tlb_mm() is in fact a full range invalidate,
    so no need to shoot down everything)
    m68k: has inefficient flush_tlb_range() -> 2
    microblaze: has no flush_tlb_range() -> 2
    mips: has efficient flush_tlb_range() -> 1
    (even though it currently seems to use flush_tlb_mm())
    nds32: already uses flush_tlb_range() -> 1
    nios2: has inefficient flush_tlb_range() -> 2
    (no limit on range iteration)
    openrisc: has inefficient flush_tlb_range() -> 2
    (no limit on range iteration)
    parisc: already uses flush_tlb_range() -> 1
    sparc32: already uses flush_tlb_range() -> 1
    unicore32: has inefficient flush_tlb_range() -> 2
    (no limit on range iteration)
    xtensa: has efficient flush_tlb_range() -> 1

    Note this also fixes a bug in the existing code for a number
    platforms. Those platforms that did:

    tlb_end_vma() -> if (!full_mm) flush_tlb_*()
    tlb_flush -> if (full_mm) flush_tlb_mm()

    missed the case of shift_arg_pages(), which doesn't have @fullmm set,
    nor calls into tlb_*vma(), but still frees page-tables and thus needs
    an invalidate. The new code handles this by detecting a non-empty
    range, and either issuing the matching range invalidate or a full
    invalidate, depending on the capabilities.

    No change in behavior intended.

    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Aneesh Kumar K.V
    Cc: Borislav Petkov
    Cc: Dave Hansen
    Cc: David S. Miller
    Cc: Greentime Hu
    Cc: Guan Xuetao
    Cc: H. Peter Anvin
    Cc: Helge Deller
    Cc: Jonas Bonn
    Cc: Ley Foon Tan
    Cc: Linus Torvalds
    Cc: Mark Salter
    Cc: Max Filippov
    Cc: Michal Simek
    Cc: Nick Piggin
    Cc: Paul Burton
    Cc: Peter Zijlstra
    Cc: Richard Henderson
    Cc: Richard Kuo
    Cc: Rik van Riel
    Cc: Thomas Gleixner
    Cc: Vineet Gupta
    Cc: Will Deacon
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

29 Mar, 2019

1 commit

  • I do not see any consistency about headers_install of
    and .

    According to my analysis of Linux 5.1-rc1, there are 3 groups:

    [1] Both and are exported

    alpha, arm, hexagon, mips, powerpc, s390, sparc, x86

    [2] is exported, but is not

    arc, arm64, c6x, h8300, ia64, m68k, microblaze, nios2, openrisc,
    parisc, sh, unicore32, xtensa

    [3] Neither nor is exported

    csky, nds32, riscv

    This does not match to the actual KVM support. At least, [2] is
    half-baked.

    Nor do arch maintainers look like they care about this. For example,
    commit 0add53713b1c ("microblaze: Add missing kvm_para.h to Kbuild")
    exported to user-space in order to fix an in-kernel
    build error.

    We have two ways to make this consistent:

    [A] export both and for all
    architectures, irrespective of the KVM support

    [B] Match the header export of and
    to the KVM support

    My first attempt was [A] because the code looks cleaner, but Paolo
    suggested [B].

    So, this commit goes with [B].

    For most architectures, was moved to the kernel-space.
    I changed include/uapi/linux/Kbuild so that it checks generated
    asm/kvm_para.h as well as check-in ones.

    After this commit, there will be two groups:

    [1] Both and are exported

    arm, arm64, mips, powerpc, s390, x86

    [2] Neither nor is exported

    alpha, arc, c6x, csky, h8300, hexagon, ia64, m68k, microblaze,
    nds32, nios2, openrisc, parisc, riscv, sh, sparc, unicore32, xtensa

    Signed-off-by: Masahiro Yamada
    Acked-by: Cornelia Huck
    Signed-off-by: Paolo Bonzini

    Masahiro Yamada
     

21 Mar, 2019

3 commits

  • This argument is required to extend the generic ptrace API with
    PTRACE_GET_SYSCALL_INFO request: syscall_get_arch() is going
    to be called from ptrace_request() along with syscall_get_nr(),
    syscall_get_arguments(), syscall_get_error(), and
    syscall_get_return_value() functions with a tracee as their argument.

    The primary intent is that the triple (audit_arch, syscall_nr, arg1..arg6)
    should describe what system call is being called and what its arguments
    are.

    Reverts: 5e937a9ae913 ("syscall_get_arch: remove useless function arguments")
    Reverts: 1002d94d3076 ("syscall.h: fix doc text for syscall_get_arch()")
    Reviewed-by: Andy Lutomirski # for x86
    Reviewed-by: Palmer Dabbelt
    Acked-by: Paul Moore
    Acked-by: Paul Burton # MIPS parts
    Acked-by: Michael Ellerman (powerpc)
    Acked-by: Kees Cook # seccomp parts
    Acked-by: Mark Salter # for the c6x bit
    Cc: Elvira Khabirova
    Cc: Eugene Syromyatnikov
    Cc: Oleg Nesterov
    Cc: x86@kernel.org
    Cc: linux-alpha@vger.kernel.org
    Cc: linux-snps-arc@lists.infradead.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-c6x-dev@linux-c6x.org
    Cc: uclinux-h8-devel@lists.sourceforge.jp
    Cc: linux-hexagon@vger.kernel.org
    Cc: linux-ia64@vger.kernel.org
    Cc: linux-m68k@lists.linux-m68k.org
    Cc: linux-mips@vger.kernel.org
    Cc: nios2-dev@lists.rocketboards.org
    Cc: openrisc@lists.librecores.org
    Cc: linux-parisc@vger.kernel.org
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: linux-riscv@lists.infradead.org
    Cc: linux-s390@vger.kernel.org
    Cc: linux-sh@vger.kernel.org
    Cc: sparclinux@vger.kernel.org
    Cc: linux-um@lists.infradead.org
    Cc: linux-xtensa@linux-xtensa.org
    Cc: linux-arch@vger.kernel.org
    Cc: linux-audit@redhat.com
    Signed-off-by: Dmitry V. Levin
    Signed-off-by: Paul Moore

    Dmitry V. Levin
     
  • syscall_get_arch() is required to be implemented on all architectures
    in addition to already implemented syscall_get_nr(),
    syscall_get_arguments(), syscall_get_error(), and
    syscall_get_return_value() functions in order to extend the generic
    ptrace API with PTRACE_GET_SYSCALL_INFO request.

    Acked-by: Paul Moore
    Cc: Elvira Khabirova
    Cc: Eugene Syromyatnikov
    Cc: Richard Kuo
    Cc: Oleg Nesterov
    Cc: Andy Lutomirski
    Cc: linux-hexagon@vger.kernel.org
    Cc: linux-audit@redhat.com
    Signed-off-by: Dmitry V. Levin
    Signed-off-by: Paul Moore

    Dmitry V. Levin
     
  • This should never have been defined in the arch tree to begin with,
    and now uapi/linux/audit.h header is going to use EM_HEXAGON
    in order to define AUDIT_ARCH_HEXAGON which is needed to implement
    syscall_get_arch() which in turn is required to extend
    the generic ptrace API with PTRACE_GET_SYSCALL_INFO request.

    Acked-by: Paul Moore
    Cc: Elvira Khabirova
    Cc: Eugene Syromyatnikov
    Cc: Oleg Nesterov
    Cc: Andy Lutomirski
    Cc: Richard Kuo
    Cc: linux-hexagon@vger.kernel.org
    Cc: linux-audit@redhat.com
    Signed-off-by: Dmitry V. Levin
    Signed-off-by: Paul Moore

    Dmitry V. Levin
     

17 Mar, 2019

1 commit

  • Currently, every arch/*/include/uapi/asm/Kbuild explicitly includes
    the common Kbuild.asm file. Factor out the duplicated include directives
    to scripts/Makefile.asm-generic so that no architecture would opt out
    of the mandatory-y mechanism.

    um is not forced to include mandatory-y since it is a very exceptional
    case which does not support UAPI.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

28 Feb, 2019

1 commit

  • …rnd/playground into timers/2038

    Pull additional syscall ABI cleanup for y2038 from Arnd Bergmann:

    This is a follow-up to the y2038 syscall patches already merged in the tip
    tree. As the final 32-bit RISC-V syscall ABI is still being decided on,
    this is the last chance to make a few corrections to leave out interfaces
    based on 32-bit time_t along with the old off_t and rlimit types.

    The series achieves this in a few steps:

    - A couple of bug fixes for minor regressions I introduced
    in the original series

    - A couple of older patches from Yury Norov that I had never
    merged in the past, these fix up the openat/open_by_handle_at and
    getrlimit/setrlimit syscalls to disallow the old versions of off_t
    and rlimit.

    - Hiding the deprecated system calls behind an #ifdef in
    include/uapi/asm-generic/unistd.h

    - Change arch/riscv to drop all these ABIs.

    Originally, the plan was to also leave these out on C-Sky, but that now
    has a glibc port that uses the older interfaces, so we need to leave
    them in place.

    Thomas Gleixner
     

20 Feb, 2019

1 commit

  • We don't want new architectures to even provide the old 32-bit time_t
    based system calls any more, or define the syscall number macros.

    Add a new __ARCH_WANT_TIME32_SYSCALLS macro that gets enabled for all
    existing 32-bit architectures using the generic system call table,
    so we don't change any current behavior.
    Since this symbol is evaluated in user space as well, we cannot use
    a Kconfig CONFIG_* macro but have to define it in uapi/asm/unistd.h.

    On 64-bit architectures, the same system call numbers mostly refer to
    the system calls we want to keep, as they already pass 64-bit time_t.

    As new architectures no longer provide these, we need new exceptions
    in checksyscalls.sh.

    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     

19 Feb, 2019

2 commits

  • The newer prlimit64 syscall provides all the functionality of getrlimit
    and setrlimit syscalls and adds the pid of target process, so future
    architectures won't need to include getrlimit and setrlimit.

    Therefore drop getrlimit and setrlimit syscalls from the generic syscall
    list unless __ARCH_WANT_SET_GET_RLIMIT is defined by the architecture's
    unistd.h prior to including asm-generic/unistd.h, and adjust all
    architectures using the generic syscall list to define it so that no
    in-tree architectures are affected.

    Cc: Arnd Bergmann
    Cc: linux-arch@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-hexagon@vger.kernel.org
    Cc: uclinux-h8-devel@lists.sourceforge.jp
    Signed-off-by: Yury Norov
    Acked-by: Arnd Bergmann
    Acked-by: Mark Salter [c6x]
    Acked-by: James Hogan [metag]
    Acked-by: Ley Foon Tan [nios2]
    Acked-by: Stafford Horne [openrisc]
    Acked-by: Will Deacon [arm64]
    Acked-by: Vineet Gupta #arch/arc bits
    Signed-off-by: Yury Norov
    Signed-off-by: Arnd Bergmann

    Yury Norov
     
  • All new 32-bit architectures should have 64-bit userspace off_t type, but
    existing architectures has 32-bit ones.

    To enforce the rule, new config option is added to arch/Kconfig that defaults
    ARCH_32BIT_OFF_T to be disabled for new 32-bit architectures. All existing
    32-bit architectures enable it explicitly.

    New option affects force_o_largefile() behaviour. Namely, if userspace
    off_t is 64-bits long, we have no reason to reject user to open big files.

    Note that even if architectures has only 64-bit off_t in the kernel
    (arc, c6x, h8300, hexagon, nios2, openrisc, and unicore32),
    a libc may use 32-bit off_t, and therefore want to limit the file size
    to 4GB unless specified differently in the open flags.

    Signed-off-by: Yury Norov
    Acked-by: Arnd Bergmann
    Signed-off-by: Yury Norov
    Signed-off-by: Arnd Bergmann

    Yury Norov
     

02 Feb, 2019

1 commit

  • Most architectures do not export shmparam.h to user-space.

    $ find arch -name shmparam.h | sort
    arch/alpha/include/asm/shmparam.h
    arch/arc/include/asm/shmparam.h
    arch/arm64/include/asm/shmparam.h
    arch/arm/include/asm/shmparam.h
    arch/csky/include/asm/shmparam.h
    arch/ia64/include/asm/shmparam.h
    arch/mips/include/asm/shmparam.h
    arch/nds32/include/asm/shmparam.h
    arch/nios2/include/asm/shmparam.h
    arch/parisc/include/asm/shmparam.h
    arch/powerpc/include/asm/shmparam.h
    arch/s390/include/asm/shmparam.h
    arch/sh/include/asm/shmparam.h
    arch/sparc/include/asm/shmparam.h
    arch/x86/include/asm/shmparam.h
    arch/xtensa/include/asm/shmparam.h

    Strangely, some users of the asm-generic wrapper export shmparam.h

    $ git grep 'generic-y += shmparam.h'
    arch/c6x/include/uapi/asm/Kbuild:generic-y += shmparam.h
    arch/h8300/include/uapi/asm/Kbuild:generic-y += shmparam.h
    arch/hexagon/include/uapi/asm/Kbuild:generic-y += shmparam.h
    arch/m68k/include/uapi/asm/Kbuild:generic-y += shmparam.h
    arch/microblaze/include/uapi/asm/Kbuild:generic-y += shmparam.h
    arch/openrisc/include/uapi/asm/Kbuild:generic-y += shmparam.h
    arch/riscv/include/asm/Kbuild:generic-y += shmparam.h
    arch/unicore32/include/uapi/asm/Kbuild:generic-y += shmparam.h

    The newly added riscv correctly creates the asm-generic wrapper
    in the kernel space, but the others (c6x, h8300, hexagon, m68k,
    microblaze, openrisc, unicore32) create the one in the uapi directory.

    Digging into the git history, now I guess fcc8487d477a ("uapi:
    export all headers under uapi directories") was the misconversion.
    Prior to that commit, no architecture exported to shmparam.h
    As its commit description said, that commit exported shmparam.h
    for c6x, h8300, hexagon, m68k, openrisc, unicore32.

    83f0124ad81e ("microblaze: remove asm-generic wrapper headers")
    accidentally exported shmparam.h for microblaze.

    This commit unexports shmparam.h for those architectures.

    There is no more reason to export include/uapi/asm-generic/shmparam.h,
    so it has been moved to include/asm-generic/shmparam.h

    Link: http://lkml.kernel.org/r/1546904307-11124-1-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Acked-by: Stafford Horne
    Cc: Geert Uytterhoeven
    Cc: Michal Simek
    Cc: Yoshinori Sato
    Cc: Richard Kuo
    Cc: Guan Xuetao
    Cc: Nicolas Dichtel
    Cc: Arnd Bergmann
    Cc: Aurelien Jacquiot
    Cc: Greentime Hu
    Cc: Guo Ren
    Cc: Palmer Dabbelt
    Cc: Stefan Kristiansson
    Cc: Mark Salter
    Cc: Albert Ou
    Cc: Jonas Bonn
    Cc: Vincent Chen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada