Skip to content
  1. Mar 09, 2017
    • Linus Torvalds's avatar
      overlayfs: remove now unnecessary header file include · 04bb94b1
      Linus Torvalds authored
      This removes the extra include header file that was added in commit
      e58bc927
      
       "Pull overlayfs updates from Miklos Szeredi" now that it
      is no longer needed.
      
      There are probably other such includes that got added during the
      scheduler header splitup series, but this is the one that annoyed me
      personally and I know about.
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      04bb94b1
    • Linus Torvalds's avatar
      sched/headers: fix up header file dependency on <linux/sched/signal.h> · bd0f9b35
      Linus Torvalds authored
      The scheduler header file split and cleanups ended up exposing a few
      nasty header file dependencies, and in particular it showed how we in
      <linux/wait.h> ended up depending on "signal_pending()", which now comes
      from <linux/sched/signal.h>.
      
      That's a very subtle and annoying dependency, which already caused a
      semantic merge conflict (see commit e58bc927
      
       "Pull overlayfs updates
      from Miklos Szeredi", which added that fixup in the merge commit).
      
      It turns out that we can avoid this dependency _and_ improve code
      generation by moving the guts of the fairly nasty helper #define
      __wait_event_interruptible_locked() to out-of-line code.  The code that
      includes the signal_pending() check is all in the slow-path where we
      actually go to sleep waiting for the event anyway, so using a helper
      function is the right thing to do.
      
      Using a helper function is also what we already did for the non-locked
      versions, see the "__wait_event*()" macros and the "prepare_to_wait*()"
      set of helper functions.
      
      We might want to try to unify all these macro games, we have a _lot_ of
      subtly different wait-event loops.  But this is the minimal patch to fix
      the annoying header dependency.
      
      Acked-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      bd0f9b35
  2. Mar 08, 2017
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ec3b93ae
      Linus Torvalds authored
      Pull x86 fixes from Ingo Molnar:
       "Misc fixes and minor updates all over the place:
      
         - an SGI/UV fix
         - a defconfig update
         - a build warning fix
         - move the boot_params file to the arch location in debugfs
         - a pkeys fix
         - selftests fix
         - boot message fixes
         - sparse fixes
         - a resume warning fix
         - ioapic hotplug fixes
         - reboot quirks
      
        ... plus various minor cleanups"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/build/x86_64_defconfig: Enable CONFIG_R8169
        x86/reboot/quirks: Add ASUS EeeBook X205TA/W reboot quirk
        x86/hpet: Prevent might sleep splat on resume
        x86/boot: Correct setup_header.start_sys name
        x86/purgatory: Fix sparse warning, symbol not declared
        x86/purgatory: Make functions and variables static
        x86/events: Remove last remnants of old filenames
        x86/pkeys: Check against max pkey to avoid overflows
        x86/ioapic: Split IOAPIC hot-removal into two steps
        x86/PCI: Implement pcibios_release_device to release IRQ from IOAPIC
        x86/intel_rdt: Remove duplicate inclusion of linux/cpu.h
        x86/vmware: Remove duplicate inclusion of asm/timer.h
        x86/hyperv: Hide unused label
        x86/reboot/quirks: Add ASUS EeeBook X205TA reboot quirk
        x86/platform/uv/BAU: Fix HUB errors by remove initial write to sw-ack register
        x86/selftests: Add clobbers for int80 on x86_64
        x86/apic: Simplify enable_IR_x2apic(), remove try_to_enable_IR()
        x86/apic: Fix a warning message in logical CPU IDs allocation
        x86/kdebugfs: Move boot params hierarchy under (debugfs)/x86/
      ec3b93ae
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 8a917235
      Linus Torvalds authored
      Pull timer fixes from Ingo Molnar:
       "This includes a fix for lockups caused by incorrect nsecs related
        cleanup, and a capabilities check fix for timerfd"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        jiffies: Revert bogus conversion of NSEC_PER_SEC to TICK_NSEC
        timerfd: Only check CAP_WAKE_ALARM when it is needed
      8a917235
    • Linus Torvalds's avatar
      Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 609b07b7
      Linus Torvalds authored
      Pull scheduler fixes from Ingo Molnar:
       "A fix for KVM's scheduler clock which (erroneously) was always marked
        unstable, a fix for RT/DL load balancing, plus latency fixes"
      
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/clock, x86/tsc: Rework the x86 'unstable' sched_clock() interface
        sched/core: Fix pick_next_task() for RT,DL
        sched/fair: Make select_idle_cpu() more aggressive
      609b07b7
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · c3abcabe
      Linus Torvalds authored
      Pull perf fixes from Ingo Molnar:
       "This includes a fix for a crash if certain special addresses are
        kprobed, plus does a rename of two Kconfig variables that were a minor
        misnomer"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/core: Rename CONFIG_[UK]PROBE_EVENT to CONFIG_[UK]PROBE_EVENTS
        kprobes/x86: Fix kernel panic when certain exception-handling addresses are probed
      c3abcabe
    • Linus Torvalds's avatar
      Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 500e1af2
      Linus Torvalds authored
      Pull locking fixes from Ingo Molnar:
      
       - Change the new refcount_t warnings from WARN() to WARN_ONCE()
      
       - two ww_mutex fixes
      
       - plus a new lockdep self-consistency check for a bug that triggered in
         practice
      
      * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        locking/ww_mutex: Adjust the lock number for stress test
        locking/lockdep: Add nest_lock integrity test
        locking/ww_mutex: Replace cpu_relax() with cond_resched() for tests
        locking/refcounts: Change WARN() to WARN_ONCE()
      500e1af2
    • Linus Torvalds's avatar
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 26db8f99
      Linus Torvalds authored
      Pull IRQ fix from Ingo Molnar:
       "Fix an ARM TI DRA7XX SoC irqchip driver local variables type
        bug/warning"
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip/crossbar: Fix incorrect type of local variables
      26db8f99
    • Linus Torvalds's avatar
      Merge branch 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 21f85778
      Linus Torvalds authored
      Pull EFI fixes from Ingo Molnar:
       "A boot crash fix, and a secure boot related boot messages fix"
      
      * 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        efi/arm: Fix boot crash with CONFIG_CPUMASK_OFFSTACK=y
        efi/libstub: Treat missing SecureBoot variable as Secure Boot disabled
      21f85778
    • Linus Torvalds's avatar
      Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · c688f14c
      Linus Torvalds authored
      Pull core fixes from Ingo Molnar:
       "A couple of sched.h splitup related build fixes, plus an objtool fix"
      
      * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        objtool: Fix another GCC jump table detection issue
        drivers/char/nwbutton: Fix build breakage caused by include file reshuffling
        h8300: Fix build breakage caused by header file changes
        avr32: Fix build error caused by include file reshuffling
      c688f14c
    • Linus Torvalds's avatar
      Merge branch 'idr-4.11' of git://git.infradead.org/users/willy/linux-dax · 9e91c144
      Linus Torvalds authored
      Pull idr fix (and new tests) from Matthew Wilcox:
       "One urgent patch in here; freeing the correct IDA bitmap.
      
        Everything else is changes to the test suite"
      
      * 'idr-4.11' of git://git.infradead.org/users/willy/linux-dax:
        radix tree test suite: Specify -m32 in LDFLAGS too
        ida: Free correct IDA bitmap
        radix tree test suite: Depend on Makefile and quieten grep
        radix tree test suite: Fix build with --as-needed
        radix tree test suite: Build 32 bit binaries
        radix tree test suite: Add performance test for radix_tree_join()
        radix tree test suite: Add performance test for radix_tree_split()
        radix tree test suite: Add performance benchmarks
        radix tree test suite: Add test for radix_tree_clear_tags()
        radix tree test suite: Add tests for ida_simple_get() and ida_simple_remove()
        radix tree test suite: Add test for idr_get_next()
      9e91c144
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · f7d6a728
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "Five fairly small fixes for things that went in this cycle.
      
        A fairly large patch to rework the CAS logic on Power9, necessitated
        by a late change to the firmware API, and we can't boot without it.
      
        Three fixes going to stable, allowing more instructions to be emulated
        on LE, fixing a boot crash on 32-bit Freescale BookE machines, and the
        OPAL XICS workaround.
      
        And a patch from me to sort the selects under CONFIG PPC. Annoying
        churn, but worth it in the long run, and best for it to go in now to
        avoid conflicts.
      
        Thanks to:
          Alexey Kardashevskiy, Anton Blanchard, Balbir Singh, Gautham R.
          Shenoy, Laurentiu Tudor, Nicholas Piggin, Paul Mackerras, Ravi
          Bangoria, Sachin Sant, Shile Zhang, Suraj Jitindar Singh"
      
      * tag 'powerpc-4.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc: Sort the selects under CONFIG_PPC
        powerpc/64: Fix L1D cache shape vector reporting L1I values
        powerpc/64: Avoid panic during boot due to divide by zero in init_cache_info()
        powerpc: Update to new option-vector-5 format for CAS
        powerpc: Parse the command line before calling CAS
        powerpc/xics: Work around limitations of OPAL XICS priority handling
        powerpc/64: Fix checksum folding in csum_add()
        powerpc/powernv: Fix opal tracepoints with JUMP_LABEL=n
        powerpc/booke: Fix boot crash due to null hugepd
        powerpc: Fix compiling a BE kernel with a powerpc64le toolchain
        selftest/powerpc: Fix false failures for skipped tests
        powerpc/powernv: Fix bug due to labeling ambiguity in power_enter_stop
        powerpc/64: Invalidate process table caching after setting process table
        powerpc: emulate_step() tests for load/store instructions
        powerpc: Emulation support for load/store instructions on LE
      f7d6a728
    • Linus Torvalds's avatar
      Merge branch 'stable/for-linus-4.11' of... · 8c2c8ed8
      Linus Torvalds authored
      Merge branch 'stable/for-linus-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb
      
      Pull swiotlb updates from Konrad Rzeszutek Wilk:
       "Two tiny implementations of the DMA API for callback in ARM (for Xen)"
      
      * 'stable/for-linus-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb:
        swiotlb-xen: implement xen_swiotlb_get_sgtable callback
        swiotlb-xen: implement xen_swiotlb_dma_mmap callback
      8c2c8ed8
    • Matthew Wilcox's avatar
      radix tree test suite: Specify -m32 in LDFLAGS too · f0f3f2d0
      Matthew Wilcox authored
      
      
      Michael's patch to use the default make rule for linking and the patch
      from Rehas to use -m32 if building a 32-bit test-suite on a 64-bit
      platform don't work well together.
      
      Reported-by: default avatarRehas Sachdeva <aquannie@gmail.com>
      Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      f0f3f2d0
    • Matthew Wilcox's avatar
      ida: Free correct IDA bitmap · 4ecd9542
      Matthew Wilcox authored
      
      
      There's a relatively rare race where we look at the per-cpu preallocated
      IDA bitmap, see it's NULL, allocate a new one, and atomically update it.
      If the kmalloc() happened to sleep and we were rescheduled to a different
      CPU, or an interrupt came in at the exact right time, another task
      might have successfully allocated a bitmap and already deposited it.
      I forgot what the semantics of cmpxchg() were and ended up freeing the
      wrong bitmap leading to KASAN reporting a use-after-free.
      
      Dmitry found the bug with syzkaller & wrote the patch.  I wrote the test
      case that will reproduce the bug without his patch being applied.
      
      Reported-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      4ecd9542
    • Matthew Wilcox's avatar
      radix tree test suite: Depend on Makefile and quieten grep · 3f1b6f9d
      Matthew Wilcox authored
      
      
      Changing the CFLAGS in the Makefile didn't always lead to a
      recompilation because the OFILES didn't depend on the Makefile.
      Also, after doing make clean, grep would still complain about
      a missing map-shift.h; we need -s as well as -q.
      
      Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      3f1b6f9d
    • Michael Ellerman's avatar
      radix tree test suite: Fix build with --as-needed · 284d96a4
      Michael Ellerman authored
      
      
      Currently the radix tree test suite doesn't build with toolchains that
      use --as-needed by default, for example Ubuntu's:
      
        cc -I. -I../../include -g -O2 -Wall -D_LGPL_SOURCE -fsanitize=address -lpthread -lurcu main.o ... -o main
        /usr/bin/ld: regression1.o: undefined reference to symbol 'pthread_join@@GLIBC_2.17'
        /lib/powerpc64le-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
        collect2: error: ld returned 1 exit status
      
      This is caused by the custom makefile rules placing LDFLAGS before the
      .o files that need the libraries.
      
      We could fix it by using --no-as-needed, or rewriting the custom rules.
      But we can also just drop the custom rules and move the libraries to
      LDLIBS, and then the default rules work correctly - with the one caveat
      that we need to add -fsanitize=address to LDFLAGS because that must be
      passed to the linker as well as the compiler.
      
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      284d96a4
    • Rehas Sachdeva's avatar
      radix tree test suite: Build 32 bit binaries · c4634b08
      Rehas Sachdeva authored
      
      
      Add option 'make BUILD=32' for building 32-bit binaries.
      
      Signed-off-by: default avatarRehas Sachdeva <aquannie@gmail.com>
      Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      c4634b08
    • Rehas Sachdeva's avatar
    • Rehas Sachdeva's avatar
    • Rehas Sachdeva's avatar
      radix tree test suite: Add performance benchmarks · 0d4a41c1
      Rehas Sachdeva authored
      
      
      Add performance benchmarks for radix tree insertion, tagging and deletion.
      
      Signed-off-by: default avatarRehas Sachdeva <aquannie@gmail.com>
      Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      0d4a41c1
    • Rehas Sachdeva's avatar
      radix tree test suite: Add test for radix_tree_clear_tags() · c629a344
      Rehas Sachdeva authored
      
      
      Assert that radix_tree_clear_tags() clears the tags on the passed node and
      slot. Assert that the case where the radix tree has only one entry at index
      zero and the node is NULL, is also handled.
      
      Signed-off-by: default avatarRehas Sachdeva <aquannie@gmail.com>
      Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      c629a344
    • Rehas Sachdeva's avatar
      radix tree test suite: Add tests for ida_simple_get() and ida_simple_remove() · 166bb1f5
      Rehas Sachdeva authored
      
      
      Assert that ida_simple_get() allocates an id in the passed range or returns
      error on failure, and ida_simple_remove() releases an allocated id.
      
      Signed-off-by: default avatarRehas Sachdeva <aquannie@gmail.com>
      Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      166bb1f5
    • Rehas Sachdeva's avatar
      radix tree test suite: Add test for idr_get_next() · 2eacc79c
      Rehas Sachdeva authored
      
      
      Assert that idr_get_next() returns the next populated entry in the tree with
      an ID greater than or equal to the value pointed to by @nextid argument.
      
      Signed-off-by: default avatarRehas Sachdeva <aquannie@gmail.com>
      Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      2eacc79c
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace · 304362a8
      Linus Torvalds authored
      Pull namespace fix from Eric Biederman:
       "This fixes a race between put_ucounts and get_ucounts that can cause a
        use after free. The fix works by simplifying the code and so there is
        not even a temptation to be clever and play spinlock vs atomic
        reference games"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
        ucount: Remove the atomicity from ucount->count
      304362a8
    • Linus Torvalds's avatar
      Merge tag 'trace-v4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · f26db964
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
       "There was some breakage with the changes for jump labels in the 4.11
        merge window:
      
         - powerpc broke as jump labels uses the two LSB bits as flags in
           initialization.
      
           A check was added to make sure that all jump label entries were 4
           bytes aligned, but powerpc didn't work that way for modules. Adding
           an alignment in the module linker script appeared to be the best
           solution.
      
         - Jump labels also added an anonymous union to access those LSB bits
           as a normal long. But because this structure had static
           initialization, it broke older compilers that could not statically
           initialize anonymous unions without brackets.
      
         - The command line parameter for setting function graph filter broke
           the "EMPTY_HASH" descriptor by modifying it instead of creating a
           new hash to hold the entries.
      
         - The command line parameter ftrace_graph_max_depth was added to
           allow its setting at boot time. It uses existing code and only the
           command line hook was added.
      
           This is not really a fix, but as it uses existing code without
           affecting anything else, I added it to this release. It was ready
           before the merge window closed, but I wanted to let it sit in
           linux-next for a couple of days first"
      
      * tag 'trace-v4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        ftrace/graph: Add ftrace_graph_max_depth kernel parameter
        tracing: Add #undef to fix compile error
        jump_label: Add comment about initialization order for anonymous unions
        jump_label: Fix anonymous union initialization
        module: set __jump_table alignment to 8
        ftrace/graph: Do not modify the EMPTY_HASH for the function_graph filter
        tracing: Fix code comment for ftrace_ops_get_func()
      f26db964
  3. Mar 07, 2017
    • Frederic Weisbecker's avatar
      jiffies: Revert bogus conversion of NSEC_PER_SEC to TICK_NSEC · fa3aa7a5
      Frederic Weisbecker authored
      commit 93825f2e converted NSEC_PER_SEC to TICK_NSEC because the author
      confused NSEC_PER_JIFFY with NSEC_PER_SEC.
      
      As a result, the calculation of refined jiffies got broken, triggering
      lockups.
      
      Fixes: 93825f2e
      
       ("jiffies: Reuse TICK_NSEC instead of NSEC_PER_JIFFY")
      Reported-and-tested-by: default avatarMeelis Roos <mroos@linux.ee>
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1488880534-3777-1-git-send-email-fweisbec@gmail.com
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      fa3aa7a5
    • Josh Poimboeuf's avatar
      objtool: Fix another GCC jump table detection issue · 5c51f4ae
      Josh Poimboeuf authored
      
      
      Arnd Bergmann reported a (false positive) objtool warning:
      
        drivers/infiniband/sw/rxe/rxe_resp.o: warning: objtool: rxe_responder()+0xfe: sibling call from callable instruction with changed frame pointer
      
      The issue is in find_switch_table().  It tries to find a switch
      statement's jump table by walking backwards from an indirect jump
      instruction, looking for a relocation to the .rodata section.  In this
      case it stopped walking prematurely: the first .rodata relocation it
      encountered was for a variable (resp_state_name) instead of a jump
      table, so it just assumed there wasn't a jump table.
      
      The fix is to ignore any .rodata relocation which refers to an ELF
      object symbol.  This works because the jump tables are anonymous and
      have no symbols associated with them.
      
      Reported-by: default avatarArnd Bergmann <arnd@arndb.de>
      Tested-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@redhat.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Fixes: 3732710f
      
       ("objtool: Improve rare switch jump table pattern detection")
      Link: http://lkml.kernel.org/r/20170302225723.3ndbsnl4hkqbne7a@treble
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      5c51f4ae
    • Guenter Roeck's avatar
      drivers/char/nwbutton: Fix build breakage caused by include file reshuffling · bb35e451
      Guenter Roeck authored
      
      
      Fix:
      
        drivers/char/nwbutton.c: In function 'button_sequence_finished':
        drivers/char/nwbutton.c:134:3: error: implicit declaration of function 'kill_cad_pid'
      
      The declaration has been moved from one include file to another.
      
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Fixes: c3edc401
      
       ("sched/headers: Move task_struct::signal and ...")
      Link: http://lkml.kernel.org/r/1488762811-9022-1-git-send-email-linux@roeck-us.net
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      bb35e451
    • Guenter Roeck's avatar
      h8300: Fix build breakage caused by header file changes · 80aa1a54
      Guenter Roeck authored
      
      
      Fix the following h8300 build failures:
      
        arch/h8300/kernel/ptrace_h.c: In function ‘trace_trap’:
        arch/h8300/kernel/ptrace_h.c:253:3: error: implicit declaration of function ‘force_sig’
      
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: uclinux-h8-devel@lists.sourceforge.jp
      Fixes: c3edc401
      
       ("sched/headers: Move task_struct::signal and ...")
      Link: http://lkml.kernel.org/r/1488738434-3504-1-git-send-email-linux@roeck-us.net
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      80aa1a54
    • Guenter Roeck's avatar
      avr32: Fix build error caused by include file reshuffling · 1fbdbcea
      Guenter Roeck authored
      
      
      Various avr32 builds fail:
      
        arch/avr32/oprofile/backtrace.c:58: error: dereferencing pointer to incomplete type
        arch/avr32/oprofile/backtrace.c:60: error: implicit declaration of function 'user_mode'
      
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Acked-by: default avatarHans-Christian Noren Egtvedt <egtvedt@samfundet.no>
      Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
      Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <rric@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: oprofile-list@lists.sf.net
      Fixes: f780d89a
      
       ("sched/headers: Remove <asm/ptrace.h> from ...")
      Link: http://lkml.kernel.org/r/1488762357-4500-1-git-send-email-linux@roeck-us.net
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      1fbdbcea
    • Eric W. Biederman's avatar
      ucount: Remove the atomicity from ucount->count · 040757f7
      Eric W. Biederman authored
      Always increment/decrement ucount->count under the ucounts_lock.  The
      increments are there already and moving the decrements there means the
      locking logic of the code is simpler.  This simplification in the
      locking logic fixes a race between put_ucounts and get_ucounts that
      could result in a use-after-free because the count could go zero then
      be found by get_ucounts and then be freed by put_ucounts.
      
      A bug presumably this one was found by a combination of syzkaller and
      KASAN.  JongWhan Kim reported the syzkaller failure and Dmitry Vyukov
      spotted the race in the code.
      
      Cc: stable@vger.kernel.org
      Fixes: f6b2db1a
      
       ("userns: Make the count of user namespaces per user")
      Reported-by: default avatarJongHwan Kim <zzoru007@gmail.com>
      Reported-by: default avatarDmitry Vyukov <dvyukov@google.com>
      Reviewed-by: default avatarAndrei Vagin <avagin@gmail.com>
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      040757f7
  4. Mar 06, 2017
    • Michael Ellerman's avatar
      powerpc: Sort the selects under CONFIG_PPC · a7d2475a
      Michael Ellerman authored
      
      
      We have a big list of selects under CONFIG_PPC, and currently they're
      completely unsorted. This means people tend to add new selects at the
      bottom of the list, and so two commits which both add a new select will
      often conflict.
      
      Instead sort it alphabetically. This is nicer in and of itself, but also
      means two commits that add a new select will have a greater chance of
      not conflicting.
      
      Add a note at the top and bottom asking people to keep it sorted.
      
      And while we're here pad out the 'if' expressions to make them stand
      out.
      
      Suggested-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      a7d2475a
    • Michael Ellerman's avatar
      powerpc/64: Fix L1D cache shape vector reporting L1I values · 9c7a0086
      Michael Ellerman authored
      It seems we didn't pay quite enough attention when testing the new cache
      shape vectors, which means we didn't notice the bug where the vector for
      the L1D was using the L1I values. Fix it, resulting in eg:
      
        L1I  cache size:     0x8000      32768B         32K
        L1I  line size:        0x80       8-way associative
        L1D  cache size:    0x10000      65536B         64K
        L1D  line size:        0x80       8-way associative
      
      Fixes: 98a5f361
      
       ("powerpc: Add new cache geometry aux vectors")
      Cut-and-paste-bug-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Badly-reviewed-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      9c7a0086
    • Andy Shevchenko's avatar
      x86/build/x86_64_defconfig: Enable CONFIG_R8169 · f2853308
      Andy Shevchenko authored
      
      
      Very common PCIe ethernet card. Already enabled in i386_defconfig.
      
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Konstantin Khlebnikov <koct9i@gmail.com>
      Link: http://lkml.kernel.org/r/20170306085748.85957-1-andriy.shevchenko@linux.intel.com
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      f2853308
    • Matjaz Hegedic's avatar
      x86/reboot/quirks: Add ASUS EeeBook X205TA/W reboot quirk · 3b3e7855
      Matjaz Hegedic authored
      
      
      Without the parameter reboot=a, ASUS EeeBook X205TA/W will hang
      when it should reboot. This adds the appropriate quirk, thus
      fixing the problem.
      
      Signed-off-by: default avatarMatjaz Hegedic <matjaz.hegedic@gmail.com>
      Link: http://lkml.kernel.org/r/1488737804-20681-1-git-send-email-matjaz.hegedic@gmail.com
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      3b3e7855
    • Anton Blanchard's avatar
      powerpc/64: Avoid panic during boot due to divide by zero in init_cache_info() · 6ba422c7
      Anton Blanchard authored
      I see a panic in early boot when building with a recent gcc toolchain.
      The issue is a divide by zero, which is undefined. Older toolchains
      let us get away with it:
      
      int foo(int a) { return a / 0; }
      
      foo:
      	li 9,0
      	divw 3,3,9
      	extsw 3,3
      	blr
      
      But newer ones catch it:
      
      foo:
      	trap
      
      Add a check to avoid the divide by zero.
      
      Fixes: e2827fe5
      
       ("powerpc/64: Clean up ppc64_caches using a struct per cache")
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      6ba422c7
    • Suraj Jitindar Singh's avatar
      powerpc: Update to new option-vector-5 format for CAS · 014d02cb
      Suraj Jitindar Singh authored
      
      
      On POWER9 the ibm,client-architecture-support (CAS) negotiation process
      has been updated to change how the host to guest negotiation is done for
      the new hash/radix mmu as well as the nest mmu, process tables and guest
      translation shootdown (GTSE).
      
      This is documented in the unreleased PAPR ACR "CAS option vector
      additions for P9".
      
      The host tells the guest which options it supports in
      ibm,arch-vec-5-platform-support. The guest then chooses a subset of these
      to request in the CAS call and these are agreed to in the
      ibm,architecture-vec-5 property of the chosen node.
      
      Thus we read ibm,arch-vec-5-platform-support and make our selection before
      calling CAS. We then parse the ibm,architecture-vec-5 property of the
      chosen node to check whether we should run as hash or radix.
      
      ibm,arch-vec-5-platform-support format:
      
      index value pairs: <index, val> ... <index, val>
      
      index: Option vector 5 byte number
      val:   Some representation of supported values
      
      Signed-off-by: default avatarSuraj Jitindar Singh <sjitindarsingh@gmail.com>
      Acked-by: default avatarPaul Mackerras <paulus@ozlabs.org>
      [mpe: Don't print about unknown options, be consistent with OV5_FEAT]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      014d02cb
    • Suraj Jitindar Singh's avatar
      powerpc: Parse the command line before calling CAS · 12cc9fd6
      Suraj Jitindar Singh authored
      
      
      On POWER9 the hypervisor requires the guest to decide whether it would
      like to use a hash or radix mmu model at the time it calls
      ibm,client-architecture-support (CAS) based on what the hypervisor has
      said it's allowed to do. It is possible to disable radix by passing
      "disable_radix" on the command line. The next patch will add support for
      the new CAS format, thus we need to parse the command line before calling
      CAS so we can correctly select which mmu we would like to use.
      
      Signed-off-by: default avatarSuraj Jitindar Singh <sjitindarsingh@gmail.com>
      Reviewed-by: default avatarPaul Mackerras <paulus@ozlabs.org>
      Acked-by: default avatarBalbir Singh <bsingharora@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      12cc9fd6
    • Balbir Singh's avatar
      powerpc/xics: Work around limitations of OPAL XICS priority handling · a69e2fb7
      Balbir Singh authored
      The CPPR (Current Processor Priority Register) of a XICS interrupt
      presentation controller contains a value N, such that only interrupts
      with a priority "more favoured" than N will be received by the CPU,
      where "more favoured" means "less than". So if the CPPR has the value 5
      then only interrupts with a priority of 0-4 inclusive will be received.
      
      In theory the CPPR can support a value of 0 to 255 inclusive.
      In practice Linux only uses values of 0, 4, 5 and 0xff. Setting the CPPR
      to 0 rejects all interrupts, setting it to 0xff allows all interrupts.
      The values 4 and 5 are used to differentiate IPIs from external
      interrupts. Setting the CPPR to 5 allows IPIs to be received but not
      external interrupts.
      
      The CPPR emulation in the OPAL XICS implementation only directly
      supports priorities 0 and 0xff. All other priorities are considered
      equivalent, and mapped to a single priority value internally. This means
      when using icp-opal we can not allow IPIs but not externals.
      
      This breaks Linux's use of priority values when a CPU is hot unplugged.
      After migrating IRQs away from the CPU that is being offlined, we set
      the priority to 5, meaning we still want the offline CPU to receive
      IPIs. But the effect of the OPAL XICS emulation's use of a single
      priority value is that all interrupts are rejected by the CPU. With the
      CPU offline, and not receiving IPIs, we may not be able to wake it up to
      bring it back online.
      
      The first part of the fix is in icp_opal_set_cpu_priority(). CPPR values
      of 0 to 4 inclusive will correctly cause all interrupts to be rejected,
      so we pass those CPPR values through to OPAL. However if we are called
      with a CPPR of 5 or greater, the caller is expecting to be able to allow
      IPIs but not external interrupts. We know this doesn't work, so instead
      of rejecting all interrupts we choose the opposite which is to allow all
      interrupts. This is still not correct behaviour, but we know for the
      only existing caller (xics_migrate_irqs_away()), that it is the better
      option.
      
      The other part of the fix is in xics_migrate_irqs_away(). Instead of
      setting priority (CPPR) to 0, and then back to 5 before migrating IRQs,
      we migrate the IRQs before setting the priority back to 5. This should
      have no effect on an ICP backend with a working set_priority(), and on
      icp-opal it means we will keep all interrupts blocked until after we've
      finished doing the IRQ migration. Additionally we wait for 5ms after
      doing the migration to make sure there are no IRQs in flight.
      
      Fixes: d7436188
      
       ("powerpc/xics: Add ICP OPAL backend")
      Cc: stable@vger.kernel.org # v4.8+
      Suggested-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Reported-by: default avatarVaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
      Tested-by: default avatarVaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
      Signed-off-by: default avatarBalbir Singh <bsingharora@gmail.com>
      [mpe: Rewrote comments and change log, change delay to 5ms]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      a69e2fb7