14 Dec, 2015

1 commit


13 Dec, 2015

7 commits

  • Pull ARM SoC fixes from Arnd Bergmann:
    "Here are a bunch of small bug fixes for various ARM platforms, nothing
    really sticks out this week, most of either fixes bugs in code that
    was just added in 4.4, or that has been broken for many years without
    anyone noticing.

    at91/sama5d2:
    - fix sama5de hardware setup of sd/mmc interface
    - proper selection of pinctrl drivers. PIO4 is necessary for sama5d2

    berlin:
    - fix incorrect clock input for SDIO

    exynos:
    - Fix potential NULL pointer dereference in Exynos PMU driver.

    imx:
    - Fix vf610 SAI clock configuration bug which is discovered by the
    newly added master mode support in SAI audio driver.
    - Fix buggy L2 cache latency values in vf610 device trees, which may
    cause system hang when cpu runs at a higher frequency.

    ixp4xx:
    - fix prototypes for readl/writel functions

    ls2080a:
    - use little-endian register access for GPIO and SDHCI

    omap:
    - Fix clock source for ARM TWD and global timers on am437x
    - Always select REGULATOR_FIXED_VOLTAGE for omap2+ instead of when
    MACH_OMAP3_PANDORA is selected
    - Fix SPI DMA handles for dm816x as only some were mapped
    - Fix up mbox cells for dm816x to make mailbox usable

    pxa:
    - use PWM lookup table for all ezx machines

    s3c24xx:
    - Remove incorrect __init annotation from s3c24xx cpufreq driver
    structures.

    versatile:
    - fix PCI IRQ mapping on Versatile PB"

    * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
    ls2080a/dts: Add little endian property for GPIO IP block
    dt-bindings: define little-endian property for QorIQ GPIO
    ARM64: dts: ls2080a: fix eSDHC endianness
    ARM: dts: vf610: use reset values for L2 cache latencies
    ARM: pxa: use PWM lookup table for all machines
    ARM: dts: berlin: add 2nd clock for BG2Q sdhci0 and sdhci1
    ARM: dts: berlin: correct BG2Q's sdhci2 2nd clock
    ARM: dts: am4372: fix clock source for arm twd and global timers
    ARM: at91: fix pinctrl driver selection
    ARM: at91/dt: add always-on to 1.8V regulator
    ARM: dts: vf610: fix clock definition for SAI2
    ARM: imx: clk-vf610: fix SAI clock tree
    ARM: ixp4xx: fix read{b,w,l} return types
    irqchip/versatile-fpga: Fix PCI IRQ mapping on Versatile PB
    ARM: OMAP2+: enable REGULATOR_FIXED_VOLTAGE
    ARM: dts: add dm816x missing spi DT dma handles
    ARM: dts: add dm816x missing #mbox-cells
    cpufreq: s3c24xx: Do not mark s3c2410_plls_add as __init
    ARM: EXYNOS: Fix potential NULL pointer access in exynos_sys_powerdown_conf

    Linus Torvalds
     
  • Pull powerpc fixes from Michael Ellerman:
    - opal-irqchip: Fix double endian conversion from Alistair Popple
    - cxl: Set endianess of kernel contexts from Frederic Barrat
    - sbc8641: drop bogus PHY IRQ entries from DTS file from Paul Gortmaker
    - Revert "powerpc/eeh: Don't unfreeze PHB PE after reset" from Andrew
    Donnellan

    * tag 'powerpc-4.4-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
    Revert "powerpc/eeh: Don't unfreeze PHB PE after reset"
    powerpc/sbc8641: drop bogus PHY IRQ entries from DTS file
    cxl: Set endianess of kernel contexts
    powerpc/opal-irqchip: Fix double endian conversion

    Linus Torvalds
     
  • Merge misc fixes from Andrew Morton:
    "17 fixes"

    * emailed patches from Andrew Morton :
    MIPS: fix DMA contiguous allocation
    sh64: fix __NR_fgetxattr
    ocfs2: fix SGID not inherited issue
    mm/oom_kill.c: avoid attempting to kill init sharing same memory
    drivers/base/memory.c: prohibit offlining of memory blocks with missing sections
    tmpfs: fix shmem_evict_inode() warnings on i_blocks
    mm/hugetlb.c: fix resv map memory leak for placeholder entries
    mm: hugetlb: call huge_pte_alloc() only if ptep is null
    kernel: remove stop_machine() Kconfig dependency
    mm: kmemleak: mark kmemleak_init prototype as __init
    mm: fix kerneldoc on mem_cgroup_replace_page
    osd fs: __r4w_get_page rely on PageUptodate for uptodate
    MAINTAINERS: make Vladimir co-maintainer of the memory controller
    mm, vmstat: allow WQ concurrency to discover memory reclaim doesn't make any progress
    mm: fix swapped Movable and Reclaimable in /proc/pagetypeinfo
    memcg: fix memory.high target
    mm: hugetlb: fix hugepage memory leak caused by wrong reserve count

    Linus Torvalds
     
  • Pull parisc fixes from Helge Deller:
    "Fix the boot crash on Mako machines with Huge Pages, prevent a panic
    with SATA controllers (and others) by correctly calculating the IOMMU
    space, hook up the mlock2 syscall and drop unneeded code in the parisc
    pci code"

    * 'parisc-4.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
    parisc: Disable huge pages on Mako machines
    parisc: Wire up mlock2 syscall
    parisc: Remove unused pcibios_init_bus()
    parisc iommu: fix panic due to trying to allocate too large region

    Linus Torvalds
     
  • Pull arm64 fixes from Catalin Marinas:

    - Update the linker script to use L1_CACHE_BYTES instead of hard-coded
    64. We recently changed L1_CACHE_BYTES to 128

    - Improve race condition reporting on set_pte_at() and change the BUG
    to WARN_ONCE. With hardware update of the accessed/dirty state, we
    need to ensure that set_pte_at() does not inadvertently override
    hardware updated state. The patch also makes the checks ignore
    !pte_valid() new entries

    * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
    arm64: Improve error reporting on set_pte_at() checks
    arm64: update linker script to increased L1_CACHE_BYTES value

    Linus Torvalds
     
  • Recent changes to how GFP_ATOMIC is defined seems to have broken the
    condition to use mips_alloc_from_contiguous() in
    mips_dma_alloc_coherent().

    I couldn't bottom out the exact change but I think it's this commit
    d0164adc89f6 ("mm, page_alloc: distinguish between being unable to
    sleep, unwilling to sleep and avoiding waking kswapd").

    GFP_ATOMIC has multiple bits set and the check for !(gfp & GFP_ATOMIC)
    isn't enough.

    The reason behind this condition is to check whether we can potentially
    do a sleeping memory allocation. Use gfpflags_allow_blocking() instead
    which should be more robust.

    Signed-off-by: Qais Yousef
    Acked-by: Mel Gorman
    Cc: Ralf Baechle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Qais Yousef
     
  • According to arch/sh/kernel/syscalls_64.S and common sense, __NR_fgetxattr
    has to be defined to 259, but it doesn't. Instead, it's defined to 269,
    which is of course used by another syscall, __NR_sched_setaffinity in this
    case.

    This bug was found by strace test suite.

    Signed-off-by: Dmitry V. Levin
    Acked-by: Geert Uytterhoeven
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitry V. Levin
     

12 Dec, 2015

6 commits


11 Dec, 2015

10 commits

  • Currently the BUG_ON() checks do not give enough information about the
    PTEs being set. This patch changes BUG_ON to WARN_ONCE and dumps the
    values of the old and new PTEs. In addition, the checks are only made if
    the new PTE entry is valid.

    Signed-off-by: Catalin Marinas
    Reported-by: Ming Lei
    Cc: Will Deacon

    Catalin Marinas
     
  • Linux on Vybrid used several different L2 latencies so far, none
    of them seem to be the right ones. According to the application note
    AN4947 ("Understanding Vybrid Architecture"), the tag portion runs
    on CPU clock and is inside the L2 cache controller, whereas the data
    portion is stored in the external SRAM running on platform clock.
    Hence it is likely that the correct value requires a higher data
    latency then tag latency.

    These are the values which have been used so far:
    - The mainline values:
    arm,data-latency = ;
    arm,tag-latency = ;
    Those values have lead to problems on higher clocks. They look
    like a poor translation from the reset values (missing +1 offset
    and a mix up between tag/latency values).
    - The Linux 3.0 (SoC vendor BSP) values (converted to DT notation):
    arm,data-latency =
    arm,tag-latency =
    The cache initialization function along with the value matches the
    i.MX6 code from the same kernel, so it seems that those values have
    just been copied.
    - The Colibri values:
    arm,data-latency = ;
    arm,tag-latency = ;
    Those were a mix between the values of the Linux 3.0 based BSP and
    the mainline values above.
    - The SoC Reset values (converted to DT notation):
    arm,data-latency = ;
    arm,tag-latency = ;

    So far there is no official statement on what the correct values are.
    See also the related Freescale community thread:
    https://community.freescale.com/message/579785#579785

    For now, the reset values seem to be the best bet. Remove all other
    "bogus" values and use the reset value on vf610.dtsi level.

    Signed-off-by: Stefan Agner
    Cc:
    Signed-off-by: Shawn Guo

    Stefan Agner
     
  • …/git/tmlind/linux-omap into fixes

    Merge "omap fixes against v4.4-rc4" from Tony Lindgren

    Few fixes for omaps for v4.4-rc cycle:

    - Fix clock source for ARM TWD and global timers on am437x

    - Always select REGULATOR_FIXED_VOLTAGE for omap2+ instead of
    when MACH_OMAP3_PANDORA is selected

    - Fix SPI DMA handles for dm816x as only some were mapped

    - Fix up mbox cells for dm816x to make mailbox usable

    * tag 'omap-for-v4.4/fixes-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
    ARM: dts: am4372: fix clock source for arm twd and global timers
    ARM: OMAP2+: enable REGULATOR_FIXED_VOLTAGE
    ARM: dts: add dm816x missing spi DT dma handles
    ARM: dts: add dm816x missing #mbox-cells

    Arnd Bergmann
     
  • The recent change to use a pwm lookup table for the ezx machines
    was incomplete and only changed the a780 model, but not the
    other ones in the same file.

    This adds the missing calls to pwm_add_table().

    Signed-off-by: Arnd Bergmann
    Fixes: c3322022897c ("ARM: pxa: ezx: Use PWM lookup table")
    Acked-by: Thierry Reding
    Acked-by: Robert Jarzmik

    Arnd Bergmann
     
  • …/linux-berlin into fixes

    Merge "Marvell Berlin fixes for 4.4-rc1 (round 1)" from Sebastian Hesselbarth:

    - fix wrong SDIO DT clocks on BG2Q

    * tag 'berlin-fixes-for-4.4-rc1-1' of git://git.infradead.org/users/hesselba/linux-berlin:
    ARM: dts: berlin: add 2nd clock for BG2Q sdhci0 and sdhci1
    ARM: dts: berlin: correct BG2Q's sdhci2 2nd clock

    Arnd Bergmann
     
  • …elloni/linux into fixes

    Merge "Second fixes for 4.4" from Alexandre Belloni:

    - fix of a hardware setup that prevents the sd/mmc interface to show up on
    sama5d2.
    - proper selection of pinctrl drivers. PIO4 is necessary for the sama5d2 to
    boot.

    * tag 'at91-4.4-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux:
    ARM: at91: fix pinctrl driver selection
    ARM: at91/dt: add always-on to 1.8V regulator

    Arnd Bergmann
     
  • …/krzk/linux into fixes

    Merge "Fixes for Exynos" from Krzysztof Kozlowski:

    1. Fix potential NULL pointer dereference in Exynos PMU driver.
    2. Remove incorrect __init annotation from s3c24xx cpufreq driver
    structures.

    * tag 'samsung-fixes-4.4' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux:
    cpufreq: s3c24xx: Do not mark s3c2410_plls_add as __init
    ARM: EXYNOS: Fix potential NULL pointer access in exynos_sys_powerdown_conf

    Arnd Bergmann
     
  • We removed CLK_IGNORE_UNUSED from CLKID_SDIO's flag, so the sdhci0 and
    sdhci1 don't work. We fix this by adding the optional 2nd clock for
    BG2Q's sdhci0 and sdhci1. This patch brings another benefit: the 2nd
    clock can be disabled during runtime pm, so saves power a bit.

    Signed-off-by: Jisheng Zhang
    Signed-off-by: Sebastian Hesselbarth

    Jisheng Zhang
     
  • The optional 2nd clock is CLKID_SDIO. We removed CLK_IGNORE_UNUSED
    from CLKID_SDIO's flag, so the sdhci2 doesn't work. This patch fixes
    this issue by correcting the sdhci2's 2nd clock.

    Signed-off-by: Jisheng Zhang
    Signed-off-by: Sebastian Hesselbarth

    Jisheng Zhang
     
  • Both the 32bit and 64bit versions of the GICv3 header file are using
    barriers, but neglect to include barrier.h, leading to an interesting
    splat in some circumstances.

    Signed-off-by: Marc Zyngier
    Cc:
    Cc: Jason Cooper
    Link: http://lkml.kernel.org/r/1449483072-17694-3-git-send-email-marc.zyngier@arm.com
    Signed-off-by: Thomas Gleixner

    Marc Zyngier
     

10 Dec, 2015

1 commit

  • ARM TWD and Global timer are clocked by PERIPHCLK which is MPU_CLK/2.
    But now they are clocked by dpll_mpu_m2_ck == MPU_CLK and, as result.
    Timekeeping core misbehaves. For example, execution of command
    "sleep 5" will take 10 sec instead of 5.

    Hence, fix it by adding mpu_periphclk ("fixed-factor-clock") and use
    it for clocking ARM TWD and Global timer (same way as on OMAP4).

    Cc: Tony Lindgren
    Cc: Felipe Balbi
    Cc: Tero Kristo
    Fixes:commit 8cbd4c2f6a99 ("arm: boot: dts: am4372: add ARM timers and SCU nodes")
    Signed-off-by: Grygorii Strashko
    Reviewed-by: Felipe Balbi
    Signed-off-by: Tony Lindgren

    Grygorii Strashko
     

09 Dec, 2015

8 commits

  • This reverts commit 527d10ef3a315d3cb9dc098dacd61889a6c26439.

    The reverted commit breaks cxlflash devices following an EEH reset (and
    possibly other cxl devices, however this has not been tested).

    The reverted commit changed the behaviour of eeh_reset_device() so that PHB
    PEs are not unfrozen following the completion of the reset. This should not
    be problematic, as no device resources should have been associated with the
    PHB PE.

    However, when attempting to load the cxlflash driver after a reset, the
    driver attempts to read Vital Product Data through a call to
    pci_read_vpd() (which is called on the physical cxl device, not on the
    virtual AFU device). pci_read_vpd() in turn attempts to read from the cxl
    device's config space. This fails, as the PE it's trying to read from is
    still frozen. In turn, the driver gets an -ENODEV and fails to initialise.

    It appears this issue only affects some parts of the VPD area, as "lspci
    -vvv", which only reads a subset of the VPD bytes, is not broken by the
    original patch.

    At this stage, we don't fully understand why we're trying to read a frozen
    PE, and we don't know how this affects other cxl devices. It is possible
    that there is an underlying bug in the cxl driver or the powerpc CAPI
    support code, or alternatively a bug in the PCI resource allocation/mapping
    code that is incorrectly mapping resources to PE#0.

    As such, this fix is incomplete, however it is necessary to prevent a
    serious regression in CAPI support.

    In the meantime, revert the commit, especially as it was intended to be a
    non-functional change.

    Cc: Gavin Shan
    Cc: Ian Munsie
    Cc: Daniel Axtens
    Signed-off-by: Andrew Donnellan
    Signed-off-by: Michael Ellerman

    Andrew Donnellan
     
  • This file was originally cloned off of the MPC8641D-HPCN reference
    platform, which actually had a PHY IRQ line connected. However this
    board does not. The bogus entry was largely inert and went undetected
    until commit 321beec5047af83db90c88114b7e664b156f49fe ("net: phy: Use
    interrupts when available in NOLINK state") was added to the tree.

    With the above commit, the board fails to NFS boot since it sits waiting
    for a PHY IRQ event that of course never arrives. Removing the bogus
    entries from the DTS file fixes the issue.

    Cc: Andrew Lunn
    Signed-off-by: Paul Gortmaker
    Signed-off-by: Michael Ellerman

    Paul Gortmaker
     
  • Pull uml fixes from Richard Weinberger:
    "This contains various bug fixes, most of them are fall out from the
    merge window"

    * 'for-linus-4.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
    um: fix returns without va_end
    um: Fix fpstate handling
    arch: um: fix error when linking vmlinux.
    um: Fix get_signal() usage

    Linus Torvalds
     
  • When using va_list ensure that va_start will be followed by va_end.

    Signed-off-by: Geyslan G. Bem
    Signed-off-by: Richard Weinberger

    Geyslan G. Bem
     
  • The x86 FPU cleanup changed fpstate to a plain integer.
    UML on x86 has to deal with that too.

    Signed-off-by: Richard Weinberger

    Richard Weinberger
     
  • On gcc Ubuntu 4.8.4-2ubuntu1~14.04, linking vmlinux fails with:

    arch/um/os-Linux/built-in.o: In function `os_timer_create':
    /android/kernel/android/arch/um/os-Linux/time.c:51: undefined reference to `timer_create'
    arch/um/os-Linux/built-in.o: In function `os_timer_set_interval':
    /android/kernel/android/arch/um/os-Linux/time.c:84: undefined reference to `timer_settime'
    arch/um/os-Linux/built-in.o: In function `os_timer_remain':
    /android/kernel/android/arch/um/os-Linux/time.c:109: undefined reference to `timer_gettime'
    arch/um/os-Linux/built-in.o: In function `os_timer_one_shot':
    /android/kernel/android/arch/um/os-Linux/time.c:132: undefined reference to `timer_settime'
    arch/um/os-Linux/built-in.o: In function `os_timer_disable':
    /android/kernel/android/arch/um/os-Linux/time.c:145: undefined reference to `timer_settime'

    This is because -lrt appears in the generated link commandline
    after arch/um/os-Linux/built-in.o. Fix this by removing -lrt from
    arch/um/Makefile and adding it to the UM-specific section of
    scripts/link-vmlinux.sh.

    Signed-off-by: Lorenzo Colitti
    Signed-off-by: Richard Weinberger

    Lorenzo Colitti
     
  • If get_signal() returns us a signal to post
    we must not call it again, otherwise the already
    posted signal will be overridden.
    Before commit a610d6e672d this was the case as we stopped
    the while after a successful handle_signal().

    Cc: # 3.10-
    Fixes: a610d6e672d ("pull clearing RESTORE_SIGMASK into block_sigmask()")
    Signed-off-by: Richard Weinberger

    Richard Weinberger
     
  • Pull perf fixes from Ingo Molnar:
    "This tree includes four core perf fixes for misc bugs, three fixes to
    x86 PMU drivers, and two updates to old email addresses"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf: Do not send exit event twice
    perf/x86/intel: Fix INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_NA macro
    perf/x86/intel: Make L1D_PEND_MISS.FB_FULL not constrained on Haswell
    perf: Fix PERF_EVENT_IOC_PERIOD deadlock
    treewide: Remove old email address
    perf/x86: Fix LBR call stack save/restore
    perf: Update email address in MAINTAINERS
    perf/core: Robustify the perf_cgroup_from_task() RCU checks
    perf/core: Fix RCU problem with cgroup context switching code

    Linus Torvalds
     

08 Dec, 2015

2 commits

  • The OPAL event calls return a mask of events that are active in big
    endian format. This is checked when unmasking the events in the
    irqchip by comparison with a cached value. The cached value was stored
    in big endian format but should've been converted to CPU endian
    first.

    This bug leads to OPAL event delivery being delayed or dropped on some
    systems. Symptoms may include a non-functional console.

    The bug is fixed by calling opal_handle_events(...) instead of
    duplicating code in opal_event_unmask(...).

    Fixes: 9f0fd0499d30 ("powerpc/powernv: Add a virtual irqchip for opal events")
    Cc: stable@vger.kernel.org # v4.2+
    Reported-by: Douglas L Lehr
    Signed-off-by: Alistair Popple
    Signed-off-by: Michael Ellerman

    Alistair Popple
     
  • Bring the linker script in line with the recent increase of
    L1_CACHE_BYTES to 128. Replace the hardcoded value of 64 with the
    symbolic constant.

    Signed-off-by: Ard Biesheuvel
    Acked-by: Mark Rutland
    [catalin.marinas@arm.com: fix up RW_DATA_SECTION as well]
    Signed-off-by: Catalin Marinas

    Ard Biesheuvel
     

07 Dec, 2015

1 commit

  • Pull x86 fixes from Thoma Gleixner:
    "Another round of fixes for x86:

    - Move the initialization of the microcode driver to late_initcall to
    make sure everything that init function needs is available.

    - Make sure that lockdep knows about interrupts being off in the
    entry code before calling into c-code.

    - Undo the cpu hotplug init delay regression.

    - Use the proper conditionals in the mpx instruction decoder.

    - Fixup restart_syscall for x32 tasks.

    - Fix the hugepage regression on PAE kernels which was introduced
    with the latest PAT changes"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/signal: Fix restart_syscall number for x32 tasks
    x86/mpx: Fix instruction decoder condition
    x86/mm: Fix regression with huge pages on PAE
    x86 smpboot: Re-enable init_udelay=0 by default on modern CPUs
    x86/entry/64: Fix irqflag tracing wrt context tracking
    x86/microcode: Initialize the driver late when facilities are up

    Linus Torvalds
     

06 Dec, 2015

4 commits

  • We need to add rest of the flags to the constraint mask
    instead of another INTEL_ARCH_EVENT_MASK, fixing a typo.

    Signed-off-by: Jiri Olsa
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Cc: Linus Torvalds
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Thomas Gleixner
    Cc: Vince Weaver
    Link: http://lkml.kernel.org/r/1447061071-28085-1-git-send-email-jolsa@kernel.org
    Signed-off-by: Ingo Molnar

    Jiri Olsa
     
  • There was a mistake in the Haswell constraints table.

    Signed-off-by: Yuanfang Chen
    Signed-off-by: Peter Zijlstra (Intel)
    Reviewed-by: Andi Kleen
    Cc: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Thomas Gleixner
    Cc: Vince Weaver
    Link: http://lkml.kernel.org/r/1448384701-9110-1-git-send-email-cheny@udel.edu
    Signed-off-by: Ingo Molnar

    Yuanfang Chen
     
  • When restarting a syscall with regs->ax == -ERESTART_RESTARTBLOCK,
    regs->ax is assigned to a restart_syscall number. For x32 tasks, this
    syscall number must have __X32_SYSCALL_BIT set, otherwise it will be
    an x86_64 syscall number instead of a valid x32 syscall number. This
    issue has been there since the introduction of x32.

    Reported-by: strace/tests/restart_syscall.test
    Reported-and-tested-by: Elvira Khabirova
    Signed-off-by: Dmitry V. Levin
    Cc: Elvira Khabirova
    Cc: stable@vger.kernel.org
    Link: http://lkml.kernel.org/r/20151130215436.GA25996@altlinux.org
    Signed-off-by: Thomas Gleixner

    Dmitry V. Levin
     
  • MPX decodes instructions in order to tell which bounds register
    was violated. Part of this decoding involves looking at the "REX
    prefix" which is a special instrucion prefix used to retrofit
    support for new registers in to old instructions.

    The X86_REX_*() macros are defined to return actual bit values:

    #define X86_REX_R(rex) ((rex) & 4)

    *not* boolean values. However, the MPX code was checking for
    them like they were booleans. This might have led to us
    mis-decoding the "REX prefix" and giving false information out to
    userspace about bounds violations. X86_REX_B() actually is bit 1,
    so this is really only broken for the X86_REX_X() case.

    Fix the conditionals up to tolerate the non-boolean values.

    Fixes: fcc7ffd67991 "x86, mpx: Decode MPX instruction to get bound violation information"
    Reported-by: Dan Carpenter
    Signed-off-by: Dave Hansen
    Cc: x86@kernel.org
    Cc: Dave Hansen
    Cc: stable@vger.kernel.org
    Link: http://lkml.kernel.org/r/20151201003113.D800C1E0@viggo.jf.intel.com
    Signed-off-by: Thomas Gleixner

    Dave Hansen