26 Sep, 2016

2 commits

  • Pull MIPS fixes from Ralf Baechle:
    "A round of 4.8 fixes:

    MIPS generic code:
    - Add a missing ".set pop" in an early commit
    - Fix memory regions reaching top of physical
    - MAAR: Fix address alignment
    - vDSO: Fix Malta EVA mapping to vDSO page structs
    - uprobes: fix incorrect uprobe brk handling
    - uprobes: select HAVE_REGS_AND_STACK_ACCESS_API
    - Avoid a BUG warning during PR_SET_FP_MODE prctl
    - SMP: Fix possibility of deadlock when bringing CPUs online
    - R6: Remove compact branch policy Kconfig entries
    - Fix size calc when avoiding IPIs for small icache flushes
    - Fix pre-r6 emulation FPU initialisation
    - Fix delay slot emulation count in debugfs

    ATH79:
    - Fix test for error return of clk_register_fixed_factor.

    Octeon:
    - Fix kernel header to work for VDSO build.
    - Fix initialization of platform device probing.

    paravirt:
    - Fix undefined reference to smp_bootstrap"

    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
    MIPS: Fix delay slot emulation count in debugfs
    MIPS: SMP: Fix possibility of deadlock when bringing CPUs online
    MIPS: Fix pre-r6 emulation FPU initialisation
    MIPS: vDSO: Fix Malta EVA mapping to vDSO page structs
    MIPS: Select HAVE_REGS_AND_STACK_ACCESS_API
    MIPS: Octeon: Fix platform bus probing
    MIPS: Octeon: mangle-port: fix build failure with VDSO code
    MIPS: Avoid a BUG warning during prctl(PR_SET_FP_MODE, ...)
    MIPS: c-r4k: Fix size calc when avoiding IPIs for small icache flushes
    MIPS: Add a missing ".set pop" in an early commit
    MIPS: paravirt: Fix undefined reference to smp_bootstrap
    MIPS: Remove compact branch policy Kconfig entries
    MIPS: MAAR: Fix address alignment
    MIPS: Fix memory regions reaching top of physical
    MIPS: uprobes: fix incorrect uprobe brk handling
    MIPS: ath79: Fix test for error return of clk_register_fixed_factor().

    Linus Torvalds
     
  • Pull one more powerpc fix from Michael Ellerman:
    "powernv/pci: Fix m64 checks for SR-IOV and window alignment from
    Russell Currey"

    * tag 'powerpc-4.8-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
    powerpc/powernv/pci: Fix m64 checks for SR-IOV and window alignment

    Linus Torvalds
     

25 Sep, 2016

5 commits

  • Commit 432c6bacbd0c ("MIPS: Use per-mm page to execute branch delay slot
    instructions") accidentally removed use of the MIPS_FPU_EMU_INC_STATS
    macro from do_dsemulret, leading to the ds_emul file in debugfs always
    returning zero even though we perform delay slot emulations.

    Fix this by re-adding the use of the MIPS_FPU_EMU_INC_STATS macro.

    Signed-off-by: Paul Burton
    Fixes: 432c6bacbd0c ("MIPS: Use per-mm page to execute branch delay slot instructions")
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/14301/
    Signed-off-by: Ralf Baechle

    Paul Burton
     
  • This patch fixes the possibility of a deadlock when bringing up
    secondary CPUs.
    The deadlock occurs because the set_cpu_online() is called before
    synchronise_count_slave(). This can cause a deadlock if the boot CPU,
    having scheduled another thread, attempts to send an IPI to the
    secondary CPU, which it sees has been marked online. The secondary is
    blocked in synchronise_count_slave() waiting for the boot CPU to enter
    synchronise_count_master(), but the boot cpu is blocked in
    smp_call_function_many() waiting for the secondary to respond to it's
    IPI request.

    Fix this by marking the CPU online in cpu_callin_map and synchronising
    counters before declaring the CPU online and calculating the maps for
    IPIs.

    Signed-off-by: Matt Redfearn
    Reported-by: Justin Chen
    Tested-by: Justin Chen
    Cc: Florian Fainelli
    Cc: stable@vger.kernel.org # v4.1+
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/14302/
    Signed-off-by: Ralf Baechle

    Matt Redfearn
     
  • Pull perf fixes from Thomas Gleixner:
    "Three fixlets for perf:

    - add a missing NULL pointer check in the intel BTS driver

    - make BTS an exclusive PMU because BTS can only handle one event at
    a time

    - ensure that exclusive events are limited to one PMU so that several
    exclusive events can be scheduled on different PMU instances"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf/core: Limit matching exclusive events to one PMU
    perf/x86/intel/bts: Make it an exclusive PMU
    perf/x86/intel/bts: Make sure debug store is valid

    Linus Torvalds
     
  • Pull locking fixes from Thomas Gleixner:
    "Two smallish fixes:

    - use the proper asm constraint in the Super-H atomic_fetch_ops

    - a trivial typo fix in the Kconfig help text"

    * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    locking/hung_task: Fix typo in CONFIG_DETECT_HUNG_TASK help text
    locking/atomic, arch/sh: Fix ATOMIC_FETCH_OP()

    Linus Torvalds
     
  • Pull EFI fixes from Thomas Gleixner:
    "Two fixes for EFI/PAT:

    - a 32bit overflow bug in the PAT code which was unearthed by the
    large EFI mappings

    - prevent a boot hang on large systems when EFI mixed mode is enabled
    but not used"

    * 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/efi: Only map RAM into EFI page tables if in mixed-mode
    x86/mm/pat: Prevent hang during boot when mapping pages

    Linus Torvalds
     

24 Sep, 2016

2 commits

  • Pull arm64 fixes from Catalin Marinas:
    "A couple of last-minute arm64 fixes for 4.8:

    - Fix secondary CPU to NUMA node assignment

    - Fix kgdb breakpoint insertion in read-only text sections (when
    CONFIG_DEBUG_RODATA or CONFIG_DEBUG_SET_MODULE_RONX are enabled)"

    * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
    arm64: kgdb: handle read-only text / modules
    arm64: Call numa_store_cpu_info() earlier.

    Linus Torvalds
     
  • In the mipsr2_decoder() function, used to emulate pre-MIPSr6
    instructions that were removed in MIPSr6, the init_fpu() function is
    called if a removed pre-MIPSr6 floating point instruction is the first
    floating point instruction used by the task. However, init_fpu()
    performs varous actions that rely upon not being migrated. For example
    in the most basic case it sets the coprocessor 0 Status.CU1 bit to
    enable the FPU & then loads FP register context into the FPU registers.
    If the task were to migrate during this time, it may end up attempting
    to load FP register context on a different CPU where it hasn't set the
    CU1 bit, leading to errors such as:

    do_cpu invoked from kernel context![#2]:
    CPU: 2 PID: 7338 Comm: fp-prctl Tainted: G D 4.7.0-00424-g49b0c82 #2
    task: 838e4000 ti: 88d38000 task.ti: 88d38000
    $ 0 : 00000000 00000001 ffffffff 88d3fef8
    $ 4 : 838e4000 88d38004 00000000 00000001
    $ 8 : 3400fc01 801f8020 808e9100 24000000
    $12 : dbffffff 807b69d8 807b0000 00000000
    $16 : 00000000 80786150 00400fc4 809c0398
    $20 : 809c0338 0040273c 88d3ff28 808e9d30
    $24 : 808e9d30 00400fb4
    $28 : 88d38000 88d3fe88 00000000 8011a2ac
    Hi : 0040273c
    Lo : 88d3ff28
    epc : 80114178 _restore_fp+0x10/0xa0
    ra : 8011a2ac mipsr2_decoder+0xd5c/0x1660
    Status: 1400fc03 KERNEL EXL IE
    Cause : 1080002c (ExcCode 0b)
    PrId : 0001a920 (MIPS I6400)
    Modules linked in:
    Process fp-prctl (pid: 7338, threadinfo=88d38000, task=838e4000, tls=766527d0)
    Stack : 00000000 00000000 00000000 88d3fe98 00000000 00000000 809c0398 809c0338
    808e9100 00000000 88d3ff28 00400fc4 00400fc4 0040273c 7fb69e18 004a0000
    004a0000 004a0000 7664add0 8010de18 00000000 00000000 88d3fef8 88d3ff28
    808e9100 00000000 766527d0 8010e534 000c0000 85755000 8181d580 00000000
    00000000 00000000 004a0000 00000000 766527d0 7fb69e18 004a0000 80105c20
    ...
    Call Trace:
    [] _restore_fp+0x10/0xa0
    [] mipsr2_decoder+0xd5c/0x1660
    [] do_ri+0x90/0x6b8
    [] ret_from_exception+0x0/0x10

    Fix this by disabling preemption around the call to init_fpu(), ensuring
    that it starts & completes on one CPU.

    Signed-off-by: Paul Burton
    Fixes: b0a668fb2038 ("MIPS: kernel: mips-r2-to-r6-emul: Add R2 emulator for MIPS R6")
    Cc: linux-mips@linux-mips.org
    Cc: stable@vger.kernel.org # v4.0+
    Patchwork: https://patchwork.linux-mips.org/patch/14305/
    Signed-off-by: Ralf Baechle

    Paul Burton
     

23 Sep, 2016

2 commits

  • Handle read-only cases when CONFIG_DEBUG_RODATA (4.0) or
    CONFIG_DEBUG_SET_MODULE_RONX (3.18) are enabled by using
    aarch64_insn_write() instead of probe_kernel_write() as introduced by
    commit 2f896d586610 ("arm64: use fixmap for text patching") in 4.0.

    Fixes: 11d91a770f1f ("arm64: Add CONFIG_DEBUG_SET_MODULE_RONX support")
    Signed-off-by: AKASHI Takahiro
    Reviewed-by: Mark Rutland
    Cc: Will Deacon
    Cc: Jason Wessel
    Signed-off-by: Catalin Marinas

    AKASHI Takahiro
     
  • The wq_numa_init() function makes a private CPU to node map by calling
    cpu_to_node() early in the boot process, before the non-boot CPUs are
    brought online. Since the default implementation of cpu_to_node()
    returns zero for CPUs that have never been brought online, the
    workqueue system's view is that *all* CPUs are on node zero.

    When the unbound workqueue for a non-zero node is created, the
    tsk_cpus_allowed() for the worker threads is the empty set because
    there are, in the view of the workqueue system, no CPUs on non-zero
    nodes. The code in try_to_wake_up() using this empty cpumask ends up
    using the cpumask empty set value of NR_CPUS as an index into the
    per-CPU area pointer array, and gets garbage as it is one past the end
    of the array. This results in:

    [ 0.881970] Unable to handle kernel paging request at virtual address fffffb1008b926a4
    [ 1.970095] pgd = fffffc00094b0000
    [ 1.973530] [fffffb1008b926a4] *pgd=0000000000000000, *pud=0000000000000000, *pmd=0000000000000000
    [ 1.982610] Internal error: Oops: 96000004 [#1] SMP
    [ 1.987541] Modules linked in:
    [ 1.990631] CPU: 48 PID: 295 Comm: cpuhp/48 Tainted: G W 4.8.0-rc6-preempt-vol+ #9
    [ 1.999435] Hardware name: Cavium ThunderX CN88XX board (DT)
    [ 2.005159] task: fffffe0fe89cc300 task.stack: fffffe0fe8b8c000
    [ 2.011158] PC is at try_to_wake_up+0x194/0x34c
    [ 2.015737] LR is at try_to_wake_up+0x150/0x34c
    [ 2.020318] pc : [] lr : [] pstate: 600000c5
    [ 2.027803] sp : fffffe0fe8b8fb10
    [ 2.031149] x29: fffffe0fe8b8fb10 x28: 0000000000000000
    [ 2.036522] x27: fffffc0008c63bc8 x26: 0000000000001000
    [ 2.041896] x25: fffffc0008c63c80 x24: fffffc0008bfb200
    [ 2.047270] x23: 00000000000000c0 x22: 0000000000000004
    [ 2.052642] x21: fffffe0fe89d25bc x20: 0000000000001000
    [ 2.058014] x19: fffffe0fe89d1d00 x18: 0000000000000000
    [ 2.063386] x17: 0000000000000000 x16: 0000000000000000
    [ 2.068760] x15: 0000000000000018 x14: 0000000000000000
    [ 2.074133] x13: 0000000000000000 x12: 0000000000000000
    [ 2.079505] x11: 0000000000000000 x10: 0000000000000000
    [ 2.084879] x9 : 0000000000000000 x8 : 0000000000000000
    [ 2.090251] x7 : 0000000000000040 x6 : 0000000000000000
    [ 2.095621] x5 : ffffffffffffffff x4 : 0000000000000000
    [ 2.100991] x3 : 0000000000000000 x2 : 0000000000000000
    [ 2.106364] x1 : fffffc0008be4c24 x0 : ffffff0ffffada80
    [ 2.111737]
    [ 2.113236] Process cpuhp/48 (pid: 295, stack limit = 0xfffffe0fe8b8c020)
    [ 2.120102] Stack: (0xfffffe0fe8b8fb10 to 0xfffffe0fe8b90000)
    [ 2.125914] fb00: fffffe0fe8b8fb80 fffffc00080e7648
    .
    .
    .
    [ 2.442859] Call trace:
    [ 2.445327] Exception stack(0xfffffe0fe8b8f940 to 0xfffffe0fe8b8fa70)
    [ 2.451843] f940: fffffe0fe89d1d00 0000040000000000 fffffe0fe8b8fb10 fffffc00080e7468
    [ 2.459767] f960: fffffe0fe8b8f980 fffffc00080e4958 ffffff0ff91ab200 fffffc00080e4b64
    [ 2.467690] f980: fffffe0fe8b8f9d0 fffffc00080e515c fffffe0fe8b8fa80 0000000000000000
    [ 2.475614] f9a0: fffffe0fe8b8f9d0 fffffc00080e58e4 fffffe0fe8b8fa80 0000000000000000
    [ 2.483540] f9c0: fffffe0fe8d10000 0000000000000040 fffffe0fe8b8fa50 fffffc00080e5ac4
    [ 2.491465] f9e0: ffffff0ffffada80 fffffc0008be4c24 0000000000000000 0000000000000000
    [ 2.499387] fa00: 0000000000000000 ffffffffffffffff 0000000000000000 0000000000000040
    [ 2.507309] fa20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
    [ 2.515233] fa40: 0000000000000000 0000000000000000 0000000000000000 0000000000000018
    [ 2.523156] fa60: 0000000000000000 0000000000000000
    [ 2.528089] [] try_to_wake_up+0x194/0x34c
    [ 2.533723] [] wake_up_process+0x28/0x34
    [ 2.539275] [] create_worker+0x110/0x19c
    [ 2.544824] [] alloc_unbound_pwq+0x3cc/0x4b0
    [ 2.550724] [] wq_update_unbound_numa+0x10c/0x1e4
    [ 2.557066] [] workqueue_online_cpu+0x220/0x28c
    [ 2.563234] [] cpuhp_invoke_callback+0x6c/0x168
    [ 2.569398] [] cpuhp_up_callbacks+0x44/0xe4
    [ 2.575210] [] cpuhp_thread_fun+0x13c/0x148
    [ 2.581027] [] smpboot_thread_fn+0x19c/0x1a8
    [ 2.586929] [] kthread+0xdc/0xf0
    [ 2.591776] [] ret_from_fork+0x10/0x50
    [ 2.597147] Code: b00057e1 91304021 91005021 b8626822 (b8606821)
    [ 2.603464] ---[ end trace 58c0cd36b88802bc ]---
    [ 2.608138] Kernel panic - not syncing: Fatal exception

    Fix by moving call to numa_store_cpu_info() for all CPUs into
    smp_prepare_cpus(), which happens before wq_numa_init(). Since
    smp_store_cpu_info() now contains only a single function call,
    simplify by removing the function and out-lining its contents.

    Suggested-by: Robert Richter
    Fixes: 1a2db300348b ("arm64, numa: Add NUMA support for arm64 platforms.")
    Cc: # 4.7.x-
    Signed-off-by: David Daney
    Reviewed-by: Robert Richter
    Tested-by: Yisheng Xie
    Signed-off-by: Catalin Marinas

    David Daney
     

22 Sep, 2016

2 commits

  • Just like intel_pt, intel_bts can only handle one event at a time,
    which is the reason we introduced PERF_PMU_CAP_EXCLUSIVE in the first
    place. However, at the moment one can have as many intel_bts events
    within the same context at the same time as one pleases. Only one of
    them, however, will get scheduled and receive the actual trace data.

    Fix this by making intel_bts an "exclusive" PMU.

    Signed-off-by: Alexander Shishkin
    Acked-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Thomas Gleixner
    Cc: Vince Weaver
    Cc: vince@deater.net
    Link: http://lkml.kernel.org/r/20160920154811.3255-2-alexander.shishkin@linux.intel.com
    Signed-off-by: Ingo Molnar

    Alexander Shishkin
     
  • We cannot use the "z" constraint twice, since its a single register
    (r0). Change the one not used by movli.l/movco.l to "r".

    Reported-by: Fengguang Wu
    Tested-by: Fengguang Wu
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Rich Felker
    Cc: Thomas Gleixner
    Cc: Yoshinori Sato
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

21 Sep, 2016

2 commits

  • The page structures associated with the vDSO pages in the kernel image
    are calculated using virt_to_page(), which uses __pa() under the hood to
    find the pfn associated with the virtual address. The vDSO data pointers
    however point to kernel symbols, so __pa_symbol() should really be used
    instead.

    Since there is no equivalent to virt_to_page() which uses __pa_symbol(),
    fix init_vdso_image() to work directly with pfns, calculated with
    __phys_to_pfn(__pa_symbol(...)).

    This issue broke the Malta Enhanced Virtual Addressing (EVA)
    configuration which has a non-default implementation of __pa_symbol().
    This is because it uses a physical alias so that the kernel executes
    from KSeg0 (VA 0x80000000 -> PA 0x00000000), while RAM is provided to
    the kernel in the KUSeg range (VA 0x00000000 -> PA 0x80000000) which
    uses the same underlying RAM.

    Since there are no page structures associated with the low physical
    address region, some arbitrary kernel memory would be interpreted as a
    page structure for the vDSO pages and badness ensues.

    Fixes: ebb5e78cc634 ("MIPS: Initial implementation of a VDSO")
    Signed-off-by: James Hogan
    Cc: Leonid Yegoshin
    Cc: linux-mips@linux-mips.org
    Cc: # 4.4.x-
    Patchwork: https://patchwork.linux-mips.org/patch/14229/
    Signed-off-by: Ralf Baechle

    James Hogan
     
  • Commit 5958d19a143e checks for prefetchable m64 BARs by comparing the
    addresses instead of using resource flags. This broke SR-IOV as the m64
    check in pnv_pci_ioda_fixup_iov_resources() fails.

    The condition in pnv_pci_window_alignment() also changed to checking
    only IORESOURCE_MEM_64 instead of both IORESOURCE_MEM_64 and
    IORESOURCE_PREFETCH.

    Revert these cases to the previous behaviour, adding a new helper function
    to do so. This is named pnv_pci_is_m64_flags() to make it clear this
    function is only looking at resource flags and should not be relied on for
    non-SRIOV resources.

    Fixes: 5958d19a143e ("Fix incorrect PE reservation attempt on some 64-bit BARs")
    Reported-by: Alexey Kardashevskiy
    Signed-off-by: Russell Currey
    Tested-by: Alexey Kardashevskiy
    Signed-off-by: Michael Ellerman

    Russell Currey
     

20 Sep, 2016

6 commits

  • Pull EFI fixes from Matt Fleming:

    * Fix a boot hang on large memory machines (multiple terabyte) caused
    by type conversion errors in the x86 PAT code (Matt Fleming)

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Since commit 4d4c47412464 ("perf/x86/intel/bts: Fix BTS PMI detection")
    my box goes boom on boot:

    | .... node #0, CPUs: #1 #2 #3 #4 #5 #6 #7
    | BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
    | IP: [] intel_bts_interrupt+0x43/0x130
    | Call Trace:
    | d [] intel_pmu_handle_irq+0x51/0x4b0
    | [] perf_event_nmi_handler+0x27/0x40

    This happens because the code introduced in this commit dereferences the
    debug store pointer unconditionally. The debug store is not guaranteed to
    be available, so a NULL pointer check as on other places is required.

    Fixes: 4d4c47412464 ("perf/x86/intel/bts: Fix BTS PMI detection")
    Signed-off-by: Sebastian Andrzej Siewior
    Reviewed-by: Alexander Shishkin
    Cc: Arnaldo Carvalho de Melo
    Cc: Peter Zijlstra
    Cc: vince@deater.net
    Cc: eranian@google.com
    Link: http://lkml.kernel.org/r/20160920131220.xg5pbdjtznszuyzb@breakpoint.cc
    Signed-off-by: Thomas Gleixner

    Sebastian Andrzej Siewior
     
  • Waiman reported that booting with CONFIG_EFI_MIXED enabled on his
    multi-terabyte HP machine results in boot crashes, because the EFI
    region mapping functions loop forever while trying to map those
    regions describing RAM.

    While this patch doesn't fix the underlying hang, there's really no
    reason to map EFI_CONVENTIONAL_MEMORY regions into the EFI page tables
    when mixed-mode is not in use at runtime.

    Reported-by: Waiman Long
    Cc: Ard Biesheuvel
    Cc: Borislav Petkov
    Cc: Linus Torvalds
    CC: Theodore Ts'o
    Cc: Arnd Bergmann
    Cc: Greg Kroah-Hartman
    Cc: Scott J Norton
    Cc: Douglas Hatch
    Cc: # v4.6+
    Signed-off-by: Matt Fleming

    Matt Fleming
     
  • There's a mixture of signed 32-bit and unsigned 32-bit and 64-bit data
    types used for keeping track of how many pages have been mapped.

    This leads to hangs during boot when mapping large numbers of pages
    (multiple terabytes, as reported by Waiman) because those values are
    interpreted as being negative.

    commit 742563777e8d ("x86/mm/pat: Avoid truncation when converting
    cpa->numpages to address") fixed one of those bugs, but there is
    another lurking in __change_page_attr_set_clr().

    Additionally, the return value type for the populate_*() functions can
    return negative values when a large number of pages have been mapped,
    triggering the error paths even though no error occurred.

    Consistently use 64-bit types on 64-bit platforms when counting pages.
    Even in the signed case this gives us room for regions 8PiB
    (pebibytes) in size whilst still allowing the usual negative value
    error checking idiom.

    Reported-by: Waiman Long
    Cc: Ard Biesheuvel
    Cc: Borislav Petkov
    Cc: Linus Torvalds
    CC: Theodore Ts'o
    Cc: Arnd Bergmann
    Cc: Greg Kroah-Hartman
    Cc: Scott J Norton
    Cc: Douglas Hatch
    Signed-off-by: Matt Fleming

    Matt Fleming
     
  • Pull crypto fixes from Herbert Xu:
    "This fixes a potential weakness in IPsec CBC IV generation, as well as
    a number of issues that arose out of an OOM crash on ARM with CTR-mode
    AES"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
    crypto: arm64/aes-ctr - fix NULL dereference in tail processing
    crypto: arm/aes-ctr - fix NULL dereference in tail processing
    crypto: skcipher - Fix blkcipher walk OOM crash
    crypto: echainiv - Replace chaining with multiplication

    Linus Torvalds
     
  • Add lost Kconfig symbol. This should have been part of 40e084a506eb
    ('MIPS: Add uprobes support.').

    Fixes: 40e084a506eb ('MIPS: Add uprobes support.')
    Signed-off-by: Marcin Nowakowski
    Signed-off-by: Ralf Baechle

    Marcin Nowakowski
     

19 Sep, 2016

5 commits

  • Commit 44a7185c2ae6 ("of/platform: Add common method to populate
    default bus") added new arch_initcall of_platform_default_populate_init()
    that will override device_initcall octeon_publish_devices(). This broke
    many OCTEON boards as important devices are not getting probed anymore
    (e.g. on EdgeRouter Lite the USB mass storage/rootfs is missing).

    Fix by changing octeon_publish_devices() to arch_initcall.

    Fixes: 44a7185c2ae6 ("of/platform: Add common method to populate default bus")
    Signed-off-by: Aaro Koskinen
    Acked-by: Rob Herring
    Cc: David Daney
    Cc: Kefeng Wang
    Cc: linux-mips@linux-mips.org
    Cc: devicetree@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/14041/
    Signed-off-by: Ralf Baechle

    Aaro Koskinen
     
  • Commit 1685ddbe35cd ("MIPS: Octeon: Changes to support readq()/writeq()
    usage.") added bitwise shift operations that assume that unsigned long
    is always 64-bits. This broke the build of VDSO code, as it gets compiled
    also in "faked" 32-bit mode. Althought the failing inline functions are
    never executed in 32-bit mode, they still need to pass the compilation.
    Fix by using 64-bit types explicitly.

    The patch fixes the following build failure:

    CC arch/mips/vdso/gettimeofday-o32.o
    In file included from los/git/devel/linux/arch/mips/include/asm/io.h:32:0,
    from los/git/devel/linux/arch/mips/include/asm/page.h:194,
    from los/git/devel/linux/arch/mips/vdso/vdso.h:26,
    from los/git/devel/linux/arch/mips/vdso/gettimeofday.c:11:
    los/git/devel/linux/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h: In function '__should_swizzle_bits':
    los/git/devel/linux/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h:19:40: error: right shift count >= width of type [-Werror=shift-count-overflow]
    unsigned long did = ((unsigned long)a >> 40) & 0xff;
    ^~

    Fixes: 1685ddbe35cd ("MIPS: Octeon: Changes to support readq()/writeq() usage.")
    Signed-off-by: Aaro Koskinen
    Acked-by: David Daney
    Cc: David Daney
    Cc: Steven J. Hill
    Cc: Alex Smith
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/14039/
    Signed-off-by: Ralf Baechle

    Aaro Koskinen
     
  • cpu_has_fpu macro uses smp_processor_id() and is currently executed
    with preemption enabled, that triggers the warning at runtime.

    It is assumed throughout the kernel that if any CPU has an FPU, then all
    CPUs would have an FPU as well, so it is safe to perform the check with
    preemption enabled - change the code to use raw_ variant of the check to
    avoid the warning.

    Signed-off-by: Marcin Nowakowski
    Cc: linux-mips@linux-mips.org
    Cc: stable@vger.kernel.org # 4.0+
    Patchwork: https://patchwork.linux-mips.org/patch/14125/
    Signed-off-by: Ralf Baechle

    Marcin Nowakowski
     
  • …l/git/groeck/linux-staging

    Pull uaccess fixes from Guenter Roeck:
    "Two patches fixing problems introduced with copy_from_user changes"

    * tag 'fixes-for-linus-v4.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
    openrisc: fix the fix of copy_from_user()
    avr32: fix 'undefined reference to `___copy_from_user'

    Linus Torvalds
     
  • Pull perf fixes from Thomas Gleixner:
    "A couple of small fixes to x86 perf drivers:

    - Measure L2 for HW_CACHE* events on AMD

    - Fix the address filter handling in the intel/pt driver

    - Handle the BTS disabling at the proper place"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf/x86/amd: Make HW_CACHE_REFERENCES and HW_CACHE_MISSES measure L2
    perf/x86/intel/pt: Do validate the size of a kernel address filter
    perf/x86/intel/pt: Fix kernel address filter's offset validation
    perf/x86/intel/pt: Fix an off-by-one in address filter configuration
    perf/x86/intel: Don't disable "intel_bts" around "intel" event batching

    Linus Torvalds
     

18 Sep, 2016

3 commits

  • Since commit acb2505d0119 ("openrisc: fix copy_from_user()"),
    copy_from_user() returns the number of bytes requested, not the
    number of bytes not copied.

    Cc: Al Viro
    Fixes: acb2505d0119 ("openrisc: fix copy_from_user()")
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • avr32 builds fail with:

    arch/avr32/kernel/built-in.o: In function `arch_ptrace':
    (.text+0x650): undefined reference to `___copy_from_user'
    arch/avr32/kernel/built-in.o:(___ksymtab+___copy_from_user+0x0): undefined
    reference to `___copy_from_user'
    kernel/built-in.o: In function `proc_doulongvec_ms_jiffies_minmax':
    (.text+0x5dd8): undefined reference to `___copy_from_user'
    kernel/built-in.o: In function `proc_dointvec_minmax_sysadmin':
    sysctl.c:(.text+0x6174): undefined reference to `___copy_from_user'
    kernel/built-in.o: In function `ptrace_has_cap':
    ptrace.c:(.text+0x69c0): undefined reference to `___copy_from_user'
    kernel/built-in.o:ptrace.c:(.text+0x6b90): more undefined references to
    `___copy_from_user' follow

    Fixes: 8630c32275ba ("avr32: fix copy_from_user()")
    Cc: Al Viro
    Acked-by: Havard Skinnemoen
    Acked-by: Hans-Christian Noren Egtvedt
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • Pull powerpc fixes from Michael Ellerman:
    "Fixes for code merged this cycle:

    - Fix restore of SPRs upon wake up from hypervisor state loss from
    Gautham R Shenoy
    - Fix the state of root PE from Gavin Shan
    - Detach from PE on releasing PCI device from Gavin Shan
    - Fix size of NUM_CPU_FTR_KEYS on 32-bit
    - Fix missed TCE invalidations that should fallback to OPAL"

    * tag 'powerpc-4.8-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
    powerpc/powernv/pci: Fix missed TCE invalidations that should fallback to OPAL
    powerpc/powernv: Detach from PE on releasing PCI device
    powerpc/powernv: Fix the state of root PE
    powerpc/kernel: Fix size of NUM_CPU_FTR_KEYS on 32-bit
    powerpc/powernv: Fix restore of SPRs upon wake up from hypervisor state loss

    Linus Torvalds
     

17 Sep, 2016

2 commits

  • Pull ARM SoC fixes from Arnd Bergmann:
    "Here are a couple of bugfixes for v4.8-rc.

    Most of them have actually been around for a while this time but for
    some reason didn't get applied early on. The shmobile regulator fix
    is the only one that isn't completely obvious.

    Device tree changes:
    - archtimer interrupts must be level triggered (multiple platforms)
    - fix for USB and MMC clocks on STiH410
    - fix split DT repository in case of raspberry-pi 3
    - a new use of skeleton.dtsi on arm64 has crept in after that was
    removed.

    defconfig updates:
    - xilinx vdma has a new Kconfig symbol name
    - keystone requires CONFIG_NOP_USB_XCEIV since v4.8-rc1

    Code fixes:
    - fix regulator quirk on shmobile
    - suspend-to-ram regression on EXYNOS

    Maintainer updates:
    - Javier Martinez Canillas is now a reviewer for Samsung EXYNOS"

    * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
    ARM: keystone: defconfig: Fix USB configuration
    arm64: dts: Fix broken architected timer interrupt trigger
    ARM: multi_v7_defconfig: update XILINX_VDMA
    ARM64: dts: bcm: Use a symlink to R-Pi dtsi files from arch=arm
    ARM: dts: Remove use of skeleton.dtsi from bcm283x.dtsi
    ARM: dts: STiH407-family: Provide interconnect clock for consumption in ST SDHCI
    ARM: dts: STiH410: Handle interconnect clock required by EHCI/OHCI (USB)
    ARM: shmobile: fix regulator quirk for Gen2
    ARM: EXYNOS: Clear OF_POPULATED flag from PMU node in IRQ init callback
    MAINTAINERS: Add myself as reviewer for Samsung Exynos support

    Linus Torvalds
     
  • Pull ARM fixes from Russell King:
    "Most of this update are fixes primarily discovered from testing on the
    older StrongARM 1110 and PXA systems, as a result of recent interest
    from several people in these platforms:

    - Locomo interrupt handling incorrectly stores the handler data in
    the chip's private data slot: when Locomo is combined with an
    interrupt controller who's chip uses the chip private data, this
    leads to an oops.

    - SA1111 was missing a call to clk_disable() to clean up after a
    failed probe.

    - SA1111 and PCMCIA suspend/resume was broken:

    The PCMCIA "ds" layer was using the legacy bus suspend/resume
    methods, which the core PM code is no longer calling as a result of
    device_pm_check_callbacks() introduced in commit aa8e54b559479
    ("PM / sleep: Go direct_complete if driver has no callbacks").

    SA1111 was broken due to changes to PCMCIA which makes PCMCIA
    suspend itself later than the SA1111 code expects, and resume
    before the SA1111 code has initialised access to the pcmcia
    sub-device.

    - the default SA1111 interrupt mask polarity got messed up when it
    was converted to use a dynamic interrupt base number for its
    interrupts.

    - fix platform_get_irq() error code propagation, which was causing
    problems on platforms where the interrupt may not be available at
    probe time in DT setups.

    - fix the lack of clock to PCMCIA code on PXA platforms, which was
    omitted in conversions of PXA to CCF.

    - fix an oops in the PXA PCMCIA code caused by a previous commit not
    realising that Lubbock is different from the rest of the PXA PCMCIA
    drivers.

    - ensure that SA1111 low-level PCMCIA drivers propagate their error
    codes to the main probe function, rather than the driver silently
    accepting a failure.

    - fix the sa11xx debugfs reporting of timing information, which
    always indicated zero due to the clock being a factor of 1000 out.

    - fix the polarity of the status change signal reported from the
    sockets.

    Lastly, one ARM specific commit from Stefan Agner fixing the LPAE
    cache attributes"

    * 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm:
    ARM: pxa/lubbock: add pcmcia clock
    ARM: locomo: fix locomo irq handling
    ARM: 8612/1: LPAE: initialize cache policy correctly
    ARM: sa1111: fix missing clk_disable()
    ARM: sa1111: fix pcmcia suspend/resume
    ARM: sa1111: fix pcmcia interrupt mask polarity
    ARM: sa1111: fix error code propagation in sa1111_probe()
    pcmcia: lubbock: fix sockets configuration
    pcmcia: sa1111: fix propagation of lowlevel board init return code
    pcmcia: soc_common: fix SS_STSCHG polarity
    pcmcia: sa11xx_base: add units to the timing information
    pcmcia: sa11xx_base: fix reporting of timing information
    pcmcia: ds: fix suspend/resume

    Linus Torvalds
     

16 Sep, 2016

8 commits

  • …/krzk/linux into fixes

    Pull "ARM: exynos: Fixes for v4.8, secound round" from Krzysztof Kozłowski:

    1. A recent change in populating irqchip devices from Device Tree
    broke Suspend to RAM on Exynos boards due to lack of probing of
    PMU (Power Management Unit) driver. Multiple drivers attach to
    the PMU's DT node: irqchip, clock controller and PMU platform
    driver for handling suspend. The new irqchip code marked the
    PMU's DT node as OF_POPULATED but we need to attach to this
    node also PMU platform driver.

    2. Add Javier as additional reviewer for Exynos patches.

    * tag 'samsung-fixes-4.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux:
    ARM: EXYNOS: Clear OF_POPULATED flag from PMU node in IRQ init callback
    MAINTAINERS: Add myself as reviewer for Samsung Exynos support

    Arnd Bergmann
     
  • While the Intel PMU monitors the LLC when perf enables the
    HW_CACHE_REFERENCES and HW_CACHE_MISSES events, these events monitor
    L1 instruction cache fetches (0x0080) and instruction cache misses
    (0x0081) on the AMD PMU.

    This is extremely confusing when monitoring the same workload across
    Intel and AMD machines, since parameters like,

    $ perf stat -e cache-references,cache-misses

    measure completely different things.

    Instead, make the AMD PMU measure instruction/data cache and TLB fill
    requests to the L2 and instruction/data cache and TLB misses in the L2
    when HW_CACHE_REFERENCES and HW_CACHE_MISSES are enabled,
    respectively. That way the events measure unified caches on both
    platforms.

    Signed-off-by: Matt Fleming
    Acked-by: Peter Zijlstra
    Cc:
    Cc: Borislav Petkov
    Cc: Linus Torvalds
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1472044328-21302-1-git-send-email-matt@codeblueprint.co.uk
    Signed-off-by: Ingo Molnar

    Matt Fleming
     
  • Right now, the kernel address filters in PT are prone to integer overflow
    that may happen in adding filter's size to its offset to obtain the end
    of the range. Such an overflow would also throw a #GP in the PT event
    configuration path.

    Fix this by explicitly validating the result of this calculation.

    Reported-by: Adrian Hunter
    Signed-off-by: Alexander Shishkin
    Acked-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Thomas Gleixner
    Cc: Vince Weaver
    Cc: stable@vger.kernel.org # v4.7
    Cc: stable@vger.kernel.org#v4.7
    Cc: vince@deater.net
    Link: http://lkml.kernel.org/r/20160915151352.21306-4-alexander.shishkin@linux.intel.com
    Signed-off-by: Ingo Molnar

    Alexander Shishkin
     
  • The kernel_ip() filter is used mostly by the DS/LBR code to look at the
    branch addresses, but Intel PT also uses it to validate the address
    filter offsets for kernel addresses, for which it is not sufficient:
    supplying something in bits 64:48 that's not a sign extension of the lower
    address bits (like 0xf00d000000000000) throws a #GP.

    This patch adds address validation for the user supplied kernel filters.

    Reported-by: Adrian Hunter
    Signed-off-by: Alexander Shishkin
    Acked-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Thomas Gleixner
    Cc: Vince Weaver
    Cc: stable@vger.kernel.org # v4.7
    Cc: stable@vger.kernel.org#v4.7
    Cc: vince@deater.net
    Link: http://lkml.kernel.org/r/20160915151352.21306-3-alexander.shishkin@linux.intel.com
    Signed-off-by: Ingo Molnar

    Alexander Shishkin
     
  • PT address filter configuration requires that a range is specified by
    its first and last address, but at the moment we're obtaining the end
    of the range by adding user specified size to its start, which is off
    by one from what it actually needs to be.

    Fix this and make sure that zero-sized filters don't pass the filter
    validation.

    Reported-by: Adrian Hunter
    Signed-off-by: Alexander Shishkin
    Acked-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Thomas Gleixner
    Cc: Vince Weaver
    Cc: stable@vger.kernel.org # v4.7
    Cc: stable@vger.kernel.org#v4.7
    Cc: vince@deater.net
    Link: http://lkml.kernel.org/r/20160915151352.21306-2-alexander.shishkin@linux.intel.com
    Signed-off-by: Ingo Molnar

    Alexander Shishkin
     
  • Pull kvm fix from Paolo Bonzini:
    "One fix for an x86 regression in VM migration, mostly visible with
    Windows because it uses RTC periodic interrupts"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
    kvm: x86: correctly reset dest_map->vector when restoring LAPIC state

    Linus Torvalds
     
  • get_user_ex(x, ptr) should zero x on failure. It's not a lot of a leak
    (at most we are leaking uninitialized 64bit value off the kernel stack,
    and in a fairly constrained situation, at that), but the fix is trivial,
    so...

    Cc: stable@vger.kernel.org
    Signed-off-by: Al Viro
    [ This sat in different branch from the uaccess fixes since mid-August ]
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • When userspace sends KVM_SET_LAPIC, KVM schedules a check between
    the vCPU's IRR and ISR and the IOAPIC redirection table, in order
    to re-establish the IOAPIC's dest_map (the list of CPUs servicing
    the real-time clock interrupt with the corresponding vectors).

    However, __rtc_irq_eoi_tracking_restore_one was forgetting to
    set dest_map->vectors. Because of this, the IOAPIC did not process
    the real-time clock interrupt EOI, ioapic->rtc_status.pending_eoi
    got stuck at a non-zero value, and further RTC interrupts were
    reported to userspace as coalesced.

    Fixes: 9e4aabe2bb3454c83dac8139cf9974503ee044db
    Fixes: 4d99ba898dd0c521ca6cdfdde55c9b58aea3cb3d
    Cc: stable@vger.kernel.org
    Cc: Joerg Roedel
    Cc: David Gilbert
    Reviewed-by: Radim Krčmář
    Signed-off-by: Paolo Bonzini

    Paolo Bonzini
     

15 Sep, 2016

1 commit