1. 29 Oct, 2016 6 commits
    • Linus Torvalds's avatar
      Merge tag 'staging-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · db4a57e6
      Linus Torvalds authored
      Pull staging and IIO driver fixes from Greg KH:
       "Here are some small staging and iio driver fixes for reported issues
        for 4.9-rc3. Nothing major, the "largest" being a lustre fix for a
        sysfs file that was obviously wrong, and had never been tested, so it
        was moved to debugfs as that is where it belongs. The others are small
        bug fixes for reported issues with various staging or iio drivers.
      
        All have been in linux-next for a while with no reported issues"
      
      * tag 'staging-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        greybus: fix a leak on error in gb_module_create()
        greybus: es2: fix error return code in ap_probe()
        greybus: arche-platform: Add missing of_node_put() in arche_platform_change_state()
        staging: android: ion: Fix error handling in ion_query_heaps()
        iio: accel: sca3000_core: avoid potentially uninitialized variable
        iio:chemical:atlas-ph-sensor: Fix use of 32 bit int to hold 16 bit big endian value
        staging/lustre/llite: Move unstable_stats from sysfs to debugfs
        Staging: wilc1000: Fix kernel Oops on opening the device
        staging: android/ion: testing the wrong variable
        Staging: greybus: uart: Use gbphy_dev->dev instead of bundle->dev
        Staging: greybus: gpio: Use gbphy_dev->dev instead of bundle->dev
        iio: adc: ti-adc081c: Select IIO_TRIGGERED_BUFFER to prevent build errors
        iio: maxim_thermocouple: Align 16 bit big endian value of raw reads
      db4a57e6
    • Linus Torvalds's avatar
      Merge tag 'tty-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 37cc6bb8
      Linus Torvalds authored
      Pull tty/serial driver fixes from Greg KH:
       "Here are a number of small tty and serial driver fixes for reported
        issues for 4.9-rc3. Nothing major, but they do resolve a bunch of
        problems with the tty core changes that are in 4.9-rc1, and finally
        the atmel serial driver is back working properly.
      
        All have been in linux-next with no reported issues"
      
      * tag 'tty-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        tty: serial_core: fix NULL struct tty pointer access in uart_write_wakeup
        tty: serial_core: Fix serial console crash on port shutdown
        tty/serial: at91: fix hardware handshake on Atmel platforms
        vt: clear selection before resizing
        sc16is7xx: always write state when configuring GPIO as an output
        sh-sci: document R8A7743/5 support
        tty: serial: 8250: 8250_core: NXP SC16C2552 workaround
        tty: limit terminal size to 4M chars
        tty: serial: fsl_lpuart: Fix Tx DMA edge case
        serial: 8250_lpss: enable MSI for sure
        serial: core: fix console problems on uart_close
        serial: 8250_uniphier: fix clearing divisor latch access bit
        serial: 8250_uniphier: fix more unterminated string
        serial: pch_uart: add terminate entry for dmi_system_id tables
        devicetree: bindings: uart: Add new compatible string for ZynqMP
        serial: xuartps: Add new compatible string for ZynqMP
        serial: SERIAL_STM32 should depend on HAS_DMA
        serial: stm32: Fix comparisons with undefined register
        tty: vt, fix bogus division in csi_J
      37cc6bb8
    • Linus Torvalds's avatar
      Merge tag 'usb-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 9af6f26a
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are a number of small USB driver fixes for 4.9-rc3.
      
        There is the usual number of gadget and xhci patches in here to
        resolved reported issues, as well as some usb-serial driver fixes and
        new device ids.
      
        All have been in linux-next with no reported issues"
      
      * tag 'usb-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (26 commits)
        usb: chipidea: host: fix NULL ptr dereference during shutdown
        usb: renesas_usbhs: add wait after initialization for R-Car Gen3
        usb: increase ohci watchdog delay to 275 msec
        usb: musb: Call pm_runtime from musb_gadget_queue
        usb: musb: Fix hardirq-safe hardirq-unsafe lock order error
        usb: ehci-platform: increase EHCI_MAX_RSTS to 4
        usb: ohci-at91: Set RemoteWakeupConnected bit explicitly.
        USB: serial: fix potential NULL-dereference at probe
        xhci: use default USB_RESUME_TIMEOUT when resuming ports.
        xhci: workaround for hosts missing CAS bit
        xhci: add restart quirk for Intel Wildcatpoint PCH
        USB: serial: cp210x: fix tiocmget error handling
        wusb: fix error return code in wusb_prf()
        Revert "Documentation: devicetree: dwc2: Deprecate g-tx-fifo-size"
        Revert "usb: dwc2: gadget: fix TX FIFO size and address initialization"
        Revert "usb: dwc2: gadget: change variable name to more meaningful"
        USB: serial: ftdi_sio: add support for Infineon TriBoard TC2X7
        wusb: Stop using the stack for sg crypto scratch space
        usb: dwc3: Fix size used in dma_free_coherent()
        usb: gadget: f_fs: stop sleeping in ffs_func_eps_disable
        ...
      9af6f26a
    • Linus Torvalds's avatar
      Merge tag 'acpi-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · c067affc
      Linus Torvalds authored
      Pull ACPI fixes from Rafael Wysocki:
       "These fix recent ACPICA regressions, an older PCI IRQ management
        regression, and an incorrect return value of a function in the APEI
        code.
      
        Specifics:
      
         - Fix three ACPICA issues related to the interpreter locking and
           introduced by recent changes in that area (Lv Zheng).
      
         - Fix a PCI IRQ management regression introduced during the 4.7 cycle
           and related to the configuration of shared IRQs on systems with an
           ISA bus (Sinan Kaya).
      
         - Fix up a return value of one function in the APEI code (Punit
           Agrawal)"
      
      * tag 'acpi-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPICA: Dispatcher: Fix interpreter locking around acpi_ev_initialize_region()
        ACPICA: Dispatcher: Fix an unbalanced lock exit path in acpi_ds_auto_serialize_method()
        ACPICA: Dispatcher: Fix order issue of method termination
        ACPI / APEI: Fix incorrect return value of ghes_proc()
        ACPI/PCI: pci_link: Include PIRQ_PENALTY_PCI_USING for ISA IRQs
        ACPI/PCI: pci_link: penalize SCI correctly
        ACPI/PCI/IRQ: assign ISA IRQ directly during early boot stages
      c067affc
    • Linus Torvalds's avatar
      Merge tag 'pm-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · b546e0c2
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "These fix two intel_pstate issues related to the way it works when the
        scaling_governor sysfs attribute is set to "performance" and fix up
        messages in the system suspend core code.
      
        Specifics:
      
         - Fix a missing KERN_CONT in a system suspend message by converting
           the affected code to using pr_info() and pr_cont() instead of the
           "raw" printk() (Jon Hunter).
      
         - Make intel_pstate set the CPU P-state from its .set_policy()
           callback when the scaling_governor sysfs attribute is set to
           "performance" so that it interacts with NOHZ_FULL more predictably
           which was the case before 4.7 (Rafael Wysocki).
      
         - Make intel_pstate always request the maximum allowed P-state when
           the scaling_governor sysfs attribute is set to "performance" to
           prevent it from effectively ingoring that setting is some
           situations (Rafael Wysocki)"
      
      * tag 'pm-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpufreq: intel_pstate: Always set max P-state in performance mode
        PM / suspend: Fix missing KERN_CONT for suspend message
        cpufreq: intel_pstate: Set P-state upfront in performance mode
      b546e0c2
    • Linus Torvalds's avatar
      Merge tag 'arc-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc · 1308fd75
      Linus Torvalds authored
      Pull ARC updates from Vineet Gupta:
      
       - support IDU intc for UP builds
      
       - support gz, lzma compressed uImage [Daniel Mentz]
      
       - adjust /proc/cpuinfo for non-continuous cpu ids [Noam Camus]
      
       - syscall for userspace cmpxchg assist for configs lacking hardware atomics
      
       - rework of boot log printing mainly for identifying older arc700 cores
      
       - retiring some old code, build toggles
      
      * tag 'arc-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
        ARC: module: print pretty section names
        ARC: module: elide loop to save reference to .eh_frame
        ARC: mm: retire ARC_DBG_TLB_MISS_COUNT...
        ARC: build: retire old toggles
        ARC: boot log: refactor cpu name/release printing
        ARC: boot log: remove awkward space comma from MMU line
        ARC: boot log: don't assume SWAPE instruction support
        ARC: boot log: refactor printing abt features not captured in BCRs
        ARCv2: boot log: print IOC exists as well as enabled status
        ARCv2: IOC: use @ioc_enable not @ioc_exist where intended
        ARC: syscall for userspace cmpxchg assist
        ARC: fix build warning in elf.h
        ARC: Adjust cpuinfo for non-continuous cpu ids
        ARC: [build] Support gz, lzma compressed uImage
        ARCv2: intc: untangle SMP, MCIP and IDU
      1308fd75
  2. 28 Oct, 2016 34 commits
    • Rafael J. Wysocki's avatar
      Merge branches 'acpica-fixes', 'acpi-pci-fixes' and 'acpi-apei-fixes' · 21e2d9d5
      Rafael J. Wysocki authored
      * acpica-fixes:
        ACPICA: Dispatcher: Fix interpreter locking around acpi_ev_initialize_region()
        ACPICA: Dispatcher: Fix an unbalanced lock exit path in acpi_ds_auto_serialize_method()
        ACPICA: Dispatcher: Fix order issue of method termination
      
      * acpi-pci-fixes:
        ACPI/PCI: pci_link: Include PIRQ_PENALTY_PCI_USING for ISA IRQs
        ACPI/PCI: pci_link: penalize SCI correctly
        ACPI/PCI/IRQ: assign ISA IRQ directly during early boot stages
      
      * acpi-apei-fixes:
        ACPI / APEI: Fix incorrect return value of ghes_proc()
      21e2d9d5
    • Lv Zheng's avatar
      ACPICA: Dispatcher: Fix interpreter locking around acpi_ev_initialize_region() · 8633db6b
      Lv Zheng authored
      In the code path of acpi_ev_initialize_region(), there is namespace
      modification code unlocked. This patch tunes the code to make sure
      such modification are always locked.
      
      Fixes: 74f51b80 (ACPICA: Namespace: Fix dynamic table loading issues)
      Tested-by: default avatarImre Deak <imre.deak@intel.com>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8633db6b
    • Lv Zheng's avatar
      ACPICA: Dispatcher: Fix an unbalanced lock exit path in acpi_ds_auto_serialize_method() · 8121aa26
      Lv Zheng authored
      There is a lock unbalanced exit path in acpi_ds_initialize_method(),
      this patch corrects it.
      
      Fixes: 441ad11d (ACPICA: Dispatcher: Fix a mutex issue for method auto serialization)
      Tested-by: default avatarImre Deak <imre.deak@intel.com>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8121aa26
    • Lv Zheng's avatar
      ACPICA: Dispatcher: Fix order issue of method termination · 25ccd242
      Lv Zheng authored
      The last step of the method termination should be the end of the method
      serialization. Otherwise, the steps happening after it will face the race
      issues that cannot be protected by the method serialization mechanism.
      
      This patch fixes this issue by moving the per-method-object deletion code
      prior than the end of the method serialization. Otherwise, the possible
      race issues may result in AE_ALREADY_EXISTS error in a parallel
      environment.
      
      Fixes: 74f51b80 (ACPICA: Namespace: Fix dynamic table loading issues)
      Reported-and-tested-by: default avatarImre Deak <imre.deak@intel.com>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      25ccd242
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.9-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 6fcc8cea
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "Fixes marked for stable:
         - Convert cmp to cmpd in idle enter sequence (Segher Boessenkool)
         - cxl: Fix leaking pid refs in some error paths (Vaibhav Jain)
         - Re-fix race condition between going idle and entering guest (Paul Mackerras)
         - Fix race condition in setting lock bit in idle/wakeup code (Paul Mackerras)
         - radix: Use tlbiel only if we ever ran on the current cpu (Aneesh Kumar K.V)
         - relocation, register save fixes for system reset interrupt (Nicholas Piggin)
      
        Fixes for code merged this cycle:
         - Fix CONFIG_ALIVEC typo in restore_tm_state() (Valentin Rothberg)
         - KVM: PPC: Book3S HV: Fix build error when SMP=n (Michael Ellerman)"
      
      * tag 'powerpc-4.9-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/64s: relocation, register save fixes for system reset interrupt
        powerpc/mm/radix: Use tlbiel only if we ever ran on the current cpu
        powerpc/process: Fix CONFIG_ALIVEC typo in restore_tm_state()
        powerpc/64: Fix race condition in setting lock bit in idle/wakeup code
        powerpc/64: Re-fix race condition between going idle and entering guest
        cxl: Fix leaking pid refs in some error paths
        powerpc: Convert cmp to cmpd in idle enter sequence
        KVM: PPC: Book3S HV: Fix build error when SMP=n
      6fcc8cea
    • Rafael J. Wysocki's avatar
      Merge branches 'pm-cpufreq-fixes' and 'pm-sleep-fixes' · 8b2ada27
      Rafael J. Wysocki authored
      * pm-cpufreq-fixes:
        cpufreq: intel_pstate: Always set max P-state in performance mode
        cpufreq: intel_pstate: Set P-state upfront in performance mode
      
      * pm-sleep-fixes:
        PM / suspend: Fix missing KERN_CONT for suspend message
      8b2ada27
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · b49c3170
      Linus Torvalds authored
      Pull perf fixes from Ingo Molnar:
       "Misc kernel fixes: a virtualization environment related fix, an uncore
        PMU driver removal handling fix, a PowerPC fix and new events for
        Knights Landing"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86/intel: Honour the CPUID for number of fixed counters in hypervisors
        perf/powerpc: Don't call perf_event_disable() from atomic context
        perf/core: Protect PMU device removal with a 'pmu_bus_running' check, to fix CONFIG_DEBUG_TEST_DRIVER_REMOVE=y kernel panic
        perf/x86/intel/cstate: Add C-state residency events for Knights Landing
      b49c3170
    • Linus Torvalds's avatar
      Merge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · ed99d367
      Linus Torvalds authored
      Pull libnvdimm fixes from Dan Williams:
       "A build fix, a NULL de-reference found by static analysis, a misuse of
        the percpu_ref_exit() (tagged for -stable), and notification of failed
        attempts to clear media errors.
      
        These patches have received a build success notification from the
        0day- kbuild-robot and appeared in next-20161028"
      
      * 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        device-dax: fix percpu_ref_exit ordering
        nvdimm: make CONFIG_NVDIMM_DAX 'bool'
        pmem: report error on clear poison failure
        libnvdimm, namespace: potential NULL deref on allocation error
      ed99d367
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · b92d9648
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
       "Three arm64 fixes for -rc3.  They're all pretty straightforward: a
        couple of NUMA issues from the Huawei folks and a thinko in
        __page_to_voff that seems to be benign, but is certainly better off
        fixed.
      
        Summary:
         - couple of NUMA fixes
         - thinko in __page_to_voff"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: mm: fix __page_to_voff definition
        arm64/numa: fix incorrect log for memory-less node
        arm64/numa: fix pcpu_cpu_distance() to get correct CPU proximity
      b92d9648
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · c38c04c6
      Linus Torvalds authored
      Pull x86 fixes from Ingo Molnar:
       "Misc fixes: three build fixes, an unwinder fix and a microcode loader
        fix"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/microcode/AMD: Fix more fallout from CONFIG_RANDOMIZE_MEMORY=y
        x86: Fix export for mcount and __fentry__
        x86/quirks: Hide maybe-uninitialized warning
        x86/build: Fix build with older GCC versions
        x86/unwind: Fix empty stack dereference in guess unwinder
      c38c04c6
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · a8006bd9
      Linus Torvalds authored
      Pull timer fixes from Ingo Molnar:
       "Fix four timer locking races: two were noticed by Linus while
        reviewing the code while chasing for a corruption bug, and two
        from fixing spurious USB timeouts"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        timers: Prevent base clock corruption when forwarding
        timers: Prevent base clock rewind when forwarding clock
        timers: Lock base for same bucket optimization
        timers: Plug locking race vs. timer migration
      a8006bd9
    • Linus Torvalds's avatar
      Merge branches 'core-urgent-for-linus', 'irq-urgent-for-linus' and... · 965c4b7e
      Linus Torvalds authored
      Merge branches 'core-urgent-for-linus', 'irq-urgent-for-linus' and 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
      
      Pull objtool, irq and scheduler fixes from Ingo Molnar:
       "One more objtool fixlet for GCC6 code generation patterns, an irq
        DocBook fix and an unused variable warning fix in the scheduler"
      
      * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        objtool: Fix rare switch jump table pattern detection
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        doc: Add missing parameter for msi_setup
      
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/fair: Remove unused but set variable 'rq'
      965c4b7e
    • Vineet Gupta's avatar
      ARC: module: print pretty section names · b75dcd9c
      Vineet Gupta authored
      Now that we have referece to section name string table in
      apply_relocate_add(), use it to
      
       - print the name of section being relocated
       - print symbol with NULL name (since it refers to a section)
      
      before
      
      | Section to fixup 7000a060
      | =========================================================
      | rela->r_off | rela->addend | sym->st_value | ADDR | VALUE
      | =========================================================
      |	1c		0		7000e000  7000a07c 7000e000 []
      |	40		0		7000a000  7000a0a0 7000a000 []
      
      after
      
      | Section to fixup .eh_frame @7000a060
      | =========================================================
      | r_off	r_add	st_value ADDRESS  VALUE
      | =========================================================
      |    1c	0	7000e000 7000a07c 7000e000 [.init.text]
      |    40	0	7000a000 7000a0a0 7000a000 [.exit.text]
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      b75dcd9c
    • Vineet Gupta's avatar
      ARC: module: elide loop to save reference to .eh_frame · d65283f7
      Vineet Gupta authored
      The loop was really needed in .debug_frame regime where wanted make it
      as SH_ALLOC so that apply_relocate_add() would process it. That's not
      needed for .eh_frame, so we check this in apply_relocate_add() which
      gets called for each section.
      
      Note that we need to save reference to "section name strings" section in
      module_frob_arch_sections() since apply_relocate_add() doesn't get that
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      d65283f7
    • Vineet Gupta's avatar
      ARC: mm: retire ARC_DBG_TLB_MISS_COUNT... · f644e368
      Vineet Gupta authored
      ... given that we have perf counters abel to do the same thing non
      intrusively
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      f644e368
    • Vineet Gupta's avatar
      ARC: build: retire old toggles · c3005475
      Vineet Gupta authored
      These are really ancient toggles and tools no longer require them to be
      passed. This paves way for deprecating them in long run.
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      c3005475
    • Vineet Gupta's avatar
      ARC: boot log: refactor cpu name/release printing · d975cbc8
      Vineet Gupta authored
      The motivation is to identify ARC750 vs. ARC770 (we currently print
      generic "ARC700").
      
      A given ARC700 release could be 750 or 770, with same ARCNUM (or family
      identifier which is unfortunate). The existing arc_cpu_tbl[] kept a single
      concatenated string for core name and release which thus doesn't work
      for 750 vs. 770 identification.
      
      So split this into 2 tables, one with core names and other with release.
      And while we are at it, get rid of the range checking for family numbers.
      We just document the known to exist cores running Linux and ditch
      others.
      
      With this in place, we add detection of ARC750 which is
       - cores 0x33 and before
       - cores 0x34 and later with MMUv2
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      d975cbc8
    • Vineet Gupta's avatar
    • Vineet Gupta's avatar
      ARC: boot log: don't assume SWAPE instruction support · a024fd9b
      Vineet Gupta authored
      This came to light when helping a customer with oldish ARC750 core who
      were getting instruction errors because of lack of SWAPE but boot log
      was incorrectly printing it as being present
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      a024fd9b
    • Vineet Gupta's avatar
      ARC: boot log: refactor printing abt features not captured in BCRs · 73e284d2
      Vineet Gupta authored
      On older arc700 cores, some of the features configured were not present
      in Build config registers. To print about them at boot, we just use the
      Kconfig option i.e. whether linux is built to use them or not.
      So yes this seems bogus, but what else can be done. Moreover if linux is
      booting with these enabled, then the Kconfig info is a good indicator
      anyways.
      
      Over time these "hacks" accumulated in read_arc_build_cfg_regs() as well
      as arc_cpu_mumbojumbo(). so refactor and move all of those in a single
      place: read_arc_build_cfg_regs(). This causes some code redcution too:
      
      | bloat-o-meter2 arch/arc/kernel/setup.o.0 arch/arc/kernel/setup.o.1
      | add/remove: 0/0 grow/shrink: 2/1 up/down: 64/-132 (-68)
      | function                                     old     new   delta
      | setup_processor                              610     670     +60
      | cpuinfo_arc700                                76      80      +4
      | arc_cpu_mumbojumbo                           752     620    -132
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      73e284d2
    • Linus Torvalds's avatar
      Merge branch 'for-linus-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · f6167514
      Linus Torvalds authored
      Pull btrfs fixes from Chris Mason:
       "My patch fixes the btrfs list_head abuse that we tracked down during
        Dave Jones' memory corruption investigation. With both Jens and my
        patches in place, I'm no longer able to trigger problems.
      
        Filipe is fixing a difficult old bug between snapshots, balance and
        send. Dave is cooking a few more for the next rc, but these are tested
        and ready"
      
      * 'for-linus-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
        btrfs: fix races on root_log_ctx lists
        btrfs: fix incremental send failure caused by balance
      f6167514
    • Vineet Gupta's avatar
      ARCv2: boot log: print IOC exists as well as enabled status · 711c1f26
      Vineet Gupta authored
      Previously we would not print the case when IOC existed but was not
      enabled.
      
      And while at it, reduce one line off boot printing by consolidating
      the Peripheral address space and IO-Coherency which in a way
      applies to them
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      711c1f26
    • Linus Torvalds's avatar
      Merge tag 'sound-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 2cd0b50a
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "This contains the usual stuff -- the fixups and quirks for HD-audio
        and USB-audio, in addition to a bad regression fix in ALSA sequencer
        timer since 4.8, and a trivial fix for asihpi PCI driver"
      
      * tag 'sound-4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: usb-audio: Add quirk for Syntek STK1160
        ALSA: seq: Fix time account regression
        ALSA: hda - Fix surround output pins for ASRock B150M mobo
        ALSA: hda - Fix headset mic detection problem for two Dell laptops
        ALSA: asihpi: fix kernel memory disclosure
        ALSA: hda - Adding a new group of pin cfg into ALC295 pin quirk table
        ALSA: hda - allow 40 bit DMA mask for NVidia devices
      2cd0b50a
    • Linus Torvalds's avatar
      Merge tag 'drm-x86-pat-regression-fix' of git://people.freedesktop.org/~airlied/linux · bdb52084
      Linus Torvalds authored
      Pull drm x86/pat regression fixes from Dave Airlie:
       "This is a standalone pull request for the fix for a regression
        introduced in -rc1 by a change to vm_insert_mixed to start using the
        PAT range tracking to validate page protections. With this fix in
        place, all the VRAM mappings for GPU drivers ended up at UC instead of
        WC.
      
        There are probably better ways to fix this long term, but nothing I'd
        considered for -fixes that wouldn't need more settling in time. So
        I've just created a new arch API that the drivers can reserve all
        their VRAM aperture ranges as WC"
      
      * tag 'drm-x86-pat-regression-fix' of git://people.freedesktop.org/~airlied/linux:
        drm/drivers: add support for using the arch wc mapping API.
        x86/io: add interface to reserve io memtype for a resource range. (v1.1)
      bdb52084
    • Linus Torvalds's avatar
      Merge tag 'dm-4.9-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm · e0f3e6a7
      Linus Torvalds authored
      Pull device mapper fixes from Mike Snitzer:
      
       - a couple DM raid and DM mirror fixes
      
       - a couple .request_fn request-based DM NULL pointer fixes
      
       - a fix for a DM target reference count leak, on target load error,
         that prevented associated DM target kernel module(s) from being
         removed
      
      * tag 'dm-4.9-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
        dm table: fix missing dm_put_target_type() in dm_table_add_target()
        dm rq: clear kworker_task if kthread_run() returned an error
        dm: free io_barrier after blk_cleanup_queue call
        dm raid: fix activation of existing raid4/10 devices
        dm mirror: use all available legs on multiple failures
        dm mirror: fix read error on recovery after default leg failure
        dm raid: fix compat_features validation
      e0f3e6a7
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security · 43937003
      Linus Torvalds authored
      Pull key fixes from James Morris:
      
       - fix a buffer overflow when displaying /proc/keys [CVE-2016-7042].
      
       - fix broken initialisation in the big_key implementation that can
         result in an oops.
      
       - make big_key depend on having a random number generator available in
         Kconfig.
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
        security/keys: make BIG_KEYS dependent on stdrng.
        KEYS: Sort out big_key initialisation
        KEYS: Fix short sprintf buffer in /proc/keys show function
      43937003
    • Rob Herring's avatar
      tty: serial_core: fix NULL struct tty pointer access in uart_write_wakeup · d0f4bce2
      Rob Herring authored
      Since commit 761ed4a9 ("tty: serial_core: convert uart_close to
      use tty_port_close"), the serial console is broken on various systems
      and typing "reboot" splats the following on the serial console:
      
      INIT: Sending p[  427.863916] BUG: unable to handle kernel NULL pointer dereference at 00000000000001e0
      [  427.885156] IP: [] tty_wakeup+0xc/0x70
      [  427.898337] PGD 0 [  427.902051]
      [  427.907498] Oops: 0000 [#1] PREEMPT SMP
      [  427.917635] Modules linked in: nfsv3 nfs_acl nfs fscache lockd
      sunrpc grace edd af_packet cpufreq_conservative cpufreq_userspace
      cpufreq_powersave fuse loop md_mod dm_mod joydev hid_generic usbhid
      ipmi_ssif ohci_pci ohci_hcd ehci_pci ehci_hcd e1000e ptp firewire_ohci
      edac_core pps_core tpm_infineon sp5100_tco firewire_core acpi_cpufreq
      serio_raw pcspkr fjes usbcore shpchp edac_mce_amd tpm_tis ipmi_si
      tpm_tis_core i2c_piix4 k10temp sg ipmi_msghandler tpm sr_mod button
      cdrom kvm_amd kvm irqbypass crc_itu_t ast ttm drm_kms_helper drm
      fb_sys_fops sysimgblt sysfillrect syscopyarea i2c_algo_bit scsi_dh_rdac
      scsi_dh_alua scsi_dh_emc scsi_dh_hp_sw ata_generic pata_atiixp
      [  428.054179] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.9.0-rc1-1.g73e3f23-default #1
      [  428.072868] Hardware name: System manufacturer System Product Name/KGP(M)E-D16, BIOS 0902    12/03/2010
      [  428.094755] task: ffffffffa2c0d500 task.stack: ffffffffa2c00000
      [  428.109717] RIP: 0010:[]  [] tty_wakeup+0xc/0x70
      [  428.128407] RSP: 0018:ffff9a1a5fc03df8  EFLAGS: 00010086
      [  428.142184] RAX: ffff9a1857258000 RBX: ffffffffa3050ea0 RCX: 0000000000000000
      [  428.159649] RDX: 000000000000001b RSI: 0000000000000000 RDI: 0000000000000000
      [  428.177109] RBP: ffff9a1a5fc03e08 R08: 0000000000000000 R09: 0000000000000000
      [  428.194547] R10: 0000000000021c77 R11: 0000000000000000 R12: ffff9a1857258000
      [  428.212002] R13: 0000000000000000 R14: 0000000000000020 R15: 0000000000000020
      [  428.229481] FS:  0000000000000000(0000) GS:ffff9a1a5fc00000(0000) knlGS:0000000000000000
      [  428.248938] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  428.263726] CR2: 00000000000001e0 CR3: 0000000390c06000 CR4: 00000000000006f0
      [  428.281331] Stack:
      [  428.288696]  ffffffffa3050ea0 ffff9a1857258000 ffff9a1a5fc03e18 ffffffffa24e0ab1
      [  428.307064]  ffff9a1a5fc03e40 ffffffffa24e8865 ffffffffa3050ea0 00000000000000c2
      [  428.325456]  0000000000000046 ffff9a1a5fc03e78 ffffffffa24e8a5f ffffffffa3050ea0
      [  428.343905] Call Trace:
      [  428.352319]   [  428.356216]  [] uart_write_wakeup+0x21/0x30
      
      The problem is for console ports, the serial port is not shutdown and
      interrupts may fire after the struct tty is gone. Simply calling the
      tty_port helper tty_port_tty_wakeup instead of tty_wakeup directly will
      ensure there is a valid struct tty.
      
      Fixes: 761ed4a9 ("tty: serial_core: convert uart_close to use tty_port_close")
      Reported-by: default avatarBorislav Petkov <bp@alien8.de>
      Reported-by: default avatarMike Galbraith <mgalbraith@suse.de>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: linux-serial@vger.kernel.org
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d0f4bce2
    • Geert Uytterhoeven's avatar
      tty: serial_core: Fix serial console crash on port shutdown · 4dda864d
      Geert Uytterhoeven authored
      The port->console flag is always false, as uart_console() is called
      before the serial console has been registered.
      
      Hence for a serial port used as the console, uart_tty_port_shutdown()
      will still be called when userspace closes the port, powering it down.
      This may lead to a system lock up when the serial console driver writes
      to the serial port's registers.
      
      To fix this, move the setting of port->console after the call to
      uart_configure_port(), which registers the serial console.
      
      Fixes: 761ed4a9 ("tty: serial_core: convert uart_close to use tty_port_close")
      Reported-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Tested-by: default avatarMugunthan V N <mugunthanvnm@ti.com>
      Tested-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      [robh: rebased on tty-linus]
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4dda864d
    • Richard Genoud's avatar
      tty/serial: at91: fix hardware handshake on Atmel platforms · 9bcffe75
      Richard Genoud authored
      After commit 1cf6e8fc ("tty/serial: at91: fix RTS line management
      when hardware handshake is enabled"), the hardware handshake wasn't
      functional anymore on Atmel platforms (beside SAMA5D2).
      
      To understand why, one has to understand the flag ATMEL_US_USMODE_HWHS
      first:
      Before commit 1cf6e8fc ("tty/serial: at91: fix RTS line management
      when hardware handshake is enabled"), this flag was never set.
      Thus, the CTS/RTS where only handled by serial_core (and everything
      worked just fine).
      
      This commit introduced the use of the ATMEL_US_USMODE_HWHS flag,
      enabling it for all boards when the user space enables flow control.
      
      When the ATMEL_US_USMODE_HWHS is set, the Atmel USART controller
      handles a part of the flow control job:
      - disable the transmitter when the CTS pin gets high.
      - drive the RTS pin high when the DMA buffer transfer is completed or
        PDC RX buffer full or RX FIFO is beyond threshold. (depending on the
        controller version).
      
      NB: This feature is *not* mandatory for the flow control to work.
      (Nevertheless, it's very useful if low latencies are needed.)
      
      Now, the specifics of the ATMEL_US_USMODE_HWHS flag:
      
      - For platforms with DMAC and no FIFOs (sam9x25, sam9x35, sama5D3,
      sama5D4, sam9g15, sam9g25, sam9g35)* this feature simply doesn't work.
      ( source: https://lkml.org/lkml/2016/9/7/598 )
      Tested it on sam9g35, the RTS pins always stays up, even when RXEN=1
      or a new DMA transfer descriptor is set.
      => ATMEL_US_USMODE_HWHS must not be used for those platforms
      
      - For platforms with a PDC (sam926{0,1,3}, sam9g10, sam9g20, sam9g45,
      sam9g46)*, there's another kind of problem. Once the flag
      ATMEL_US_USMODE_HWHS is set, the RTS pin can't be driven anymore via
      RTSEN/RTSDIS in USART Control Register. The RTS pin can only be driven
      by enabling/disabling the receiver or setting RCR=RNCR=0 in the PDC
      (Receive (Next) Counter Register).
      => Doing this is beyond the scope of this patch and could add other
      bugs, so the original (and working) behaviour should be set for those
      platforms (meaning ATMEL_US_USMODE_HWHS flag should be unset).
      
      - For platforms with a FIFO (sama5d2)*, the RTS pin is driven according
      to the RX FIFO thresholds, and can be also driven by RTSEN/RTSDIS in
      USART Control Register. No problem here.
      (This was the use case of commit 1cf6e8fc ("tty/serial: at91: fix
      RTS line management when hardware handshake is enabled"))
      NB: If the CTS pin declared as a GPIO in the DTS, (for instance
      cts-gpios = <&pioA PIN_PB31 GPIO_ACTIVE_LOW>), the transmitter will be
      disabled.
      => ATMEL_US_USMODE_HWHS flag can be set for this platform ONLY IF the
      CTS pin is not a GPIO.
      
      So, the only case when ATMEL_US_USMODE_HWHS can be enabled is when
      (atmel_use_fifo(port) &&
       !mctrl_gpio_to_gpiod(atmel_port->gpios, UART_GPIO_CTS))
      
      Tested on all Atmel USART controller flavours:
      AT91SAM9G35-CM (DMAC flavour), AT91SAM9G20-EK (PDC flavour),
      SAMA5D2xplained (FIFO flavour).
      
      * the list may not be exhaustive
      
      Cc: <stable@vger.kernel.org> #4.4+ (beware, missing atmel_port variable)
      Fixes: 1cf6e8fc ("tty/serial: at91: fix RTS line management when hardware handshake is enabled")
      Signed-off-by: default avatarRichard Genoud <richard.genoud@gmail.com>
      Acked-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
      Acked-by: default avatarCyrille Pitchen <cyrille.pitchen@atmel.com>
      Acked-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9bcffe75
    • Imre Palik's avatar
      perf/x86/intel: Honour the CPUID for number of fixed counters in hypervisors · f92b7604
      Imre Palik authored
      perf doesn't seem to honour the number of fixed counters specified by CPUID
      leaf 0xa. It always assumes that Intel CPUs have at least 3 fixed counters.
      
      So if some of the fixed counters are masked out by the hypervisor, it still
      tries to check/set them.
      
      This patch makes perf behave nicer when the kernel is running under a
      hypervisor that doesn't expose all the counters.
      
      This patch contains some ideas from Matt Wilson.
      Signed-off-by: default avatarImre Palik <imrep@amazon.de>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Reviewed-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Alexander Kozyrev <alexander.kozyrev@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Artyom Kuanbekov <artyom.kuanbekov@intel.com>
      Cc: David Carrillo-Cisneros <davidcc@google.com>
      Cc: David Woodhouse <dwmw@amazon.co.uk>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Matt Wilson <msw@amazon.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/1477037939-15605-1-git-send-email-imrep.amz@gmail.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      f92b7604
    • Jiri Olsa's avatar
      perf/powerpc: Don't call perf_event_disable() from atomic context · 5aab90ce
      Jiri Olsa authored
      The trinity syscall fuzzer triggered following WARN() on powerpc:
      
        WARNING: CPU: 9 PID: 2998 at arch/powerpc/kernel/hw_breakpoint.c:278
        ...
        NIP [c00000000093aedc] .hw_breakpoint_handler+0x28c/0x2b0
        LR [c00000000093aed8] .hw_breakpoint_handler+0x288/0x2b0
        Call Trace:
        [c0000002f7933580] [c00000000093aed8] .hw_breakpoint_handler+0x288/0x2b0 (unreliable)
        [c0000002f7933630] [c0000000000f671c] .notifier_call_chain+0x7c/0xf0
        [c0000002f79336d0] [c0000000000f6abc] .__atomic_notifier_call_chain+0xbc/0x1c0
        [c0000002f7933780] [c0000000000f6c40] .notify_die+0x70/0xd0
        [c0000002f7933820] [c00000000001a74c] .do_break+0x4c/0x100
        [c0000002f7933920] [c0000000000089fc] handle_dabr_fault+0x14/0x48
      
      Followed by a lockdep warning:
      
        ===============================
        [ INFO: suspicious RCU usage. ]
        4.8.0-rc5+ #7 Tainted: G        W
        -------------------------------
        ./include/linux/rcupdate.h:556 Illegal context switch in RCU read-side critical section!
      
        other info that might help us debug this:
      
        rcu_scheduler_active = 1, debug_locks = 0
        2 locks held by ls/2998:
         #0:  (rcu_read_lock){......}, at: [<c0000000000f6a00>] .__atomic_notifier_call_chain+0x0/0x1c0
         #1:  (rcu_read_lock){......}, at: [<c00000000093ac50>] .hw_breakpoint_handler+0x0/0x2b0
      
        stack backtrace:
        CPU: 9 PID: 2998 Comm: ls Tainted: G        W       4.8.0-rc5+ #7
        Call Trace:
        [c0000002f7933150] [c00000000094b1f8] .dump_stack+0xe0/0x14c (unreliable)
        [c0000002f79331e0] [c00000000013c468] .lockdep_rcu_suspicious+0x138/0x180
        [c0000002f7933270] [c0000000001005d8] .___might_sleep+0x278/0x2e0
        [c0000002f7933300] [c000000000935584] .mutex_lock_nested+0x64/0x5a0
        [c0000002f7933410] [c00000000023084c] .perf_event_ctx_lock_nested+0x16c/0x380
        [c0000002f7933500] [c000000000230a80] .perf_event_disable+0x20/0x60
        [c0000002f7933580] [c00000000093aeec] .hw_breakpoint_handler+0x29c/0x2b0
        [c0000002f7933630] [c0000000000f671c] .notifier_call_chain+0x7c/0xf0
        [c0000002f79336d0] [c0000000000f6abc] .__atomic_notifier_call_chain+0xbc/0x1c0
        [c0000002f7933780] [c0000000000f6c40] .notify_die+0x70/0xd0
        [c0000002f7933820] [c00000000001a74c] .do_break+0x4c/0x100
        [c0000002f7933920] [c0000000000089fc] handle_dabr_fault+0x14/0x48
      
      While it looks like the first WARN() is probably valid, the other one is
      triggered by disabling event via perf_event_disable() from atomic context.
      
      The event is disabled here in case we were not able to emulate
      the instruction that hit the breakpoint. By disabling the event
      we unschedule the event and make sure it's not scheduled back.
      
      But we can't call perf_event_disable() from atomic context, instead
      we need to use the event's pending_disable irq_work method to disable it.
      Reported-by: default avatarJan Stancek <jstancek@redhat.com>
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Huang Ying <ying.huang@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michael Neuling <mikey@neuling.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20161026094824.GA21397@kravaSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      5aab90ce
    • Jiri Olsa's avatar
      perf/core: Protect PMU device removal with a 'pmu_bus_running' check, to fix... · 0933840a
      Jiri Olsa authored
      perf/core: Protect PMU device removal with a 'pmu_bus_running' check, to fix CONFIG_DEBUG_TEST_DRIVER_REMOVE=y kernel panic
      
      CAI Qian reported a crash in the PMU uncore device removal code,
      enabled by the CONFIG_DEBUG_TEST_DRIVER_REMOVE=y option:
      
        https://marc.info/?l=linux-kernel&m=147688837328451
      
      The reason for the crash is that perf_pmu_unregister() tries to remove
      a PMU device which is not added at this point. We add PMU devices
      only after pmu_bus is registered, which happens in the
      perf_event_sysfs_init() call and sets the 'pmu_bus_running' flag.
      
      The fix is to get the 'pmu_bus_running' flag state at the point
      the PMU is taken out of the PMU list and remove the device
      later only if it's set.
      Reported-by: default avatarCAI Qian <caiqian@redhat.com>
      Tested-by: default avatarCAI Qian <caiqian@redhat.com>
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20161020111011.GA13361@kravaSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      0933840a
    • Borislav Petkov's avatar
      x86/microcode/AMD: Fix more fallout from CONFIG_RANDOMIZE_MEMORY=y · 1c27f646
      Borislav Petkov authored
      We needed the physical address of the container in order to compute the
      offset within the relocated ramdisk. And we did this by doing __pa() on
      the virtual address.
      
      However, __pa() does checks whether the physical address is within
      PAGE_OFFSET and __START_KERNEL_map - see __phys_addr() - which fail
      if we have CONFIG_RANDOMIZE_MEMORY enabled: we feed a virtual address
      which *doesn't* have the randomization offset into a function which uses
      PAGE_OFFSET which *does* have that offset.
      
      This makes this check fire:
      
      	VIRTUAL_BUG_ON((x > y) || !phys_addr_valid(x));
      			^^^^^^
      
      due to the randomization offset.
      
      The fix is as simple as using __pa_nodebug() because we do that
      randomization offset accounting later in that function ourselves.
      Reported-by: default avatarBob Peterson <rpeterso@redhat.com>
      Tested-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: Andreas Gruenbacher <agruenba@redhat.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mel Gorman <mgorman@techsingularity.net>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-mm <linux-mm@kvack.org>
      Cc: stable@vger.kernel.org # 4.9
      Link: http://lkml.kernel.org/r/20161027123623.j2jri5bandimboff@pd.tnicSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      1c27f646
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 14970f20
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "20 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        drivers/misc/sgi-gru/grumain.c: remove bogus 0x prefix from printk
        cris/arch-v32: cryptocop: print a hex number after a 0x prefix
        ipack: print a hex number after a 0x prefix
        block: DAC960: print a hex number after a 0x prefix
        fs: exofs: print a hex number after a 0x prefix
        lib/genalloc.c: start search from start of chunk
        mm: memcontrol: do not recurse in direct reclaim
        CREDITS: update credit information for Martin Kepplinger
        proc: fix NULL dereference when reading /proc/<pid>/auxv
        mm: kmemleak: ensure that the task stack is not freed during scanning
        lib/stackdepot.c: bump stackdepot capacity from 16MB to 128MB
        latent_entropy: raise CONFIG_FRAME_WARN by default
        kconfig.h: remove config_enabled() macro
        ipc: account for kmem usage on mqueue and msg
        mm/slab: improve performance of gathering slabinfo stats
        mm: page_alloc: use KERN_CONT where appropriate
        mm/list_lru.c: avoid error-path NULL pointer deref
        h8300: fix syscall restarting
        kcov: properly check if we are in an interrupt
        mm/slab: fix kmemcg cache creation delayed issue
      14970f20