24 Aug, 2018

1 commit

  • Pull OpenRISC update from Stafford Horne:
    "Just one change for 4.19: refactoring from Christoph Hellwig to use
    generic DMA facilities"

    * tag 'for-linus' of git://github.com/openrisc/linux:
    openrisc: use generic dma_noncoherent_ops
    openrisc: fix cache maintainance the the sync_single_for_device DMA operation
    openrisc: remove the no-op unmap_page and unmap_sg DMA operations
    openrisc: remove the sync_single_for_cpu DMA operation

    Linus Torvalds
     

18 Aug, 2018

1 commit

  • 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 1c8f422059ae ("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: Souptick Joarder
    Cc: Matthew Wilcox
    Cc: Richard Henderson
    Cc: Tony Luck
    Cc: Matt Turner
    Cc: Vineet Gupta
    Cc: Russell King
    Cc: Catalin Marinas
    Cc: Will Deacon
    Cc: Richard Kuo
    Cc: Geert Uytterhoeven
    Cc: Michal Simek
    Cc: James Hogan
    Cc: Ley Foon Tan
    Cc: Jonas Bonn
    Cc: James E.J. Bottomley
    Cc: Benjamin Herrenschmidt
    Cc: Palmer Dabbelt
    Cc: Yoshinori Sato
    Cc: David S. Miller
    Cc: Richard Weinberger
    Cc: Guan Xuetao
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Cc: "Levin, Alexander (Sasha Levin)"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Souptick Joarder
     

16 Aug, 2018

2 commits

  • Pull Kconfig consolidation from Masahiro Yamada:
    "Consolidation of Kconfig files by Christoph Hellwig.

    Move the source statements of arch-independent Kconfig files instead
    of duplicating the includes in every arch/$(SRCARCH)/Kconfig"

    * tag 'kconfig-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
    kconfig: add a Memory Management options" menu
    kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt
    kconfig: use a menu in arch/Kconfig to reduce clutter
    kconfig: include kernel/Kconfig.preempt from init/Kconfig
    Kconfig: consolidate the "Kernel hacking" menu
    kconfig: include common Kconfig files from top-level Kconfig
    kconfig: remove duplicate SWAP symbol defintions
    um: create a proper drivers Kconfig
    um: cleanup Kconfig files
    um: stop abusing KBUILD_KCONFIG

    Linus Torvalds
     
  • Pull Kbuild updates from Masahiro Yamada:

    - verify depmod is installed before modules_install

    - support build salt in case build ids must be unique between builds

    - allow users to specify additional host compiler flags via HOST*FLAGS,
    and rename internal variables to KBUILD_HOST*FLAGS

    - update buildtar script to drop vax support, add arm64 support

    - update builddeb script for better debarch support

    - document the pit-fall of if_changed usage

    - fix parallel build of UML with O= option

    - make 'samples' target depend on headers_install to fix build errors

    - remove deprecated host-progs variable

    - add a new coccinelle script for refcount_t vs atomic_t check

    - improve double-test coccinelle script

    - misc cleanups and fixes

    * tag 'kbuild-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (41 commits)
    coccicheck: return proper error code on fail
    Coccinelle: doubletest: reduce side effect false positives
    kbuild: remove deprecated host-progs variable
    kbuild: make samples really depend on headers_install
    um: clean up archheaders recipe
    kbuild: add %asm-generic to no-dot-config-targets
    um: fix parallel building with O= option
    scripts: Add Python 3 support to tracing/draw_functrace.py
    builddeb: Add automatic support for sh{3,4}{,eb} architectures
    builddeb: Add automatic support for riscv* architectures
    builddeb: Add automatic support for m68k architecture
    builddeb: Add automatic support for or1k architecture
    builddeb: Add automatic support for sparc64 architecture
    builddeb: Add automatic support for mips{,64}r6{,el} architectures
    builddeb: Add automatic support for mips64el architecture
    builddeb: Add automatic support for ppc64 and powerpcspe architectures
    builddeb: Introduce functions to simplify kconfig tests in set_debarch
    builddeb: Drop check for 32-bit s390
    builddeb: Change architecture detection fallback to use dpkg-architecture
    builddeb: Skip architecture detection when KBUILD_DEBARCH is set
    ...

    Linus Torvalds
     

14 Aug, 2018

1 commit

  • Pull locking/atomics update from Thomas Gleixner:
    "The locking, atomics and memory model brains delivered:

    - A larger update to the atomics code which reworks the ordering
    barriers, consolidates the atomic primitives, provides the new
    atomic64_fetch_add_unless() primitive and cleans up the include
    hell.

    - Simplify cmpxchg() instrumentation and add instrumentation for
    xchg() and cmpxchg_double().

    - Updates to the memory model and documentation"

    * 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (48 commits)
    locking/atomics: Rework ordering barriers
    locking/atomics: Instrument cmpxchg_double*()
    locking/atomics: Instrument xchg()
    locking/atomics: Simplify cmpxchg() instrumentation
    locking/atomics/x86: Reduce arch_cmpxchg64*() instrumentation
    tools/memory-model: Rename litmus tests to comply to norm7
    tools/memory-model/Documentation: Fix typo, smb->smp
    sched/Documentation: Update wake_up() & co. memory-barrier guarantees
    locking/spinlock, sched/core: Clarify requirements for smp_mb__after_spinlock()
    sched/core: Use smp_mb() in wake_woken_function()
    tools/memory-model: Add informal LKMM documentation to MAINTAINERS
    locking/atomics/Documentation: Describe atomic_set() as a write operation
    tools/memory-model: Make scripts executable
    tools/memory-model: Remove ACCESS_ONCE() from model
    tools/memory-model: Remove ACCESS_ONCE() from recipes
    locking/memory-barriers.txt/kokr: Update Korean translation to fix broken DMA vs. MMIO ordering example
    MAINTAINERS: Add Daniel Lustig as an LKMM reviewer
    tools/memory-model: Fix ISA2+pooncelock+pooncelock+pombonce name
    tools/memory-model: Add litmus test for full multicopy atomicity
    locking/refcount: Always allow checked forms
    ...

    Linus Torvalds
     

06 Aug, 2018

1 commit


03 Aug, 2018

1 commit

  • It appears that openrisc copied arm64's GENERIC_IRQ_MULTI_HANDLER code
    (which came from arm). Cnvert it to use the generic version.

    Signed-off-by: Palmer Dabbelt
    Signed-off-by: Thomas Gleixner
    Acked-by: Stafford Horne
    Cc: linux@armlinux.org.uk
    Cc: catalin.marinas@arm.com
    Cc: Will Deacon
    Cc: jonas@southpole.se
    Cc: stefan.kristiansson@saunalahti.fi
    Cc: jason@lakedaemon.net
    Cc: marc.zyngier@arm.com
    Cc: Arnd Bergmann
    Cc: nicolas.pitre@linaro.org
    Cc: vladimir.murzin@arm.com
    Cc: keescook@chromium.org
    Cc: jinb.park7@gmail.com
    Cc: yamada.masahiro@socionext.com
    Cc: alexandre.belloni@bootlin.com
    Cc: pombredanne@nexb.com
    Cc: Greg KH
    Cc: kstewart@linuxfoundation.org
    Cc: jhogan@kernel.org
    Cc: mark.rutland@arm.com
    Cc: ard.biesheuvel@linaro.org
    Cc: james.morse@arm.com
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: openrisc@lists.librecores.org
    Link: https://lkml.kernel.org/r/20180622170126.6308-5-palmer@sifive.com

    Palmer Dabbelt
     

02 Aug, 2018

3 commits

  • Almost all architectures include it. Add a ARCH_NO_PREEMPT symbol to
    disable preempt support for alpha, hexagon, non-coldfire m68k and
    user mode Linux.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Masahiro Yamada

    Christoph Hellwig
     
  • Move the source of lib/Kconfig.debug and arch/$(ARCH)/Kconfig.debug to
    the top-level Kconfig. For two architectures that means moving their
    arch-specific symbols in that menu into a new arch Kconfig.debug file,
    and for a few more creating a dummy file so that we can include it
    unconditionally.

    Also move the actual 'Kernel hacking' menu to lib/Kconfig.debug, where
    it belongs.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Masahiro Yamada

    Christoph Hellwig
     
  • Instead of duplicating the source statements in every architecture just
    do it once in the toplevel Kconfig file.

    Note that with this the inclusion of arch/$(SRCARCH/Kconfig moves out of
    the top-level Kconfig into arch/Kconfig so that don't violate ordering
    constraits while keeping a sensible menu structure.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Masahiro Yamada

    Christoph Hellwig
     

21 Jul, 2018

4 commits


19 Jul, 2018

1 commit


17 Jul, 2018

1 commit


01 Jul, 2018

1 commit

  • Originally in patch e6d20c55a4 ("openrisc: entry: Fix delay slot
    detection") I fixed delay slot detection, but only for QEMU. We missed
    that hardware delay slot detection using delay slot exception flag (DSX)
    was still broken. This was because QEMU set the DSX flag in both
    pre-exception supervision register (ESR) and supervision register (SR)
    register, but on real hardware the DSX flag is only set on the SR
    register during exceptions.

    Fix this by carrying the DSX flag into the SR register during exception.
    We also update the DSX flag read locations to read the value from the SR
    register not the pt_regs SR register which represents ESR. The ESR
    should never have the DSX flag set.

    In the process I updated/removed a few comments to match the current
    state. Including removing a comment saying that the DSX detection logic
    was inefficient and needed to be rewritten.

    I have tested this on QEMU with a patch ensuring it matches the hardware
    specification.

    Link: https://lists.gnu.org/archive/html/qemu-devel/2018-07/msg00000.html
    Fixes: e6d20c55a4 ("openrisc: entry: Fix delay slot detection")
    Signed-off-by: Stafford Horne

    Stafford Horne
     

25 Jun, 2018

1 commit

  • This fixes an issue uncovered when a recent change to add the "page
    table" flag was merged. During bootup we see many errors like the
    following:

    BUG: Bad page state in process mkdir pfn:00bae
    page:c1ff15c0 count:0 mapcount:-1024 mapping:00000000 index:0x0
    flags: 0x0()
    raw: 00000000 00000000 00000000 fffffbff 00000000 00000100 00000200 00000000
    page dumped because: nonzero mapcount
    Modules linked in:
    CPU: 0 PID: 46 Comm: mkdir Tainted: G B 4.17.0-simple-smp-07461-g1d40a5ea01d5-dirty #993
    Call trace:
    [] show_stack+0x44/0x54
    [] dump_stack+0xb0/0xe8
    [] bad_page+0x138/0x174
    [] ? cpumask_next+0x24/0x34
    [] free_pages_check_bad+0x6c/0xd0
    [] free_pcppages_bulk+0x174/0x42c
    [] free_unref_page_commit.isra.17+0xb8/0xc8
    [] free_unref_page_list+0x10c/0x190
    [] ? set_reset_devices+0x0/0x2c
    [] release_pages+0x3a0/0x414
    [] tlb_flush_mmu_free+0x5c/0x90
    [] tlb_flush_mmu+0x90/0xa4
    [] arch_tlb_finish_mmu+0x50/0x94
    [] tlb_finish_mmu+0x30/0x64
    [] exit_mmap+0x110/0x1e0
    [] mmput+0x50/0xf0
    [] do_exit+0x274/0xa94
    [] do_group_exit+0x50/0x110
    [] __wake_up_parent+0x0/0x38
    [] _syscall_return+0x0/0x4

    During the __pte_free_tlb path openrisc fails to call the page
    destructor which would clear the new bits that were introduced.
    To fix this we are calling the destructor.

    It seem openrisc was the only architecture missing this, all other
    architectures either call the destructor like we are doing here or use
    pte_free.

    Note: failing to call the destructor was also messing up the zone stats
    (and will be cause other problems if you were using SPLIT_PTE_PTLOCKS,
    which we are not yet).

    Fixes: 1d40a5ea01d53 ("mm: mark pages in use for page tables")
    Acked-by: Matthew Wilcox
    Signed-off-by: Stafford Horne

    Stafford Horne
     

21 Jun, 2018

2 commits

  • While __atomic_add_unless() was originally intended as a building-block
    for atomic_add_unless(), it's now used in a number of places around the
    kernel. It's the only common atomic operation named __atomic*(), rather
    than atomic_*(), and for consistency it would be better named
    atomic_fetch_add_unless().

    This lack of consistency is slightly confusing, and gets in the way of
    scripting atomics. Given that, let's clean things up and promote it to
    an official part of the atomics API, in the form of
    atomic_fetch_add_unless().

    This patch converts definitions and invocations over to the new name,
    including the instrumented version, using the following script:

    ----
    git grep -w __atomic_add_unless | while read line; do
    sed -i '{s/\/atomic_fetch_add_unless/}' "${line%%:*}";
    done
    git grep -w __arch_atomic_add_unless | while read line; do
    sed -i '{s/\/arch_atomic_fetch_add_unless/}' "${line%%:*}";
    done
    ----

    Note that we do not have atomic{64,_long}_fetch_add_unless(), which will
    be introduced by later patches.

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

    Signed-off-by: Mark Rutland
    Reviewed-by: Will Deacon
    Acked-by: Geert Uytterhoeven
    Acked-by: Peter Zijlstra (Intel)
    Acked-by: Palmer Dabbelt
    Cc: Boqun Feng
    Cc: Linus Torvalds
    Cc: Thomas Gleixner
    Link: https://lore.kernel.org/lkml/20180621121321.4761-2-mark.rutland@arm.com
    Signed-off-by: Ingo Molnar

    Mark Rutland
     
  • The openrisc implementation of pulls in ,
    so that it can refer to BITS_PER_BYTE. It also transitively relies on
    this pulling in for READ_ONCE().

    Replace the #include with and .

    Signed-off-by: Will Deacon
    Acked-by: Peter Zijlstra (Intel)
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: yamada.masahiro@socionext.com
    Link: https://lore.kernel.org/lkml/1529412794-17720-5-git-send-email-will.deacon@arm.com
    Signed-off-by: Ingo Molnar

    Will Deacon
     

07 Jun, 2018

1 commit

  • Pull Kbuild updates from Masahiro Yamada:

    - improve fixdep to coalesce consecutive slashes in dep-files

    - fix some issues of the maintainer string generation in deb-pkg script

    - remove unused CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX and clean-up
    several tools and linker scripts

    - clean-up modpost

    - allow to enable the dead code/data elimination for PowerPC in EXPERT
    mode

    - improve two coccinelle scripts for better performance

    - pass endianness and machine size flags to sparse for all architecture

    - misc fixes

    * tag 'kbuild-v4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (25 commits)
    kbuild: add machine size to CHECKFLAGS
    kbuild: add endianness flag to CHEKCFLAGS
    kbuild: $(CHECK) doesnt need NOSTDINC_FLAGS twice
    scripts: Fixed printf format mismatch
    scripts/tags.sh: use `find` for $ALLSOURCE_ARCHS generation
    coccinelle: deref_null: improve performance
    coccinelle: mini_lock: improve performance
    powerpc: Allow LD_DEAD_CODE_DATA_ELIMINATION to be selected
    kbuild: Allow LD_DEAD_CODE_DATA_ELIMINATION to be selectable if enabled
    kbuild: LD_DEAD_CODE_DATA_ELIMINATION no -ffunction-sections/-fdata-sections for module build
    kbuild: Fix asm-generic/vmlinux.lds.h for LD_DEAD_CODE_DATA_ELIMINATION
    modpost: constify *modname function argument where possible
    modpost: remove redundant is_vmlinux() test
    modpost: use strstarts() helper more widely
    modpost: pass struct elf_info pointer to get_modinfo()
    checkpatch: remove VMLINUX_SYMBOL() check
    vmlinux.lds.h: remove no-op macro VMLINUX_SYMBOL()
    kbuild: remove CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX
    export.h: remove code for prefixing symbols with underscore
    depmod.sh: remove symbol prefix support
    ...

    Linus Torvalds
     

05 Jun, 2018

2 commits

  • Pull timers and timekeeping updates from Thomas Gleixner:

    - Core infrastucture work for Y2038 to address the COMPAT interfaces:

    + Add a new Y2038 safe __kernel_timespec and use it in the core
    code

    + Introduce config switches which allow to control the various
    compat mechanisms

    + Use the new config switch in the posix timer code to control the
    32bit compat syscall implementation.

    - Prevent bogus selection of CPU local clocksources which causes an
    endless reselection loop

    - Remove the extra kthread in the clocksource code which has no value
    and just adds another level of indirection

    - The usual bunch of trivial updates, cleanups and fixlets all over the
    place

    - More SPDX conversions

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (24 commits)
    clocksource/drivers/mxs_timer: Switch to SPDX identifier
    clocksource/drivers/timer-imx-tpm: Switch to SPDX identifier
    clocksource/drivers/timer-imx-gpt: Switch to SPDX identifier
    clocksource/drivers/timer-imx-gpt: Remove outdated file path
    clocksource/drivers/arc_timer: Add comments about locking while read GFRC
    clocksource/drivers/mips-gic-timer: Add pr_fmt and reword pr_* messages
    clocksource/drivers/sprd: Fix Kconfig dependency
    clocksource: Move inline keyword to the beginning of function declarations
    timer_list: Remove unused function pointer typedef
    timers: Adjust a kernel-doc comment
    tick: Prefer a lower rating device only if it's CPU local device
    clocksource: Remove kthread
    time: Change nanosleep to safe __kernel_* types
    time: Change types to new y2038 safe __kernel_* types
    time: Fix get_timespec64() for y2038 safe compat interfaces
    time: Add new y2038 safe __kernel_timespec
    posix-timers: Make compat syscalls depend on CONFIG_COMPAT_32BIT_TIME
    time: Introduce CONFIG_COMPAT_32BIT_TIME
    time: Introduce CONFIG_64BIT_TIME in architectures
    compat: Enable compat_get/put_timespec64 always
    ...

    Linus Torvalds
     
  • …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
     

29 May, 2018

1 commit

  • The kernel depends on macros like __BYTE_ORDER__,
    __BIG_ENDIAN__ or __LITTLE_ENDIAN__.

    OTOH, sparse doesn't know about the endianness of the kernel and
    by default uses the same as the machine on which sparse was built.

    Ensure that sparse can predefine the macros corresponding to
    how the kernel was configured by adding -m{big,little}-endian
    to CHECKFLAGS in the main Makefile (and so for all archs).
    Also, remove the equivalent done in arch specific Makefiles.

    Signed-off-by: Luc Van Oostenryck
    Signed-off-by: Masahiro Yamada

    Luc Van Oostenryck
     

08 May, 2018

1 commit

  • Most mainstream architectures are using 65536 entries, so lets stick to
    that. If someone is really desperate to override it that can still be
    done through , but I'd rather see a really good
    rationale for that.

    dma_debug_init is now called as a core_initcall, which for many
    architectures means much earlier, and provides dma-debug functionality
    earlier in the boot process. This should be safe as it only relies
    on the memory allocator already being available.

    Signed-off-by: Christoph Hellwig
    Acked-by: Marek Szyprowski
    Reviewed-by: Robin Murphy

    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: Jonas Bonn
    Cc: Stefan Kristiansson
    Cc: Stafford Horne
    Cc: openrisc@lists.librecores.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
     

19 Apr, 2018

1 commit

  • We have a couple of files that try to include asm/compat.h on
    architectures where this is available. Those should generally use the
    higher-level linux/compat.h file, but that in turn fails to include
    asm/compat.h when CONFIG_COMPAT is disabled, unless we can provide
    that header on all architectures.

    This adds the asm/compat.h for all remaining architectures to
    simplify the dependencies.

    Architectures that are getting removed in linux-4.17 are not changed
    here, to avoid needless conflicts with the removal patches. Those
    architectures are broken by this patch, but we have already shown
    that they have no users.

    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     

16 Apr, 2018

1 commit

  • Pull OpenRISC fixlet from Stafford Horne:
    "Just one small thing here, it came in a while back but I didnt have
    anything in my 4.16 queue, still its the only thing for 4.17 so
    sending it alone.

    Small cleanup: remove unused __ARCH_HAVE_MMU define"

    * tag 'for-linus' of git://github.com/openrisc/linux:
    openrisc: remove unused __ARCH_HAVE_MMU define

    Linus Torvalds
     

08 Apr, 2018

1 commit


05 Apr, 2018

1 commit

  • Pull irq updates from Thomas Gleixner:
    "The usual pile of boring changes:

    - Consolidate tasklet functions to share code instead of duplicating
    it

    - The first step for making the low level entry handler management on
    multi-platform kernels generic

    - A new sysfs file which allows to retrieve the wakeup state of
    interrupts.

    - Ensure that the interrupt thread follows the effective affinity and
    not the programmed affinity to avoid cross core wakeups.

    - Two new interrupt controller drivers (Microsemi Ocelot and Qualcomm
    PDC)

    - Fix the wakeup path clock handling for Reneasas interrupt chips.

    - Rework the boot time register reset for ARM GIC-V2/3

    - Better suspend/resume support for ARM GIV-V3/ITS

    - Add missing locking to the ARM GIC set_type() callback

    - Small fixes for the irq simulator code

    - SPDX identifiers for the irq core code and removal of boiler plate

    - Small cleanups all over the place"

    * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (37 commits)
    openrisc: Set CONFIG_MULTI_IRQ_HANDLER
    arm64: Set CONFIG_MULTI_IRQ_HANDLER
    genirq: Make GENERIC_IRQ_MULTI_HANDLER depend on !MULTI_IRQ_HANDLER
    irqchip/gic: Take lock when updating irq type
    irqchip/gic: Update supports_deactivate static key to modern api
    irqchip/gic-v3: Ensure GICR_CTLR.EnableLPI=0 is observed before enabling
    irqchip: Add a driver for the Microsemi Ocelot controller
    dt-bindings: interrupt-controller: Add binding for the Microsemi Ocelot interrupt controller
    irqchip/gic-v3: Probe for SCR_EL3 being clear before resetting AP0Rn
    irqchip/gic-v3: Don't try to reset AP0Rn
    irqchip/gic-v3: Do not check trigger configuration of partitionned LPIs
    genirq: Remove license boilerplate/references
    genirq: Add missing SPDX identifiers
    genirq/matrix: Cleanup SPDX identifier
    genirq: Cleanup top of file comments
    genirq: Pass desc to __irq_free instead of irq number
    irqchip/gic-v3: Loudly complain about the use of IRQ_TYPE_NONE
    irqchip/gic: Loudly complain about the use of IRQ_TYPE_NONE
    RISC-V: Move to the new GENERIC_IRQ_MULTI_HANDLER handler
    genirq: Add CONFIG_GENERIC_IRQ_MULTI_HANDLER
    ...

    Linus Torvalds
     

04 Apr, 2018

1 commit

  • arm has an optional MULTI_IRQ_HANDLER, which openrisc copied but didn't
    make optional. The multi irq handler infrastructure has been copied to
    generic code selectable with a new config symbol. That symbol can be
    selected by randconfig builds and can cause build breakage.

    Introduce CONFIG_MULTI_IRQ_HANDLER as an intermediate step which prevents
    the core config symbol from being selected. The openrisc local config
    symbol will be removed once openrisc gets converted to the generic code.

    Signed-off-by: Palmer Dabbelt
    Signed-off-by: Thomas Gleixner
    Cc: Linus Torvalds
    Cc: Arnd Bergmann
    Link: https://lkml.kernel.org/r/20180404043130.31277-3-palmer@sifive.com

    Palmer Dabbelt
     

22 Feb, 2018

1 commit

  • …nc ioremap prototype with it.

    A future commit for the nds32 architecture bootstrap("asm-generic/io.h: move
    ioremap_nocache/ioremap_uc/ioremap_wc/ioremap_wt out of ifndef CONFIG_MMU")
    will move the ioremap_nocache out of the CONFIG_MMU ifdef. This means that
    in order to suppress re-definition errors we need to setup #define's before
    importing asm-generic/io.h.

    Also, the change adds a prototype for ioremap where size is size_t so fix that
    as well.

    Signed-off-by: Greentime Hu <greentime@andestech.com>
    Acked-by: Stafford Horne <shorne@gmail.com>

    Greentime Hu
     

02 Feb, 2018

2 commits

  • Pull clk updates from Stephen Boyd:
    "The core framework has a handful of patches this time around, mostly
    due to the clk rate protection support added by Jerome Brunet.

    This feature will allow consumers to lock in a certain rate on the
    output of a clk so that things like audio playback don't hear pops
    when the clk frequency changes due to shared parent clks changing
    rates. Currently the clk API doesn't guarantee the rate of a clk stays
    at the rate you request after clk_set_rate() is called, so this new
    API will allow drivers to express that requirement.

    Beyond this, the core got some debugfs pretty printing patches and a
    couple minor non-critical fixes.

    Looking outside of the core framework diff we have some new driver
    additions and the removal of a legacy TI clk driver. Both of these hit
    high in the dirstat. Also, the removal of the asm-generic/clkdev.h
    file causes small one-liners in all the architecture Kbuild files.

    Overall, the driver diff seems to be the normal stuff that comes all
    the time to fix little problems here and there and to support new
    hardware.

    Summary:

    Core:
    - Clk rate protection
    - Symbolic clk flags in debugfs output
    - Clk registration enabled clks while doing bookkeeping updates

    New Drivers:
    - Spreadtrum SC9860
    - HiSilicon hi3660 stub
    - Qualcomm A53 PLL, SPMI clkdiv, and MSM8916 APCS
    - Amlogic Meson-AXG
    - ASPEED BMC

    Removed Drivers:
    - TI OMAP 3xxx legacy clk (non-DT) support
    - asm*/clkdev.h got removed (not really a driver)

    Updates:
    - Renesas FDP1-0 module clock on R-Car M3-W
    - Renesas LVDS module clock on R-Car V3M
    - Misc fixes to pr_err() prints
    - Qualcomm MSM8916 audio fixes
    - Qualcomm IPQ8074 rounded out support for more peripherals
    - Qualcomm Alpha PLL variants
    - Divider code was using container_of() on bad pointers
    - Allwinner DE2 clks on H3
    - Amlogic minor data fixes and dropping of CLK_IGNORE_UNUSED
    - Mediatek clk driver compile test support
    - AT91 PMC clk suspend/resume restoration support
    - PLL issues fixed on si5351
    - Broadcom IProc PLL calculation updates
    - DVFS support for Armada mvebu CPU clks
    - Allwinner fixed post-divider support
    - TI clkctrl fixes and support for newer SoCs"

    * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (125 commits)
    clk: aspeed: Handle inverse polarity of USB port 1 clock gate
    clk: aspeed: Fix return value check in aspeed_cc_init()
    clk: aspeed: Add reset controller
    clk: aspeed: Register gated clocks
    clk: aspeed: Add platform driver and register PLLs
    clk: aspeed: Register core clocks
    clk: Add clock driver for ASPEED BMC SoCs
    clk: mediatek: adjust dependency of reset.c to avoid unexpectedly being built
    clk: fix reentrancy of clk_enable() on UP systems
    clk: meson-axg: fix potential NULL dereference in axg_clkc_probe()
    clk: Simplify debugfs registration
    clk: Fix debugfs_create_*() usage
    clk: Show symbolic clock flags in debugfs
    clk: renesas: r8a7796: Add FDP clock
    clk: Move __clk_{get,put}() into private clk.h API
    clk: sunxi: Use CLK_IS_CRITICAL flag for critical clks
    clk: Improve flags doc for of_clk_detect_critical()
    arch: Remove clkdev.h asm-generic from Kbuild
    clk: sunxi-ng: a83t: Add M divider to TCON1 clock
    clk: Prepare to remove asm-generic/clkdev.h
    ...

    Linus Torvalds
     
  • Pull printk updates from Petr Mladek:

    - Add a console_msg_format command line option:

    The value "default" keeps the old "[time stamp] text\n" format. The
    value "syslog" allows to see the syslog-like "[timestamp] text" format.

    This feature was requested by people doing regression tests, for
    example, 0day robot. They want to have both filtered and full logs
    at hands.

    - Reduce the risk of softlockup:

    Pass the console owner in a busy loop.

    This is a new approach to the old problem. It was first proposed by
    Steven Rostedt on Kernel Summit 2017. It marks a context in which
    the console_lock owner calls console drivers and could not sleep.
    On the other side, printk() callers could detect this state and use
    a busy wait instead of a simple console_trylock(). Finally, the
    console_lock owner checks if there is a busy waiter at the end of
    the special context and eventually passes the console_lock to the
    waiter.

    The hand-off works surprisingly well and helps in many situations.
    Well, there is still a possibility of the softlockup, for example,
    when the flood of messages stops and the last owner still has too
    much to flush.

    There is increasing number of people having problems with
    printk-related softlockups. We might eventually need to get better
    solution. Anyway, this looks like a good start and promising
    direction.

    - Do not allow to schedule in console_unlock() called from printk():

    This reverts an older controversial commit. The reschedule helped
    to avoid softlockups. But it also slowed down the console output.
    This patch is obsoleted by the new console waiter logic described
    above. In fact, the reschedule made the hand-off less effective.

    - Deprecate "%pf" and "%pF" format specifier:

    It was needed on ia64, ppc64 and parisc64 to dereference function
    descriptors and show the real function address. It is done
    transparently by "%ps" and "pS" format specifier now.

    Sergey Senozhatsky found that all the function descriptors were in
    a special elf section and could be easily detected.

    - Remove printk_symbol() API:

    It has been obsoleted by "%pS" format specifier, and this change
    helped to remove few continuous lines and a less intuitive old API.

    - Remove redundant memsets:

    Sergey removed unnecessary memset when processing printk.devkmsg
    command line option.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk: (27 commits)
    printk: drop redundant devkmsg_log_str memsets
    printk: Never set console_may_schedule in console_trylock()
    printk: Hide console waiter logic into helpers
    printk: Add console owner and waiter logic to load balance console writes
    kallsyms: remove print_symbol() function
    checkpatch: add pF/pf deprecation warning
    symbol lookup: introduce dereference_symbol_descriptor()
    parisc64: Add .opd based function descriptor dereference
    powerpc64: Add .opd based function descriptor dereference
    ia64: Add .opd based function descriptor dereference
    sections: split dereference_function_descriptor()
    openrisc: Fix conflicting types for _exext and _stext
    lib: do not use print_symbol()
    irq debug: do not use print_symbol()
    sysfs: do not use print_symbol()
    drivers: do not use print_symbol()
    x86: do not use print_symbol()
    unicore32: do not use print_symbol()
    sh: do not use print_symbol()
    mn10300: do not use print_symbol()
    ...

    Linus Torvalds
     

31 Jan, 2018

1 commit

  • …iederm/user-namespace

    Pull siginfo cleanups from Eric Biederman:
    "Long ago when 2.4 was just a testing release copy_siginfo_to_user was
    made to copy individual fields to userspace, possibly for efficiency
    and to ensure initialized values were not copied to userspace.

    Unfortunately the design was complex, it's assumptions unstated, and
    humans are fallible and so while it worked much of the time that
    design failed to ensure unitialized memory is not copied to userspace.

    This set of changes is part of a new design to clean up siginfo and
    simplify things, and hopefully make the siginfo handling robust enough
    that a simple inspection of the code can be made to ensure we don't
    copy any unitializied fields to userspace.

    The design is to unify struct siginfo and struct compat_siginfo into a
    single definition that is shared between all architectures so that
    anyone adding to the set of information shared with struct siginfo can
    see the whole picture. Hopefully ensuring all future si_code
    assignments are arch independent.

    The design is to unify copy_siginfo_to_user32 and
    copy_siginfo_from_user32 so that those function are complete and cope
    with all of the different cases documented in signinfo_layout. I don't
    think there was a single implementation of either of those functions
    that was complete and correct before my changes unified them.

    The design is to introduce a series of helpers including
    force_siginfo_fault that take the values that are needed in struct
    siginfo and build the siginfo structure for their callers. Ensuring
    struct siginfo is built correctly.

    The remaining work for 4.17 (unless someone thinks it is post -rc1
    material) is to push usage of those helpers down into the
    architectures so that architecture specific code will not need to deal
    with the fiddly work of intializing struct siginfo, and then when
    struct siginfo is guaranteed to be fully initialized change copy
    siginfo_to_user into a simple wrapper around copy_to_user.

    Further there is work in progress on the issues that have been
    documented requires arch specific knowledge to sort out.

    The changes below fix or at least document all of the issues that have
    been found with siginfo generation. Then proceed to unify struct
    siginfo the 32 bit helpers that copy siginfo to and from userspace,
    and generally clean up anything that is not arch specific with regards
    to siginfo generation.

    It is a lot but with the unification you can of siginfo you can
    already see the code reduction in the kernel"

    * 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (45 commits)
    signal/memory-failure: Use force_sig_mceerr and send_sig_mceerr
    mm/memory_failure: Remove unused trapno from memory_failure
    signal/ptrace: Add force_sig_ptrace_errno_trap and use it where needed
    signal/powerpc: Remove unnecessary signal_code parameter of do_send_trap
    signal: Helpers for faults with specialized siginfo layouts
    signal: Add send_sig_fault and force_sig_fault
    signal: Replace memset(info,...) with clear_siginfo for clarity
    signal: Don't use structure initializers for struct siginfo
    signal/arm64: Better isolate the COMPAT_TASK portion of ptrace_hbptriggered
    ptrace: Use copy_siginfo in setsiginfo and getsiginfo
    signal: Unify and correct copy_siginfo_to_user32
    signal: Remove the code to clear siginfo before calling copy_siginfo_from_user32
    signal: Unify and correct copy_siginfo_from_user32
    signal/blackfin: Remove pointless UID16_SIGINFO_COMPAT_NEEDED
    signal/blackfin: Move the blackfin specific si_codes to asm-generic/siginfo.h
    signal/tile: Move the tile specific si_codes to asm-generic/siginfo.h
    signal/frv: Move the frv specific si_codes to asm-generic/siginfo.h
    signal/ia64: Move the ia64 specific si_codes to asm-generic/siginfo.h
    signal/powerpc: Remove redefinition of NSIGTRAP on powerpc
    signal: Move addr_lsb into the _sigfault union for clarity
    ...

    Linus Torvalds
     

13 Jan, 2018

1 commit

  • While reviewing the signal sending on openrisc the do_unaligned_access
    function stood out because it is obviously wrong. A comment about an
    si_code set above when actually si_code is never set. Leading to a
    random si_code being sent to userspace in the event of an unaligned
    access.

    Looking further SIGBUS BUS_ADRALN is the proper pair of signal and
    si_code to send for an unaligned access. That is what other
    architectures do and what is required by posix.

    Given that do_unaligned_access is broken in a way that no one can be
    relying on it on openrisc fix the code to just do the right thing.

    Cc: stable@vger.kernel.org
    Fixes: 769a8a96229e ("OpenRISC: Traps")
    Cc: Jonas Bonn
    Cc: Stefan Kristiansson
    Cc: Stafford Horne
    Cc: Arnd Bergmann
    Cc: openrisc@lists.librecores.org
    Acked-by: Stafford Horne
    Signed-off-by: "Eric W. Biederman"

    Eric W. Biederman
     

10 Jan, 2018

2 commits

  • Construct the init thread stack in the linker script rather than doing it
    by means of a union so that ia64's init_task.c can be got rid of.

    The following symbols are then made available from INIT_TASK_DATA() linker
    script macro:

    init_thread_union
    init_stack

    INIT_TASK_DATA() also expands the region to THREAD_SIZE to accommodate the
    size of the init stack. init_thread_union is given its own section so that
    it can be placed into the stack space in the right order. I'm assuming
    that the ia64 ordering is correct and that the task_struct is first and the
    thread_info second.

    Signed-off-by: David Howells
    Tested-by: Tony Luck
    Tested-by: Will Deacon (arm64)
    Tested-by: Palmer Dabbelt
    Acked-by: Thomas Gleixner

    David Howells
     
  • Make THREAD_SIZE available to vmlinux.lds on openrisc by including
    asm/thread_info.h the linker script.

    This allows init_stack to be allocated in the linker script in a subsequent
    patch.

    Reported-by: Guenter Roeck
    Signed-off-by: David Howells
    Tested-by: Guenter Roeck
    Acked-by: Stafford Horne
    cc: Jonas Bonn
    cc: Stefan Kristiansson
    cc: openrisc@lists.librecores.org

    David Howells
     

09 Jan, 2018

1 commit

  • The printk tree in linux-next has a patch "symbol lookup: introduce
    dereference_symbol_descriptor()" that includes sections.h in kallsyms.h,
    so arch/openrisc/kernel/traps.c gets a second extern definition for
    _etext and _stext.

    Remove the local definitions and include sections.h directly in
    preparation for the kallsyms.h change.

    This fixes the following (future) build error:

    CC arch/openrisc/kernel/traps.o
    arch/openrisc/kernel/traps.c:43:13: error: conflicting types for ‘_etext’
    extern char _etext, _stext;
    ^
    In file included from ./arch/openrisc/include/generated/asm/sections.h:1:0,
    from ./include/linux/kallsyms.h:15,
    from arch/openrisc/kernel/traps.c:35:
    ./include/asm-generic/sections.h:35:32: note: previous declaration of ‘_etext’ was here
    extern char _text[], _stext[], _etext[];
    ^

    Signed-off-by: Joel Stanley
    Reviewed-by: Sergey Senozhatsky
    Acked-by: Stafford Horne
    Signed-off-by: Petr Mladek

    Joel Stanley