1. 31 Oct, 2014 2 commits
    • Rafael J. Wysocki's avatar
      Merge branches 'pm-cpufreq' and 'pm-sleep' · 7d627280
      Rafael J. Wysocki authored
      * pm-cpufreq:
        cpufreq: cpufreq-dt: Restore default cpumask_setall(policy->cpus)
        cpufreq: cpufreq-dt: disable unsupported OPPs
      
      * pm-sleep:
        PM / Sleep: fix recovery during resuming from hibernation
        PM / Sleep: fix async suspend_late/freeze_late error handling
      7d627280
    • Rafael J. Wysocki's avatar
      Merge branches 'acpi-scan' and 'acpi-ec' · 76dfdc2c
      Rafael J. Wysocki authored
      * acpi-scan:
        ACPI: Use ACPI companion to match only the first physical device
      
      * acpi-ec:
        ACPI / EC: Fix regression due to conflicting firmware behavior between Samsung and Acer.
        Revert "ACPI / EC: Add support to disallow QR_EC to be issued before completing previous QR_EC"
      76dfdc2c
  2. 29 Oct, 2014 2 commits
    • Lv Zheng's avatar
      ACPI / EC: Fix regression due to conflicting firmware behavior between Samsung and Acer. · 79149001
      Lv Zheng authored
      It is reported that Samsung laptops that need to poll events are broken by
      the following commit:
       Commit 3afcf2ec
       Subject: ACPI / EC: Add support to disallow QR_EC to be issued when SCI_EVT isn't set
      
      The behaviors of the 2 vendor firmwares are conflict:
       1. Acer: OSPM shouldn't issue QR_EC unless SCI_EVT is set, firmware
               automatically sets SCI_EVT as long as there is event queued up.
       2. Samsung: OSPM should issue QR_EC whatever SCI_EVT is set, firmware
                  returns 0 when there is no event queued up.
      
      This patch is a quick fix to distinguish the behaviors to make Acer
      behavior only effective for Acer EC firmware so that the breakages on
      Samsung EC firmware can be avoided.
      
      Fixes: 3afcf2ec (ACPI / EC: Add support to disallow QR_EC to be issued ...)
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=44161Reported-and-tested-by: default avatarOrtwin Glück <odi@odi.ch>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Cc: 3.17+ <stable@vger.kernel.org> # 3.17+
      [ rjw : Subject ]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      79149001
    • Lv Zheng's avatar
      Revert "ACPI / EC: Add support to disallow QR_EC to be issued before completing previous QR_EC" · df9ff918
      Lv Zheng authored
      It is reported that the following commit breaks Samsung hardware:
       Commit: 558e4736.
       Subject: ACPI / EC: Add support to disallow QR_EC to be issued before
                completing previous QR_EC
      
      Which means the Samsung behavior conflicts with the Acer behavior.
      
      1. Samsung may behave like:
         [ +event 1 ] SCI_EVT set
         [ +event 2 ] SCI_EVT set
                                    write QR_EC
                                    read event
         [ -event 1 ] SCI_EVT clear
         Without the above commit, Samsung can work:
         [ +event 1 ] SCI_EVT set
         [ +event 2 ] SCI_EVT set
                                    write QR_EC
                                    CAN prepare next QR_EC as SCI_EVT=1
                                    read event
         [ -event 1 ] SCI_EVT clear
                                    write QR_EC
                                    read event
         [ -event 2 ] SCI_EVT clear
         With the above commit, Samsung cannot work:
         [ +event 1 ] SCI_EVT set
         [ +event 2 ] SCI_EVT set
                                    write QR_EC
                                    read event
         [ -event 1 ] SCI_EVT clear
                                    CANNOT prepare next QR_EC as SCI_EVT=0
      2. Acer may behave like:
         [ +event 1 ] SCI_EVT set
         [ +event 2 ]
                                    write QR_EC
                                    read event
         [ -event 1 ] SCI_EVT clear
         [ +event 2 ] SCI_EVT set
         Without the above commit, Acer cannot work when there is only 1 event:
         [ +event 1 ] SCI_EVT set
                                    write QR_EC
                                    can prepared next QR_EC as SCI_EVT=1
                                    read event
         [ -event 1 ] SCI_EVT clear
                                    CANNOT write QR_EC as SCI_EVT=0
         With the above commit, Acer can work:
         [ +event 1 ] SCI_EVT set
         [ +event 2 ]
                                    write QR_EC
                                    read event
         [ -event 1 ] SCI_EVT set
                                    can prepare next QR_EC because SCI_EVT=0
                                    CAN write QR_EC as SCI_EVT=1
      
      Since Acer can also work with only the following commit applied:
       Commit: 3afcf2ec
       Subject: ACPI / EC: Add support to disallow QR_EC to be issued when
                SCI_EVT isn't set
      commit 558e4736 can be reverted.
      
      Fixes: 558e4736 (ACPI / EC: Add support to disallow QR_EC to be issued ...)
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=44161Reported-and-tested-by: default avatarOrtwin Glück <odi@odi.ch>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Cc: 3.17+ <stable@vger.kernel.org> # 3.17+
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      df9ff918
  3. 27 Oct, 2014 5 commits
    • Geert Uytterhoeven's avatar
      cpufreq: cpufreq-dt: Restore default cpumask_setall(policy->cpus) · c81407fe
      Geert Uytterhoeven authored
      Commit 34e5a527 ("cpufreq: cpufreq-dt: extend with
      platform_data") changed cpufreq_init() to only call
      cpumask_setall(policy->cpus) if the platform data indicates that all
      CPUs share the same clock. Before, cpufreq_generic_init() did this
      unconditionally.
      
      This causes a crash on r8a7791/koelsch when resuming from s2ram:
      
          Enabling non-boot CPUs ...
          CPU1: Booted secondary processor
          Unable to handle kernel NULL pointer dereference at virtual address 0000003c
          pgd = ee71f980
          [0000003c] *pgd=6eeb6003, *pmd=6e0e9003, *pte=00000000
          Internal error: Oops: a07 [#1] SMP ARM
          Modules linked in:
          CPU: 0 PID: 1397 Comm: s2ram Tainted: G        W      3.18.0-rc2-koelsch-00762-g7eed2a4e61d2d978 #581
          task: ee6b76c0 ti: ee7f0000 task.ti: ee7f0000
          PC is at __cpufreq_add_dev.isra.24+0x24c/0x77c
          LR is at __cpufreq_add_dev.isra.24+0x244/0x77c
          pc : [<c029e084>]    lr : [<c029e07c>]    psr: 60000153
          sp : ee7f1d48  ip : ee7f1d48  fp : ee7f1d84
          r10: c04e8448  r9 : 00000000  r8 : 00000001
          r7 : c054a8c4  r6 : 00000001  r5 : 00000001  r4 : 00000000
          r3 : 00000000  r2 : 00000000  r1 : 20000153  r0 : c054a950
          Flags: nZCv  IRQs on  FIQs off  Mode SVC_32  ISA ARM  Segment user
          Control: 30c5307d  Table: 6e71f980  DAC: fffffffd
          Process s2ram (pid: 1397, stack limit = 0xee7f0240)
      
          ...
      
          Backtrace:
          [<c029de38>] (__cpufreq_add_dev.isra.24) from [<c029e620>] (cpufreq_cpu_callback+0x6c/0x74)
           r10:eec75240 r9:c04e8448 r8:c04ef3a0 r7:00000001 r6:00000012 r5:00000000
           r4:00000012
          [<c029e5b4>] (cpufreq_cpu_callback) from [<c003f20c>] (notifier_call_chain+0x48/0x70)
           r4:ffffffdd r3:c029e5b4
          [<c003f1c4>] (notifier_call_chain) from [<c003f2cc>] (__raw_notifier_call_chain+0x1c/0x24)
           r8:00000001 r7:00000010 r6:00000000 r5:00000000 r4:00000012 r3:ffffffff
          [<c003f2b0>] (__raw_notifier_call_chain) from [<c0026a00>] (__cpu_notify+0x34/0x50)
          [<c00269cc>] (__cpu_notify) from [<c0026a34>] (cpu_notify+0x18/0x1c)
           r4:00000001
          [<c0026a1c>] (cpu_notify) from [<c0026c44>] (_cpu_up+0x108/0x144)
          [<c0026b3c>] (_cpu_up) from [<c0381c68>] (enable_nonboot_cpus+0x68/0xb8)
           r10:00000000 r9:c04e8ee6 r8:00000000 r7:00000003 r6:c04e8528 r5:c0506248
           r4:00000001
          [<c0381c00>] (enable_nonboot_cpus) from [<c0059038>] (suspend_devices_and_enter+0x29c/0x3e8)
           r6:c0506e70 r5:00000000 r4:00000000 r3:60000153
      
      Restore the old default of calling cpumask_setall(policy->cpus) if no
      platform data is available to fix this.
      
      Fixes: 34e5a527 (cpufreq: cpufreq-dt: extend with platform_data)
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Reviewed-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c81407fe
    • Imre Deak's avatar
      PM / Sleep: fix recovery during resuming from hibernation · 94fb823f
      Imre Deak authored
      If a device's dev_pm_ops::freeze callback fails during the QUIESCE
      phase, we don't rollback things correctly calling the thaw and complete
      callbacks. This could leave some devices in a suspended state in case of
      an error during resuming from hibernation.
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Cc: All applicable <stable@vger.kernel.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      94fb823f
    • Imre Deak's avatar
      PM / Sleep: fix async suspend_late/freeze_late error handling · 246ef766
      Imre Deak authored
      If an asynchronous suspend_late or freeze_late callback fails
      during the SUSPEND, FREEZE or QUIESCE phases, we don't propagate the
      corresponding error correctly, in effect ignoring the error and
      continuing the suspend-to-ram/hibernation. During suspend-to-ram this
      could leave some devices without a valid saved context, leading to a
      failure to reinitialize them during resume. During hibernation this
      could leave some devices active interfeering with the creation /
      restoration of the hibernation image. Also this could leave the
      corresponding devices without a valid saved context and failure to
      reinitialize them during resume.
      
      Fixes: de377b39 (PM / sleep: Asynchronous threads for suspend_late)
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Cc: 3.15+ <stable@vger.kernel.org> # 3.15+
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      246ef766
    • Mika Westerberg's avatar
      ACPI: Use ACPI companion to match only the first physical device · 52870786
      Mika Westerberg authored
      Commit 6ab34301 ("mfd: Add ACPI support") made the MFD subdevices
      share the parent MFD ACPI companion if no _HID/_CID is specified for
      the subdevice in mfd_cell description. However, since all the subdevices
      share the ACPI companion, the match and modalias generation logic started
      to use the ACPI companion as well resulting this:
      
        # cat /sys/bus/platform/devices/HID-SENSOR-200041.6.auto/modalias
        acpi:INT33D1:PNP0C50:
      
      instead of the expected one
      
        # cat /sys/bus/platform/devices/HID-SENSOR-200041.6.auto/modalias
        platform:HID-SENSOR-200041
      
      In other words the subdevice modalias is overwritten by the one taken from
      ACPI companion. This causes udev not to load the driver anymore.
      
      It is useful to be able to share the ACPI companion so that MFD subdevices
      (and possibly other devices as well) can access the ACPI resources even if
      they do not have ACPI representation in the namespace themselves.
      
      An example where this is used is Minnowboard LPC driver that creates GPIO
      as a subdevice among other things. Without the ACPI companion gpiolib is
      not able to lookup the corresponding GPIO controller from ACPI GpioIo
      resource.
      
      To fix this, restrict the match and modalias logic to be limited to the
      first (primary) physical device associated with the given ACPI comapnion.
      The secondary devices will still be able to access the ACPI companion,
      but they will be matched in a different way.
      
      Fixes: 6ab34301 (mfd: Add ACPI support)
      Reported-by: default avatarJarkko Nikula <jarkko.nikula@linux.intel.com>
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      52870786
    • Lucas Stach's avatar
      cpufreq: cpufreq-dt: disable unsupported OPPs · 045ee45c
      Lucas Stach authored
      If the regulator connected to the CPU voltage plane doesn't
      support an OPP specified voltage with the acceptable tolerance
      it's better to just disable the OPP instead of constantly
      failing the voltage scaling later on.
      
      Includes a fix to move initialization of opp_freq outside
      the loop to avoid an endless loop from Geert Uytterhoeven.
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      045ee45c
  4. 26 Oct, 2014 4 commits
    • Linus Torvalds's avatar
      Linux 3.18-rc2 · cac7f242
      Linus Torvalds authored
      cac7f242
    • Linus Torvalds's avatar
      Merge tag 'armsoc-for-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 88e23761
      Linus Torvalds authored
      Pull ARM SoC fixes from Olof Johansson:
       "Another week, another small batch of fixes.
      
        Most of these make zynq, socfpga and sunxi platforms work a bit
        better:
      
         - due to new requirements for regulators, DWMMC on socfpga broke past
           v3.17
         - SMP spinup fix for socfpga
         - a few DT fixes for zynq
         - another option (FIXED_REGULATOR) for sunxi is needed that used to
           be selected by other options but no longer is.
         - a couple of small DT fixes for at91
         - ...and a couple for i.MX"
      
      * tag 'armsoc-for-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        ARM: dts: imx28-evk: Let i2c0 run at 100kHz
        ARM: i.MX6: Fix "emi" clock name typo
        ARM: multi_v7_defconfig: enable CONFIG_MMC_DW_ROCKCHIP
        ARM: sunxi_defconfig: enable CONFIG_REGULATOR_FIXED_VOLTAGE
        ARM: dts: socfpga: Add a 3.3V fixed regulator node
        ARM: dts: socfpga: Fix SD card detect
        ARM: dts: socfpga: rename gpio nodes
        ARM: at91/dt: sam9263: fix PLLB frequencies
        power: reset: at91-reset: fix power down register
        MAINTAINERS: add atmel ssc driver maintainer entry
        arm: socfpga: fix fetching cpu1start_addr for SMP
        ARM: zynq: DT: trivial: Fix mc node
        ARM: zynq: DT: Add cadence watchdog node
        ARM: zynq: DT: Add missing reference for memory-controller
        ARM: zynq: DT: Add missing reference for ADC
        ARM: zynq: DT: Add missing address for L2 pl310
        ARM: zynq: DT: Remove 222 MHz OPP
        ARM: zynq: DT: Fix GEM register area size
      88e23761
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · d1e14f1d
      Linus Torvalds authored
      Pull vfs updates from Al Viro:
       "overlayfs merge + leak fix for d_splice_alias() failure exits"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        overlayfs: embed middle into overlay_readdir_data
        overlayfs: embed root into overlay_readdir_data
        overlayfs: make ovl_cache_entry->name an array instead of pointer
        overlayfs: don't hold ->i_mutex over opening the real directory
        fix inode leaks on d_splice_alias() failure exits
        fs: limit filesystem stacking depth
        overlay: overlay filesystem documentation
        overlayfs: implement show_options
        overlayfs: add statfs support
        overlay filesystem
        shmem: support RENAME_WHITEOUT
        ext4: support RENAME_WHITEOUT
        vfs: add RENAME_WHITEOUT
        vfs: add whiteout support
        vfs: export check_sticky()
        vfs: introduce clone_private_mount()
        vfs: export __inode_permission() to modules
        vfs: export do_splice_direct() to modules
        vfs: add i_op->dentry_open()
      d1e14f1d
    • Olof Johansson's avatar
      Merge tag 'imx-fixes-3.18' of... · efc176a8
      Olof Johansson authored
      Merge tag 'imx-fixes-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into fixes
      
      Merge "ARM: imx: fixes for 3.18" from Shawn Guo:
      
      The i.MX fixes for 3.18:
       - Revert one patch which increases I2C bus frequency on imx28-evk
       - Fix a typo on imx6q EIM clock name
      
      * tag 'imx-fixes-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
        ARM: dts: imx28-evk: Let i2c0 run at 100kHz
        ARM: i.MX6: Fix "emi" clock name typo
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      efc176a8
  5. 25 Oct, 2014 6 commits
  6. 24 Oct, 2014 21 commits
    • Linus Torvalds's avatar
      Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · 2cc91884
      Linus Torvalds authored
      Pull MIPS fixes from Ralf Baechle:
       "This is the first round of fixes and tying up loose ends for MIPS.
      
         - plenty of fixes for build errors in specific obscure configurations
         - remove redundant code on the Lantiq platform
         - removal of a useless SEAD I2C driver that was causing a build issue
         - fix an earlier TLB exeption handler fix to also work on Octeon.
         - fix ISA level dependencies in FPU emulator's instruction decoding.
         - don't hardcode kernel command line in Octeon software emulator.
         - fix an earlier fix for the Loondson 2 clock setting"
      
      * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
        MIPS: SEAD3: Fix I2C device registration.
        MIPS: SEAD3: Nuke PIC32 I2C driver.
        MIPS: ftrace: Fix a microMIPS build problem
        MIPS: MSP71xx: Fix build error
        MIPS: Malta: Do not build the malta-amon.c file if CMP is not enabled
        MIPS: Prevent compiler warning from cop2_{save,restore}
        MIPS: Kconfig: Add missing MIPS_CPS dependencies to PM and cpuidle
        MIPS: idle: Remove leftover __pastwait symbol and its references
        MIPS: Sibyte: Include the swarm subdir to the sb1250 LittleSur builds
        MIPS: ptrace.h: Add a missing include
        MIPS: ath79: Fix compilation error when CONFIG_PCI is disabled
        MIPS: MSP71xx: Remove compilation error when CONFIG_MIPS_MT is present
        MIPS: Octeon: Remove special case for simulator command line.
        MIPS: tlbex: Properly fix HUGE TLB Refill exception handler
        MIPS: loongson2_cpufreq: Fix CPU clock rate setting mismerge
        pci: pci-lantiq: remove duplicate check on resource
        MIPS: Lasat: Add missing CONFIG_PROC_FS dependency to PICVUE_PROC
        MIPS: cp1emu: Fix ISA restrictions for cop1x_op instructions
      2cc91884
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · cdc63a05
      Linus Torvalds authored
      Pull arm64 fixes from Catalin Marinas:
      
       - enable 48-bit VA space now that KVM has been fixed, together with a
         couple of fixes for pgd allocation alignment and initial memblock
         current_limit.  There is still a dependency on !ARM_SMMU which needs
         to be updated as it uses the page table manipulation macros of the
         host kernel
       - eBPF fixes following changes/conflicts during the merging window
       - Compat types affecting compat_elf_prpsinfo
       - Compilation error on UP builds
       - ASLR fix when /proc/sys/kernel/randomize_va_space == 0
       - DT definitions for CLCD support on ARMv8 model platform
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: Fix memblock current_limit with 64K pages and 48-bit VA
        arm64: ASLR: Don't randomise text when randomise_va_space == 0
        arm64: vexpress: Add CLCD support to the ARMv8 model platform
        arm64: Fix compilation error on UP builds
        Documentation/arm64/memory.txt: fix typo
        net: bpf: arm64: minor fix of type in jited
        arm64: bpf: add 'load 64-bit immediate' instruction
        arm64: bpf: add 'shift by register' instructions
        net: bpf: arm64: address randomize and write protect JIT code
        arm64: mm: Correct fixmap pagetable types
        arm64: compat: fix compat types affecting struct compat_elf_prpsinfo
        arm64: Align less than PAGE_SIZE pgds naturally
        arm64: Allow 48-bits VA space without ARM_SMMU
      cdc63a05
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc · 83da00fb
      Linus Torvalds authored
      Pull two sparc fixes from David Miller:
      
       1) Fix boots with gcc-4.9 compiled sparc64 kernels.
      
       2) Add missing __get_user_pages_fast() on sparc64 to fix hangs on
          futexes used in transparent hugepage areas.
      
          It's really idiotic to have a weak symbolled fallback that just
          returns zero, and causes this kind of bug.  There should be no
          backup implementation and the link should fail if the architecture
          fails to provide __get_user_pages_fast() and supports transparent
          hugepages.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
        sparc64: Implement __get_user_pages_fast().
        sparc64: Fix register corruption in top-most kernel stack frame during boot.
      83da00fb
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 96971e9a
      Linus Torvalds authored
      Pull kvm fixes from Paolo Bonzini:
       "This is a pretty large update.  I think it is roughly as big as what I
        usually had for the _whole_ rc period.
      
        There are a few bad bugs where the guest can OOPS or crash the host.
        We have also started looking at attack models for nested
        virtualization; bugs that usually result in the guest ring 0 crashing
        itself become more worrisome if you have nested virtualization,
        because the nested guest might bring down the non-nested guest as
        well.  For current uses of nested virtualization these do not really
        have a security impact, but you never know and bugs are bugs
        nevertheless.
      
        A lot of these bugs are in 3.17 too, resulting in a large number of
        stable@ Ccs.  I checked that all the patches apply there with no
        conflicts"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        kvm: vfio: fix unregister kvm_device_ops of vfio
        KVM: x86: Wrong assertion on paging_tmpl.h
        kvm: fix excessive pages un-pinning in kvm_iommu_map error path.
        KVM: x86: PREFETCH and HINT_NOP should have SrcMem flag
        KVM: x86: Emulator does not decode clflush well
        KVM: emulate: avoid accessing NULL ctxt->memopp
        KVM: x86: Decoding guest instructions which cross page boundary may fail
        kvm: x86: don't kill guest on unknown exit reason
        kvm: vmx: handle invvpid vm exit gracefully
        KVM: x86: Handle errors when RIP is set during far jumps
        KVM: x86: Emulator fixes for eip canonical checks on near branches
        KVM: x86: Fix wrong masking on relative jump/call
        KVM: x86: Improve thread safety in pit
        KVM: x86: Prevent host from panicking on shared MSR writes.
        KVM: x86: Check non-canonical addresses upon WRMSR
      96971e9a
    • Linus Torvalds's avatar
      Merge tag 'stable/for-linus-3.18-b-rc1-tag' of... · 20ca57cd
      Linus Torvalds authored
      Merge tag 'stable/for-linus-3.18-b-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
      
      Pull xen bug fixes from David Vrabel:
      
       - Fix regression in xen_clocksource_read() which caused all Xen guests
         to crash early in boot.
       - Several fixes for super rare race conditions in the p2m.
       - Assorted other minor fixes.
      
      * tag 'stable/for-linus-3.18-b-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen/pci: Allocate memory for physdev_pci_device_add's optarr
        x86/xen: panic on bad Xen-provided memory map
        x86/xen: Fix incorrect per_cpu accessor in xen_clocksource_read()
        x86/xen: avoid race in p2m handling
        x86/xen: delay construction of mfn_list_list
        x86/xen: avoid writing to freed memory after race in p2m handling
        xen/balloon: Don't continue ballooning when BP_ECANCELED is encountered
      20ca57cd
    • Linus Torvalds's avatar
      Merge tag 'sound-3.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · c6d13403
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "Here are a chunk of small fixes since rc1: two PCM core fixes, one is
        a long-standing annoyance about lockdep and another is an ARM64 mmap
        fix.
      
        The rest are a HD-audio HDMI hotplug notification fix, a fix for
        missing NULL termination in Realtek codec quirks and a few new
        device/codec-specific quirks as usual"
      
      * tag 'sound-3.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda - Add missing terminating entry to SND_HDA_PIN_QUIRK macro
        ALSA: pcm: Fix false lockdep warnings
        ALSA: hda - Fix inverted LED gpio setup for Lenovo Ideapad
        ALSA: hda - hdmi: Fix missing ELD change event on plug/unplug
        ALSA: usb-audio: Add support for Steinberg UR22 USB interface
        ALSA: ALC283 codec - Avoid pop noise on headphones during suspend/resume
        ALSA: pcm: use the same dma mmap codepath both for arm and arm64
      c6d13403
    • Linus Torvalds's avatar
      Merge tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random · 14d4cc08
      Linus Torvalds authored
      Pull /dev/random updates from Ted Ts'o:
       "This adds a memzero_explicit() call which is guaranteed not to be
        optimized away by GCC.  This is important when we are wiping
        cryptographically sensitive material"
      
      * tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/random:
        crypto: memzero_explicit - make sure to clear out sensitive data
        random: add and use memzero_explicit() for clearing data
      14d4cc08
    • Linus Torvalds's avatar
      Merge tag 'pm+acpi-3.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 1c45d9a9
      Linus Torvalds authored
      Pull ACPI and power management updates from Rafael Wysocki:
       "This is material that didn't make it to my 3.18-rc1 pull request for
        various reasons, mostly related to timing and travel (LinuxCon EU /
        LPC) plus a couple of fixes for recent bugs.
      
        The only really new thing here is the PM QoS class for memory
        bandwidth, but it is simple enough and users of it will be added in
        the next cycle.  One major change in behavior is that platform devices
        enumerated by ACPI will use 32-bit DMA mask by default.  Also included
        is an ACPICA update to a new upstream release, but that's mostly
        cleanups, changes in tools and similar.  The rest is fixes and
        cleanups mostly.
      
        Specifics:
      
         - Fix for a recent PCI power management change that overlooked the
           fact that some IRQ chips might not be able to configure PCIe PME
           for system wakeup from Lucas Stach.
      
         - Fix for a bug introduced in 3.17 where acpi_device_wakeup() is
           called with a wrong ordering of arguments from Zhang Rui.
      
         - A bunch of intel_pstate driver fixes (all -stable candidates) from
           Dirk Brandewie, Gabriele Mazzotta and Pali Rohár.
      
         - Fixes for a rather long-standing problem with the OOM killer and
           the freezer that frozen processes killed by the OOM do not actually
           release any memory until they are thawed, so OOM-killing them is
           rather pointless, with a couple of cleanups on top (Michal Hocko,
           Cong Wang, Rafael J Wysocki).
      
         - ACPICA update to upstream release 20140926, inlcuding mostly
           cleanups reducing differences between the upstream ACPICA and the
           kernel code, tools changes (acpidump, acpiexec) and support for the
           _DDN object (Bob Moore, Lv Zheng).
      
         - New PM QoS class for memory bandwidth from Tomeu Vizoso.
      
         - Default 32-bit DMA mask for platform devices enumerated by ACPI
           (this change is mostly needed for some drivers development in
           progress targeted at 3.19) from Heikki Krogerus.
      
         - ACPI EC driver cleanups, mostly related to debugging, from Lv
           Zheng.
      
         - cpufreq-dt driver updates from Thomas Petazzoni.
      
         - powernv cpuidle driver update from Preeti U Murthy"
      
      * tag 'pm+acpi-3.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (34 commits)
        intel_pstate: Correct BYT VID values.
        intel_pstate: Fix BYT frequency reporting
        intel_pstate: Don't lose sysfs settings during cpu offline
        cpufreq: intel_pstate: Reflect current no_turbo state correctly
        cpufreq: expose scaling_cur_freq sysfs file for set_policy() drivers
        cpufreq: intel_pstate: Fix setting max_perf_pct in performance policy
        PCI / PM: handle failure to enable wakeup on PCIe PME
        ACPI: invoke acpi_device_wakeup() with correct parameters
        PM / freezer: Clean up code after recent fixes
        PM: convert do_each_thread to for_each_process_thread
        OOM, PM: OOM killed task shouldn't escape PM suspend
        freezer: remove obsolete comments in __thaw_task()
        freezer: Do not freeze tasks killed by OOM killer
        ACPI / platform: provide default DMA mask
        cpuidle: powernv: Populate cpuidle state details by querying the device-tree
        cpufreq: cpufreq-dt: adjust message related to regulators
        cpufreq: cpufreq-dt: extend with platform_data
        cpufreq: allow driver-specific data
        ACPI / EC: Cleanup coding style.
        ACPI / EC: Refine event/query debugging messages.
        ...
      1c45d9a9
    • Linus Torvalds's avatar
      Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux · 8264fce6
      Linus Torvalds authored
      Pull thermal management updates from Zhang Rui:
       "Sorry that I missed the merge window as there is a bug found in the
        last minute, and I have to fix it and wait for the code to be tested
        in linux-next tree for a few days.  Now the buggy patch has been
        dropped entirely from my next branch.  Thus I hope those changes can
        still be merged in 3.18-rc2 as most of them are platform thermal
        driver changes.
      
        Specifics:
      
         - introduce ACPI INT340X thermal drivers.
      
           Newer laptops and tablets may have thermal sensors and other
           devices with thermal control capabilities that are exposed for the
           OS to use via the ACPI INT340x device objects.  Several drivers are
           introduced to expose the temperature information and cooling
           ability from these objects to user-space via the normal thermal
           framework.
      
           From: Lu Aaron, Lan Tianyu, Jacob Pan and Zhang Rui.
      
         - introduce a new thermal governor, which just uses a hysteresis to
           switch abruptly on/off a cooling device.  This governor can be used
           to control certain fan devices that can not be throttled but just
           switched on or off.  From: Peter Feuerer.
      
         - introduce support for some new thermal interrupt functions on
           i.MX6SX, in IMX thermal driver.  From: Anson, Huang.
      
         - introduce tracing support on thermal framework.  From: Punit
           Agrawal.
      
         - small fixes in OF thermal and thermal step_wise governor"
      
      * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (25 commits)
        Thermal: int340x thermal: select ACPI fan driver
        Thermal: int3400_thermal: use acpi_thermal_rel parsing APIs
        Thermal: int340x_thermal: expose acpi thermal relationship tables
        Thermal: introduce int3403 thermal driver
        Thermal: introduce INT3402 thermal driver
        Thermal: move the KELVIN_TO_MILLICELSIUS macro to thermal.h
        ACPI / Fan: support INT3404 thermal device
        ACPI / Fan: add ACPI 4.0 style fan support
        ACPI / fan: convert to platform driver
        ACPI / fan: use acpi_device_xxx_power instead of acpi_bus equivelant
        ACPI / fan: remove no need check for device pointer
        ACPI / fan: remove unused macro
        Thermal: int3400 thermal: register to thermal framework
        Thermal: int3400 thermal: add capability to detect supporting UUIDs
        Thermal: introduce int3400 thermal driver
        ACPI: add ACPI_TYPE_LOCAL_REFERENCE support to acpi_extract_package()
        ACPI: make acpi_create_platform_device() an external API
        thermal: step_wise: fix: Prevent from binary overflow when trend is dropping
        ACPI: introduce ACPI int340x thermal scan handler
        thermal: Added Bang-bang thermal governor
        ...
      8264fce6
    • Catalin Marinas's avatar
      arm64: Fix memblock current_limit with 64K pages and 48-bit VA · 3dec0fe4
      Catalin Marinas authored
      With 48-bit VA space, the 64K page configuration uses 3 levels instead
      of 2 and PUD_SIZE != PMD_SIZE. Since with 64K pages we only cover
      PMD_SIZE with the initial swapper_pg_dir populated in head.S, the
      memblock current_limit needs to be set accordingly in map_mem() to avoid
      allocating unmapped memory. The memblock current_limit is progressively
      increased as more blocks are mapped.
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      3dec0fe4
    • David S. Miller's avatar
      sparc64: Implement __get_user_pages_fast(). · 06090e8e
      David S. Miller authored
      It is not sufficient to only implement get_user_pages_fast(), you
      must also implement the atomic version __get_user_pages_fast()
      otherwise you end up using the weak symbol fallback implementation
      which simply returns zero.
      
      This is dangerous, because it causes the futex code to loop forever
      if transparent hugepages are supported (see get_futex_key()).
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      06090e8e
    • David S. Miller's avatar
      sparc64: Fix register corruption in top-most kernel stack frame during boot. · ef3e035c
      David S. Miller authored
      Meelis Roos reported that kernels built with gcc-4.9 do not boot, we
      eventually narrowed this down to only impacting machines using
      UltraSPARC-III and derivitive cpus.
      
      The crash happens right when the first user process is spawned:
      
      [   54.451346] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
      [   54.451346]
      [   54.571516] CPU: 1 PID: 1 Comm: init Not tainted 3.16.0-rc2-00211-gd7933ab7 #96
      [   54.666431] Call Trace:
      [   54.698453]  [0000000000762f8c] panic+0xb0/0x224
      [   54.759071]  [000000000045cf68] do_exit+0x948/0x960
      [   54.823123]  [000000000042cbc0] fault_in_user_windows+0xe0/0x100
      [   54.902036]  [0000000000404ad0] __handle_user_windows+0x0/0x10
      [   54.978662] Press Stop-A (L1-A) to return to the boot prom
      [   55.050713] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
      
      Further investigation showed that compiling only per_cpu_patch() with
      an older compiler fixes the boot.
      
      Detailed analysis showed that the function is not being miscompiled by
      gcc-4.9, but it is using a different register allocation ordering.
      
      With the gcc-4.9 compiled function, something during the code patching
      causes some of the %i* input registers to get corrupted.  Perhaps
      we have a TLB miss path into the firmware that is deep enough to
      cause a register window spill and subsequent restore when we get
      back from the TLB miss trap.
      
      Let's plug this up by doing two things:
      
      1) Stop using the firmware stack for client interface calls into
         the firmware.  Just use the kernel's stack.
      
      2) As soon as we can, call into a new function "start_early_boot()"
         to put a one-register-window buffer between the firmware's
         deepest stack frame and the top-most initial kernel one.
      Reported-by: default avatarMeelis Roos <mroos@linux.ee>
      Tested-by: default avatarMeelis Roos <mroos@linux.ee>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ef3e035c
    • Arun Chandran's avatar
      arm64: ASLR: Don't randomise text when randomise_va_space == 0 · 92980405
      Arun Chandran authored
      When user asks to turn off ASLR by writing "0" to
      /proc/sys/kernel/randomize_va_space there should not be
      any randomization to mmap base, stack, VDSO, libs, text and heap
      
      Currently arm64 violates this behavior by randomising text.
      Fix this by defining a constant ELF_ET_DYN_BASE. The randomisation of
      mm->mmap_base is done by setup_new_exec -> arch_pick_mmap_layout ->
      mmap_base -> mmap_rnd.
      Signed-off-by: default avatarArun Chandran <achandran@mvista.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      92980405
    • Ralf Baechle's avatar
      MIPS: SEAD3: Fix I2C device registration. · 4846f118
      Ralf Baechle authored
      This isn't a module and shouldn't be one.
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      4846f118
    • Wanpeng Li's avatar
      kvm: vfio: fix unregister kvm_device_ops of vfio · 571ee1b6
      Wanpeng Li authored
      After commit 80ce1639 (KVM: VFIO: register kvm_device_ops dynamically),
      kvm_device_ops of vfio can be registered dynamically. Commit 3c3c29fd
      (kvm-vfio: do not use module_init) move the dynamic register invoked by
      kvm_init in order to fix broke unloading of the kvm module. However,
      kvm_device_ops of vfio is unregistered after rmmod kvm-intel module
      which lead to device type collision detection warning after kvm-intel
      module reinsmod.
      
          WARNING: CPU: 1 PID: 10358 at /root/cathy/kvm/arch/x86/kvm/../../../virt/kvm/kvm_main.c:3289 kvm_init+0x234/0x282 [kvm]()
          Modules linked in: kvm_intel(O+) kvm(O) nfsv3 nfs_acl auth_rpcgss oid_registry nfsv4 dns_resolver nfs fscache lockd sunrpc pci_stub bridge stp llc autofs4 8021q cpufreq_ondemand ipv6 joydev microcode pcspkr igb i2c_algo_bit ehci_pci ehci_hcd e1000e i2c_i801 ixgbe ptp pps_core hwmon mdio tpm_tis tpm ipmi_si ipmi_msghandler acpi_cpufreq isci libsas scsi_transport_sas button dm_mirror dm_region_hash dm_log dm_mod [last unloaded: kvm_intel]
          CPU: 1 PID: 10358 Comm: insmod Tainted: G        W  O   3.17.0-rc1 #2
          Hardware name: Intel Corporation S2600CP/S2600CP, BIOS RMLSDP.86I.00.29.D696.1311111329 11/11/2013
           0000000000000cd9 ffff880ff08cfd18 ffffffff814a61d9 0000000000000cd9
           0000000000000000 ffff880ff08cfd58 ffffffff810417b7 ffff880ff08cfd48
           ffffffffa045bcac ffffffffa049c420 0000000000000040 00000000000000ff
          Call Trace:
           [<ffffffff814a61d9>] dump_stack+0x49/0x60
           [<ffffffff810417b7>] warn_slowpath_common+0x7c/0x96
           [<ffffffffa045bcac>] ? kvm_init+0x234/0x282 [kvm]
           [<ffffffff810417e6>] warn_slowpath_null+0x15/0x17
           [<ffffffffa045bcac>] kvm_init+0x234/0x282 [kvm]
           [<ffffffffa016e995>] vmx_init+0x1bf/0x42a [kvm_intel]
           [<ffffffffa016e7d6>] ? vmx_check_processor_compat+0x64/0x64 [kvm_intel]
           [<ffffffff810002ab>] do_one_initcall+0xe3/0x170
           [<ffffffff811168a9>] ? __vunmap+0xad/0xb8
           [<ffffffff8109c58f>] do_init_module+0x2b/0x174
           [<ffffffff8109d414>] load_module+0x43e/0x569
           [<ffffffff8109c6d8>] ? do_init_module+0x174/0x174
           [<ffffffff8109c75a>] ? copy_module_from_user+0x39/0x82
           [<ffffffff8109b7dd>] ? module_sect_show+0x20/0x20
           [<ffffffff8109d65f>] SyS_init_module+0x54/0x81
           [<ffffffff814a9a12>] system_call_fastpath+0x16/0x1b
          ---[ end trace 0626f4a3ddea56f3 ]---
      
      The bug can be reproduced by:
      
          rmmod kvm_intel.ko
          insmod kvm_intel.ko
      
      without rmmod/insmod kvm.ko
      This patch fixes the bug by unregistering kvm_device_ops of vfio when the
      kvm-intel module is removed.
      Reported-by: default avatarLiu Rongrong <rongrongx.liu@intel.com>
      Fixes: 3c3c29fdSigned-off-by: default avatarWanpeng Li <wanpeng.li@linux.intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      571ee1b6
    • Nadav Amit's avatar
      KVM: x86: Wrong assertion on paging_tmpl.h · 1715d0dc
      Nadav Amit authored
      Even after the recent fix, the assertion on paging_tmpl.h is triggered.
      Apparently, the assertion wants to check that the PAE is always set on
      long-mode, but does it in incorrect way.  Note that the assertion is not
      enabled unless the code is debugged by defining MMU_DEBUG.
      Signed-off-by: default avatarNadav Amit <namit@cs.technion.ac.il>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      1715d0dc
    • Quentin Casasnovas's avatar
      kvm: fix excessive pages un-pinning in kvm_iommu_map error path. · 3d32e4db
      Quentin Casasnovas authored
      The third parameter of kvm_unpin_pages() when called from
      kvm_iommu_map_pages() is wrong, it should be the number of pages to un-pin
      and not the page size.
      
      This error was facilitated with an inconsistent API: kvm_pin_pages() takes
      a size, but kvn_unpin_pages() takes a number of pages, so fix the problem
      by matching the two.
      
      This was introduced by commit 350b8bdd ("kvm: iommu: fix the third parameter
      of kvm_iommu_put_pages (CVE-2014-3601)"), which fixes the lack of
      un-pinning for pages intended to be un-pinned (i.e. memory leak) but
      unfortunately potentially aggravated the number of pages we un-pin that
      should have stayed pinned. As far as I understand though, the same
      practical mitigations apply.
      
      This issue was found during review of Red Hat 6.6 patches to prepare
      Ksplice rebootless updates.
      
      Thanks to Vegard for his time on a late Friday evening to help me in
      understanding this code.
      
      Fixes: 350b8bdd ("kvm: iommu: fix the third parameter of... (CVE-2014-3601)")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarQuentin Casasnovas <quentin.casasnovas@oracle.com>
      Signed-off-by: default avatarVegard Nossum <vegard.nossum@oracle.com>
      Signed-off-by: default avatarJamie Iles <jamie.iles@oracle.com>
      Reviewed-by: default avatarSasha Levin <sasha.levin@oracle.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      3d32e4db
    • Nadav Amit's avatar
      KVM: x86: PREFETCH and HINT_NOP should have SrcMem flag · 3f6f1480
      Nadav Amit authored
      The decode phase of the x86 emulator assumes that every instruction with the
      ModRM flag, and which can be used with RIP-relative addressing, has either
      SrcMem or DstMem.  This is not the case for several instructions - prefetch,
      hint-nop and clflush.
      
      Adding SrcMem|NoAccess for prefetch and hint-nop and SrcMem for clflush.
      
      This fixes CVE-2014-8480.
      
      Fixes: 41061cdb
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarNadav Amit <namit@cs.technion.ac.il>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      3f6f1480
    • Nadav Amit's avatar
      KVM: x86: Emulator does not decode clflush well · 13e457e0
      Nadav Amit authored
      Currently, all group15 instructions are decoded as clflush (e.g., mfence,
      xsave).  In addition, the clflush instruction requires no prefix (66/f2/f3)
      would exist. If prefix exists it may encode a different instruction (e.g.,
      clflushopt).
      
      Creating a group for clflush, and different group for each prefix.
      
      This has been the case forever, but the next patch needs the cflush group
      in order to fix a bug introduced in 3.17.
      
      Fixes: 41061cdb
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarNadav Amit <namit@cs.technion.ac.il>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      13e457e0
    • Paolo Bonzini's avatar
      KVM: emulate: avoid accessing NULL ctxt->memopp · a430c916
      Paolo Bonzini authored
      A failure to decode the instruction can cause a NULL pointer access.
      This is fixed simply by moving the "done" label as close as possible
      to the return.
      
      This fixes CVE-2014-8481.
      Reported-by: default avatarAndy Lutomirski <luto@amacapital.net>
      Cc: stable@vger.kernel.org
      Fixes: 41061cdbSigned-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      a430c916
    • Ralf Baechle's avatar
      MIPS: SEAD3: Nuke PIC32 I2C driver. · cc08d25a
      Ralf Baechle authored
      A platform driver for which nothing ever registers the corresponding
      platform device.
      
      Also it was driving the same hardware as sead3-i2c-drv.c so redundant
      anyway and couldn't co-exist with that driver because each of them was
      using a private spinlock to protect access to the same hardware
      resources.
      
      This also fixes a randconfig problem:
      
      arch/mips/mti-sead3/sead3-pic32-i2c-drv.c: In function 'i2c_platform_probe':
      arch/mips/mti-sead3/sead3-pic32-i2c-drv.c:345:2: error: implicit declaration of
      function 'i2c_add_numbered_adapter' [-Werror=implicit-function-declaration]
        ret = i2c_add_numbered_adapter(&priv->adap);
          ^
      arch/mips/mti-sead3/sead3-pic32-i2c-drv.c: In function
      'i2c_platform_remove':
      arch/mips/mti-sead3/sead3-pic32-i2c-drv.c:361:2: error: implicit declaration
      of function 'i2c_del_adapter' [-Werror=implicit-function-declaration]
      i2c_del_adapter(&priv->adap);
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      cc08d25a