01 Feb, 2017

7 commits

  • commit 63d762b88cb5510f2bfdb5112ced18cde867ae61 upstream.

    There is an off-by-one error so we don't unregister priv->pdev_mux[0].
    Also it's slightly simpler as a while loop instead of a for loop.

    Fixes: 58cbbee2391c ("x86/platform/mellanox: Introduce support for Mellanox systems platform")
    Signed-off-by: Dan Carpenter
    Acked-by: Vadim Pasternak
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • commit 2ad5d52d42810bed95100a3d912679d8864421ec upstream.

    In swab.h the "#if BITS_PER_LONG > 32" breaks compiling userspace programs if
    BITS_PER_LONG is #defined by userspace with the sizeof() compiler builtin.

    Solve this problem by using __BITS_PER_LONG instead. Since we now
    #include asm/bitsperlong.h avoid further potential userspace pollution
    by moving the #define of SHIFT_PER_LONG to bitops.h which is not
    exported to userspace.

    This patch unbreaks compiling qemu on hppa/parisc.

    Signed-off-by: Helge Deller
    Signed-off-by: Greg Kroah-Hartman

    Helge Deller
     
  • commit 9aed02feae57bf7a40cb04ea0e3017cb7a998db4 upstream.

    After emulating an unaligned access in delay slot of a branch, we
    pretend as the delay slot never happened - so return back to actual
    branch target (or next PC if branch was not taken).

    Curently we did this by handling STATUS32.DE, we also need to clear the
    BTA.T bit, which is disregarded when returning from original misaligned
    exception, but could cause weirdness if it took the interrupt return
    path (in case interrupt was acive too)

    One ARC700 customer ran into this when enabling unaligned access fixup
    for kernel mode accesses as well

    Signed-off-by: Vineet Gupta
    Signed-off-by: Greg Kroah-Hartman

    Vineet Gupta
     
  • commit 36425cd67052e3becf325fd4d3ba5691791ef7e4 upstream.

    commit 3c7c7a2fc8811bc ("ARC: Don't use "+l" inline asm constraint")
    modified the inline assembly to setup LP_COUNT register manually and NOT
    rely on gcc to do it (with the +l inline assembler contraint hint, now
    being retired in the compiler)

    However the fix was flawed as we didn't add LP_COUNT to asm clobber list,
    meaning gcc doesn't know that LP_COUNT or zero-delay-loops are in action
    in the inline asm.

    This resulted in some fun - as nested ZOL loops were being generared

    | mov lp_count,250000 ;16 # tmp235,
    | lp .L__GCC__LP14 #
    Signed-off-by: Greg Kroah-Hartman

    Vineet Gupta
     
  • commit 9dce990d2cf57b5ed4e71a9cdbd7eae4335111ff upstream.

    Ensure that if userspace supplies insufficient data to
    PTRACE_SETREGSET to fill all the registers, the thread's old
    registers are preserved.

    convert_vx_to_fp() is adapted to handle only a specified number of
    registers rather than unconditionally handling all of them: other
    callers of this function are adapted appropriately.

    Based on an initial patch by Dave Martin.

    Reported-by: Dave Martin
    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Greg Kroah-Hartman

    Martin Schwidefsky
     
  • commit 0d6da872d3e4a60f43c295386d7ff9a4cdcd57e9 upstream.

    The last pgtable rework silently disabled the CMMA unused state by
    setting a local pte variable (a parameter) instead of propagating it
    back into the caller. Fix it.

    Fixes: ebde765c0e85 ("s390/mm: uninline ptep_xxx functions from pgtable.h")
    Cc: Martin Schwidefsky
    Cc: Claudio Imbrenda
    Signed-off-by: Christian Borntraeger
    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Greg Kroah-Hartman

    Christian Borntraeger
     
  • commit fd7c99142d77dc4a851879a66715abf12a3193fb upstream.

    Ensure that if userspace supplies insufficient data to
    PTRACE_SETREGSET to fill all the registers, the thread's old
    registers are preserved.

    Signed-off-by: Dave Martin
    Signed-off-by: Chris Metcalf
    Signed-off-by: Greg Kroah-Hartman

    Dave Martin
     

26 Jan, 2017

33 commits

  • commit ae7871be189cb41184f1e05742b4a99e2c59774d upstream.

    Convert the flag swiotlb_force from an int to an enum, to prepare for
    the advent of more possible values.

    Suggested-by: Konrad Rzeszutek Wilk
    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Konrad Rzeszutek Wilk
    Signed-off-by: Greg Kroah-Hartman

    Geert Uytterhoeven
     
  • commit 524dabe1c68e0bca25ce7b108099e5d89472a101 upstream.

    Commit b67a8b29df introduced logic to skip swiotlb allocation when all memory
    is DMA accessible anyway.

    While this is a great idea, __dma_alloc still calls swiotlb code unconditionally
    to allocate memory when there is no CMA memory available. The swiotlb code is
    called to ensure that we at least try get_free_pages().

    Without initialization, swiotlb allocation code tries to access io_tlb_list
    which is NULL. That results in a stack trace like this:

    Unable to handle kernel NULL pointer dereference at virtual address 00000000
    [...]
    [] swiotlb_tbl_map_single+0xd0/0x2b0
    [] swiotlb_alloc_coherent+0x10c/0x198
    [] __dma_alloc+0x68/0x1a8
    [] drm_gem_cma_create+0x98/0x108 [drm]
    [] drm_fbdev_cma_create_with_funcs+0xbc/0x368 [drm_kms_helper]
    [] drm_fbdev_cma_create+0x2c/0x40 [drm_kms_helper]
    [] drm_fb_helper_initial_config+0x238/0x410 [drm_kms_helper]
    [] drm_fbdev_cma_init_with_funcs+0x98/0x160 [drm_kms_helper]
    [] drm_fbdev_cma_init+0x40/0x58 [drm_kms_helper]
    [] vc4_kms_load+0x90/0xf0 [vc4]
    [] vc4_drm_bind+0xec/0x168 [vc4]
    [...]

    Thankfully swiotlb code just learned how to not do allocations with the FORCE_NO
    option. This patch configures the swiotlb code to use that if we decide not to
    initialize the swiotlb framework.

    Fixes: b67a8b29df ("arm64: mm: only initialize swiotlb when necessary")
    Signed-off-by: Alexander Graf
    CC: Jisheng Zhang
    CC: Geert Uytterhoeven
    CC: Konrad Rzeszutek Wilk
    Signed-off-by: Catalin Marinas
    Signed-off-by: Greg Kroah-Hartman

    Alexander Graf
     
  • commit 1c8a946bf3754a59cba1fc373949a8114bfe5aaa upstream.

    The arm64 __page_to_voff() macro takes a parameter called 'page', and
    also refers to 'struct page'. Thus, if the value passed in is not
    called 'page', we'll refer to the wrong struct name (which might not
    exist).

    Fixes: 3fa72fe9c614 ("arm64: mm: fix __page_to_voff definition")
    Acked-by: Mark Rutland
    Suggested-by: Volodymyr Babchuk
    Signed-off-by: Oleksandr Andrushchenko
    Signed-off-by: Catalin Marinas
    Signed-off-by: Greg Kroah-Hartman

    Oleksandr Andrushchenko
     
  • commit 90f92c631b210c1e97080b53a9d863783281a932 upstream.

    The following patch was sketched by Russell in response to my
    crashes on the PB11MPCore after the patch for software-based
    priviledged no access support for ARMv8.1. See this thread:
    http://marc.info/?l=linux-arm-kernel&m=144051749807214&w=2

    I am unsure what is going on, I suspect everyone involved in
    the discussion is. I just want to repost this to get the
    discussion restarted, as I still have to apply this patch
    with every kernel iteration to get my PB11MPCore Realview
    running.

    Testing by Neil Armstrong on the Oxnas NAS has revealed that
    this bug exist also on that widely deployed hardware, so
    we are probably currently regressing all ARM11MPCore systems.

    Cc: Russell King
    Cc: Will Deacon
    Fixes: a5e090acbf54 ("ARM: software-based priviledged-no-access support")
    Tested-by: Neil Armstrong
    Signed-off-by: Linus Walleij
    Signed-off-by: Russell King
    Signed-off-by: Greg Kroah-Hartman

    Linus Walleij
     
  • commit f0e8faa7a5e894b0fc99d24be1b18685a92ea466 upstream.

    This function clearly never worked and always returns true,
    as pointed out by gcc-7:

    arch/arm/mach-ux500/pm.c: In function 'prcmu_is_cpu_in_wfi':
    arch/arm/mach-ux500/pm.c:137:212: error: ?:
    using integer constants in boolean context, the expression
    will always evaluate to 'true' [-Werror=int-in-bool-context]

    With the added braces, the condition actually makes sense.

    Fixes: 34fe6f107eab ("mfd : Check if the other db8500 core is in WFI")
    Signed-off-by: Arnd Bergmann
    Acked-by: Daniel Lezcano
    Signed-off-by: Linus Walleij
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit 1ea6af3216b092ec97129ac81bd95cf254c4b140 upstream.

    This fixes commit ab8dd3aed011 ("ARM: DTS: Add minimal Support for
    Logic PD DM3730 SOM-LV") where the Card Detect and Write Protect
    pins were improperly configured.

    Fixes: ab8dd3aed011 ("ARM: DTS: Add minimal Support for Logic PD DM3730 SOM-LV")
    Signed-off-by: Adam Ford
    Signed-off-by: Tony Lindgren
    Signed-off-by: Greg Kroah-Hartman

    Adam Ford
     
  • commit 6ab5c2b662e2dcbb964099bf7f19e9dbc9ae5a41 upstream.

    This patch fixes the following error:
    sgtl5000 0-000a: Error reading chip id -6
    imx-sgtl5000 sound: ASoC: CODEC DAI sgtl5000 not registered
    imx-sgtl5000 sound: snd_soc_register_card failed (-517)

    The problem was that the pinctrl group was linked to the sound driver
    instead of the codec node. Since the codec is probed first, the sys_mclk
    was missing and it would therefore fail to initialize.

    Fixes: b32e700256bc ("ARM: dts: imx: add Boundary Devices Nitrogen6_Max board")
    Signed-off-by: Gary Bisson
    Signed-off-by: Shawn Guo
    Signed-off-by: Greg Kroah-Hartman

    Gary Bisson
     
  • commit 3d37d41a148c32389ed360e10a9f8a7cd37ce166 upstream.

    Commit d1f3156fc8c7 ("ARM: dts: omap2: Remove skeleton.dtsi usage")
    removed the skeleton.dtsi usage since we want to get rid of it.

    But this can cause issues when booting a kernel with a boot-loader
    that doesn't create a chosen node if this isn't present in the DTB
    since the decompressor relies on a pre-existing chosen node to be
    available to insert the command line and merge other ATAGS info.

    Fixes: d1f3156fc8c7 ("ARM: dts: omap2: Remove skeleton.dtsi usage")
    Reported-by: Pali Rohar
    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Tony Lindgren
    Signed-off-by: Greg Kroah-Hartman

    Javier Martinez Canillas
     
  • commit 23ab4c6183ac0679d80888b5c4cc1d528fcc21c2 upstream.

    Commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage")
    removed the skeleton.dtsi usage since we want to get rid of it.

    But this can cause issues when booting a kernel with a boot-loader
    that doesn't create a chosen node if this isn't present in the DTB
    since the decompressor relies on a pre-existing chosen node to be
    available to insert the command line and merge other ATAGS info.

    Fixes: 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage")
    Reported-by: Pali Rohar
    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Tony Lindgren
    Signed-off-by: Greg Kroah-Hartman

    Javier Martinez Canillas
     
  • commit ce95077d0cdfcc8e40dea10a1680249831ccec77 upstream.

    Commit 75813028bbd7 ("ARM: dts: am4372: Remove skeleton.dtsi usage")
    removed the skeleton.dtsi usage since we want to get rid of it.

    But this can cause issues when booting a kernel with a boot-loader
    that doesn't create a chosen node if this isn't present in the DTB
    since the decompressor relies on a pre-existing chosen node to be
    available to insert the command line and merge other ATAGS info.

    Fixes: 75813028bbd7 ("ARM: dts: am4372: Remove skeleton.dtsi usage")
    Reported-by: Pali Rohar
    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Tony Lindgren
    Signed-off-by: Greg Kroah-Hartman

    Javier Martinez Canillas
     
  • commit c9faa84cb9c34852ad70cb175457ae21fc06f39b upstream.

    Commit 76a8548ea987 ("ARM: dts: omap5: Remove skeleton.dtsi usage")
    removed the skeleton.dtsi usage since we want to get rid of it.

    But this can cause issues when booting a kernel with a boot-loader
    that doesn't create a chosen node if this isn't present in the DTB
    since the decompressor relies on a pre-existing chosen node to be
    available to insert the command line and merge other ATAGS info.

    Fixes: 76a8548ea987 ("ARM: dts: omap5: Remove skeleton.dtsi usage")
    Reported-by: Pali Rohar
    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Tony Lindgren
    Signed-off-by: Greg Kroah-Hartman

    Javier Martinez Canillas
     
  • commit 6c565d1a63ce241a0100f5d327c48dde87b4df76 upstream.

    Commit da6269e7e3dd ("ARM: dts: omap4: Remove skeleton.dtsi usage")
    removed the skeleton.dtsi usage since we want to get rid of it.

    But this can cause issues when booting a kernel with a boot-loader
    that doesn't create a chosen node if this isn't present in the DTB
    since the decompressor relies on a pre-existing chosen node to be
    available to insert the command line and merge other ATAGS info.

    Fixes: da6269e7e3dd ("ARM: dts: omap4: Remove skeleton.dtsi usage")
    Reported-by: Pali Rohar
    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Tony Lindgren
    Signed-off-by: Greg Kroah-Hartman

    Javier Martinez Canillas
     
  • commit 1d8d6d3f2f7d553c479f24ab93767974a8c2dfad upstream.

    Commit f8bf01611c99 ("ARM: dts: am33xx: Remove skeleton.dtsi usage")
    removed the skeleton.dtsi usage since we want to get rid of it.

    But this can cause issues when booting a kernel with a boot-loader
    that doesn't create a chosen node if this isn't present in the DTB
    since the decompressor relies on a pre-existing chosen node to be
    available to insert the command line and merge other ATAGS info.

    Fixes: f8bf01611c99 ("ARM: dts: am33xx: Remove skeleton.dtsi usage")
    Reported-by: Pali Rohar
    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Tony Lindgren
    Signed-off-by: Greg Kroah-Hartman

    Javier Martinez Canillas
     
  • commit 9536fd30d41ae4f30d04762676e5f5f602e16aa8 upstream.

    Commit 76155b378c59 ("ARM: dts: dm814x: Remove skeleton.dtsi usage")
    removed the skeleton.dtsi usage since we want to get rid of it.

    But this can cause issues when booting a kernel with a boot-loader
    that doesn't create a chosen node if this isn't present in the DTB
    since the decompressor relies on a pre-existing chosen node to be
    available to insert the command line and merge other ATAGS info.

    Fixes: 76155b378c59 ("ARM: dts: dm814x: Remove skeleton.dtsi usage")
    Reported-by: Pali Rohar
    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Tony Lindgren
    Signed-off-by: Greg Kroah-Hartman

    Javier Martinez Canillas
     
  • commit 6ed80b3a232e61da6d0189bbbe2b2b9afaefe3b3 upstream.

    Commit 06bfb9c19957 ("ARM: dts: dm816x: Remove skeleton.dtsi usage")
    removed the skeleton.dtsi usage since we want to get rid of it.

    But this can cause issues when booting a kernel with a boot-loader
    that doesn't create a chosen node if this isn't present in the DTB
    since the decompressor relies on a pre-existing chosen node to be
    available to insert the command line and merge other ATAGS info.

    Fixes: 06bfb9c19957 ("ARM: dts: dm816x: Remove skeleton.dtsi usage")
    Reported-by: Pali Rohar
    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Tony Lindgren
    Signed-off-by: Greg Kroah-Hartman

    Javier Martinez Canillas
     
  • commit 7f6c857b12911ed56b2056f9d5491e16b5fc95ea upstream.

    Commit 55871eb6e2cc ("ARM: dts: dra7: Remove skeleton.dtsi usage")
    removed the skeleton.dtsi usage since we want to get rid of it.

    But this can cause issues when booting a kernel with a boot-loader
    that doesn't create a chosen node if this isn't present in the DTB
    since the decompressor relies on a pre-existing chosen node to be
    available to insert the command line and merge other ATAGS info.

    Fixes: 55871eb6e2cc ("ARM: dts: dra7: Remove skeleton.dtsi usage")
    Reported-by: Pali Rohar
    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Tony Lindgren
    Signed-off-by: Greg Kroah-Hartman

    Javier Martinez Canillas
     
  • commit ad9e202aa1ce571b1d7fed969d06f66067f8a086 upstream.

    We cannot preserve partial fields for hardware breakpoints, because
    the values written by userspace to the hardware breakpoint
    registers can't subsequently be recovered intact from the hardware.

    So, just reject attempts to write incomplete fields with -EINVAL.

    Fixes: 478fcb2cdb23 ("arm64: Debugging support")
    Signed-off-by: Dave Martin
    Acked-by: Will Deacon
    Signed-off-by: Catalin Marinas
    Signed-off-by: Greg Kroah-Hartman

    Dave Martin
     
  • commit aeb1f39d814b2e21e5e5706a48834bfd553d0059 upstream.

    This patch adds an explicit __reserved[] field to user_fpsimd_state
    to replace what was previously unnamed padding.

    This ensures that data in this region are propagated across
    assignment rather than being left possibly uninitialised at the
    destination.

    Fixes: 60ffc30d5652 ("arm64: Exception handling")
    Signed-off-by: Dave Martin
    Acked-by: Will Deacon
    Signed-off-by: Catalin Marinas
    Signed-off-by: Greg Kroah-Hartman

    Dave Martin
     
  • commit a672401c00f82e4e19704aff361d9bad18003714 upstream.

    Ensure that if userspace supplies insufficient data to
    PTRACE_SETREGSET to fill all the registers, the thread's old
    registers are preserved.

    Fixes: 5d220ff9420f ("arm64: Better native ptrace support for compat tasks")
    Signed-off-by: Dave Martin
    Acked-by: Will Deacon
    Signed-off-by: Catalin Marinas
    Signed-off-by: Greg Kroah-Hartman

    Dave Martin
     
  • commit 9dd73f72f218320c6c90da5f834996e7360dc227 upstream.

    Ensure that if userspace supplies insufficient data to
    PTRACE_SETREGSET to fill all the registers, the thread's old
    registers are preserved.

    Fixes: 766a85d7bc5d ("arm64: ptrace: add NT_ARM_SYSTEM_CALL regset")
    Signed-off-by: Dave Martin
    Acked-by: Will Deacon
    Signed-off-by: Catalin Marinas
    Signed-off-by: Greg Kroah-Hartman

    Dave Martin
     
  • commit 9a17b876b573441bfb3387ad55d98bf7184daf9d upstream.

    Ensure that if userspace supplies insufficient data to
    PTRACE_SETREGSET to fill all the registers, the thread's old
    registers are preserved.

    Fixes: 478fcb2cdb23 ("arm64: Debugging support")
    Signed-off-by: Dave Martin
    Acked-by: Will Deacon
    Signed-off-by: Catalin Marinas
    Signed-off-by: Greg Kroah-Hartman

    Dave Martin
     
  • commit 7d9e8f71b989230bc613d121ca38507d34ada849 upstream.

    Generally, taking an unexpected exception should be a fatal event, and
    bad_mode is intended to cater for this. However, it should be possible
    to contain unexpected synchronous exceptions from EL0 without bringing
    the kernel down, by sending a SIGILL to the task.

    We tried to apply this approach in commit 9955ac47f4ba1c95 ("arm64:
    don't kill the kernel on a bad esr from el0"), by sending a signal for
    any bad_mode call resulting from an EL0 exception.

    However, this also applies to other unexpected exceptions, such as
    SError and FIQ. The entry paths for these exceptions branch to bad_mode
    without configuring the link register, and have no kernel_exit. Thus, if
    we take one of these exceptions from EL0, bad_mode will eventually
    return to the original user link register value.

    This patch fixes this by introducing a new bad_el0_sync handler to cater
    for the recoverable case, and restoring bad_mode to its original state,
    whereby it calls panic() and never returns. The recoverable case
    branches to bad_el0_sync with a bl, and returns to userspace via the
    usual ret_to_user mechanism.

    Signed-off-by: Mark Rutland
    Fixes: 9955ac47f4ba1c95 ("arm64: don't kill the kernel on a bad esr from el0")
    Reported-by: Mark Salter
    Cc: Will Deacon
    Signed-off-by: Catalin Marinas
    Signed-off-by: Greg Kroah-Hartman

    Mark Rutland
     
  • commit 43849785e1079f6606a31cb7fda92d1200849728 upstream.

    Read access to the SPI flash are broken on da850-evm, i.e. the data
    read is not what is actually programmed on the flash.
    According to the datasheet for the M25P64 part present on the da850-evm,
    if the SPI frequency is higher than 20MHz then the READ command is not
    usable anymore and only the FAST_READ command can be used to read data.

    This commit specifies in the DTS that we should use FAST_READ command
    instead of the READ command.

    Tested-by: Kevin Hilman
    Signed-off-by: Fabien Parent
    [nsekhar@ti.com: subject line adjustment]
    Signed-off-by: Sekhar Nori
    Signed-off-by: Greg Kroah-Hartman

    Signed-off-by: Olof Johansson

    Fabien Parent
     
  • commit 87cb12910a2ab6ed41ae951ea4d9c1cc1120199a upstream.

    AHCI provides the register PORTS_IMPL to let the software know which port
    is supported. The register must be initialized by the bootloader. However
    in some cases u-boot doesn't properly initialize this value (if it is not
    compiled with SATA support for example or if the SATA initialization fails).
    The DTS entry "ports-implemented" can be used to override the value in
    PORTS_IMPL.

    Without this patch the SATA will not work in the following two cases:

    * if there has been a failure to initialize SATA in u-boot.

    * if ahci_platform module has been removed and re-inserted. The reason is
    that the content of PORTS_IMPL is lost after the module is removed.
    I suspect that it's because the controller is reset by the hwmod.

    Signed-off-by: Jean-Jacques Hiblot
    Acked-by: Roger Quadros
    [tony@atomide.com: updated comments with what goes wrong]
    Signed-off-by: Tony Lindgren
    Signed-off-by: Greg Kroah-Hartman

    Jean-Jacques Hiblot
     
  • commit ddc37832a1349f474c4532de381498020ed71d31 upstream.

    On APQ8060, the kernel crashes in arch_hw_breakpoint_init, taking an
    undefined instruction trap within write_wb_reg. This is because Scorpion
    CPUs erroneously appear to set DBGPRSR.SPD when WFI is issued, even if
    the core is not powered down. When DBGPRSR.SPD is set, breakpoint and
    watchpoint registers are treated as undefined.

    It's possible to trigger similar crashes later on from userspace, by
    requesting the kernel to install a breakpoint or watchpoint, as we can
    go idle at any point between the reset of the debug registers and their
    later use. This has always been the case.

    Given that this has always been broken, no-one has complained until now,
    and there is no clear workaround, disable hardware breakpoints and
    watchpoints on Scorpion to avoid these issues.

    Signed-off-by: Mark Rutland
    Reported-by: Linus Walleij
    Reviewed-by: Stephen Boyd
    Acked-by: Will Deacon
    Cc: Russell King
    Signed-off-by: Russell King
    Signed-off-by: Greg Kroah-Hartman

    Mark Rutland
     
  • commit 020eb3daaba2857b32c4cf4c82f503d6a00a67de upstream.

    commit d32932d02e18 removed the irq_retrigger callback from the IO-APIC
    chip and did not add it to the new IO-APIC-IR irq chip.

    Unfortunately the software resend fallback is not enabled on X86, so edge
    interrupts which are received during the lazy disabled state of the
    interrupt line are not retriggered and therefor lost.

    Restore the callbacks.

    [ tglx: Massaged changelog ]

    Fixes: d32932d02e18 ("x86/irq: Convert IOAPIC to use hierarchical irqdomain interfaces")
    Signed-off-by: Ruslan Ruslichenko
    Cc: xe-linux-external@cisco.com
    Link: http://lkml.kernel.org/r/1484662432-13580-1-git-send-email-rruslich@cisco.com
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Ruslan Ruslichenko
     
  • commit 178f358208ceb8b38e5cff3f815e0db4a6a70a07 upstream.

    IBM bit 31 (for the rest of us - bit 0) is a reserved field in the
    instruction definition of mtspr and mfspr. Hardware is encouraged to
    (and does) ignore it.

    As a result, if userspace executes an mtspr DSCR with the reserved bit
    set, we get a DSCR facility unavailable exception. The kernel fails to
    match against the expected value/mask, and we silently return to
    userspace to try and re-execute the same mtspr DSCR instruction. We
    loop forever until the process is killed.

    We should do something here, and it seems mirroring what hardware does
    is the better option vs killing the process. While here, relax the
    matching of mfspr PVR too.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Michael Ellerman
    Signed-off-by: Greg Kroah-Hartman

    Anton Blanchard
     
  • commit b34ca60148c53971d373643195cc5c4d5d20be78 upstream.

    Ensure that if userspace supplies insufficient data to PTRACE_SETREGSET
    to fill all the check pointed registers, the thread's old check pointed
    registers are preserved.

    Fixes: 9d3918f7c0e5 ("powerpc/ptrace: Enable support for NT_PPC_CVSX")
    Fixes: 19cbcbf75a0c ("powerpc/ptrace: Enable support for NT_PPC_CFPR")
    Signed-off-by: Dave Martin
    Signed-off-by: Michael Ellerman
    Signed-off-by: Greg Kroah-Hartman

    Dave Martin
     
  • commit 99dfe80a2a246c600440a815741fd2e74a8b4977 upstream.

    Ensure that if userspace supplies insufficient data to PTRACE_SETREGSET
    to fill all the registers, the thread's old registers are preserved.

    Fixes: c6e6771b87d4 ("powerpc: Introduce VSX thread_struct and CONFIG_VSX")
    Signed-off-by: Dave Martin
    Signed-off-by: Michael Ellerman
    Signed-off-by: Greg Kroah-Hartman

    Dave Martin
     
  • commit d89f473ff6f84872e761419f7233d6e00f99c340 upstream.

    Use 0x10012 event code for PM_BRU_CMPL event in power9 event list
    instead of current 0x40060.

    Fixes: 34922527a2bcb ('powerpc/perf: Add power9 event list macros for generic and cache events')
    Signed-off-by: Madhavan Srinivasan
    Signed-off-by: Michael Ellerman
    Signed-off-by: Greg Kroah-Hartman

    Madhavan Srinivasan
     
  • commit 9728a7c8ab2f7a1c8d5c95278d2e4f4ac1285385 upstream.

    The icp-opal call is missing the code from icp-native to recover
    interrupts snatched by KVM. Without that, when running KVM, we can
    get into a situation where an interrupt is lost and the CPU stuck
    with an elevated CPPR.

    Also harden replay by always checking the return from opal_int_eoi().

    Fixes: d74361881f0d ("powerpc/xics: Add ICP OPAL backend")
    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Michael Ellerman
    Signed-off-by: Greg Kroah-Hartman

    Benjamin Herrenschmidt
     
  • commit 04478197416e3a302e9ebc917ba1aa884ef9bfab upstream.

    kvm_s390_get_machine() populates the facility bitmap by copying bytes
    from the host results that are stored in a 256 byte array in the prefix
    page. The KVM code does use the size of the target buffer (2k), thus
    copying and exposing unrelated kernel memory (mostly machine check
    related logout data).

    Let's use the size of the source buffer instead. This is ok, as the
    target buffer will always be greater or equal than the source buffer as
    the KVM internal buffers (and thus S390_ARCH_FAC_LIST_SIZE_BYTE) cover
    the maximum possible size that is allowed by STFLE, which is 256
    doublewords. All structures are zero allocated so we can leave bytes
    256-2047 unchanged.

    Add a similar fix for kvm_arch_init_vm().

    Reported-by: Heiko Carstens
    [found with smatch]
    Signed-off-by: Christian Borntraeger
    Acked-by: Cornelia Huck
    Signed-off-by: Greg Kroah-Hartman

    Christian Borntraeger
     
  • commit eb1357d942e5d96de6b4c20a8ffa55acf96233a2 upstream.

    commit d65283f7b695b5 added mod->arch.secstr under
    CONFIG_ARC_DW2_UNWIND, but used it unconditionally which broke builds
    when the option was disabled. Fix that by adjusting the #ifdef guard.

    And while at it add a missing guard (for unwinder) in module.c as well

    Reported-by: Waldemar Brodkorb
    Fixes: d65283f7b695b5 ("ARC: module: elide loop to save reference to .eh_frame")
    Tested-by: Anton Kolesov
    Reviewed-by: Alexey Brodkin
    [abrodkin: provided fixlet to Kconfig per failure in allnoconfig build]
    Signed-off-by: Vineet Gupta
    Signed-off-by: Greg Kroah-Hartman

    Vineet Gupta