summaryrefslogtreecommitdiff
path: root/arch
AgeCommit message (Collapse)Author
2017-06-18Merge tag 'arm-soc/for-4.13/devicetree-arm64' of ↵Olof Johansson
http://github.com/Broadcom/stblinux into next/dt64 This pull request contains Broadcom ARM64-based SoCs Device Tree changes for 4.13. Please note the following from Eric: I've based this summary on the bcm2835-dt-next tag, to clarify what's in this patch series, but it does require being careful since it involves a cross-merge between branches. - Anup documents the Broadcom Stingray binding, common clocks, adds initial support for the Stingray DTSI and DTS files and adds support for the PL022, PL330 and SP805 - Sandeep adds the clock nodes to the Stingray Device Tree nodes - Pramod adds support for the NAND, pinctrl, GPIO to the Stingray Device Tree nodes - Oza adds I2C Device Tree nodes to the Stingray DTSes - Srinath adds PWM and SDHCI Device Tree nodes for the Stingray SoC - Ravijeta adds support for the USB Dual Role PHY on Northstar 2 - Gerd starts adding references to the sdhost and sdhci controllers, and then switches the sdcard to to use the SDHOST (faster than SDHCI) - Stefan defines the BCM2837 thermal coefficients in order for the Raspberry Pi thermal driver to work correctly * tag 'arm-soc/for-4.13/devicetree-arm64' of http://github.com/Broadcom/stblinux: arm64: dts: NS2: Add USB DRD PHY device tree node ARM64: dts: bcm2837: Define CPU thermal coefficients arm64: dts: Add PWM and SDHCI DT nodes for Stingray SOC arm64: dts: Add PL022, PL330 and SP805 DT nodes for Stingray arm64: dts: Add I2C DT nodes for Stingray SoC arm64: dts: Add GPIO DT nodes for Stingray SOC arm64: dts: Add pinctrl DT nodes for Stingray SOC arm64: dts: Add NAND DT nodes for Stingray SOC arm64: dts: Add clock DT nodes for Stingray SOC arm64: dts: Initial DTS files for Broadcom Stingray SOC dt-bindings: clk: Extend binding doc for Stingray SOC dt-bindings: bcm: Add Broadcom Stingray bindings document ARM: dts: bcm283x: switch from &sdhci to &sdhost arm64: dts: bcm2837: add &sdhci and &sdhost ARM: dts: bcm283x: Add CPU thermal zone with 1 trip point ARM: dts: Add devicetree for the Raspberry Pi 3, for arm32 (v6) Signed-off-by: Olof Johansson <olof@lixom.net>
2017-06-18Merge tag 'uniphier-dt64-v4.13' of ↵Olof Johansson
git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier into next/dt64 UniPhier ARM64 SoC DT updates for v4.13 - specify timing delay properties of eMMC - fix W=1 build warnings - increase memory reserve size - use SPDX License Identifier - add new board support (LD11/LD20 global) * tag 'uniphier-dt64-v4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier: arm64: dts: uniphier: add support for LD20 Global board arm64: dts: uniphier: add support for LD11 Global board arm64: dts: uniphier: use SPDX-License-Identifier arm64: dts: uniphier: reserve more memory for LD11/LD20 arm64: dts: uniphier: fix simple-bus unit address format error arm64: dts: uniphier: Use - instead of @ for DT OPP entries arm64: dts: uniphier: add cdns, phy-dll-delay-sdclk(-hsmmc) for eMMC arm64: dts: uniphier: add input-delay properties to Cadence eMMC node Signed-off-by: Olof Johansson <olof@lixom.net>
2017-06-18Merge tag 'v4.12-next-dts64' of https://github.com/mbgg/linux-mediatek into ↵Olof Johansson
next/dt64 Add device tree nodes for mt8173: - split USB SuperSpeed port in HighSpeed and SuperSpeed ports. - move USB phy clocks up in hierarchy to met new bindings description - move MDP nodes up in hierarchy to met new bindings description mt6797: - add basic SoC support - add clock driver - add power domain dt-bindings: - clean-up i2c binding description - add binding for mt2701 i2c node - add fallback compatible to scpsys binding description - add bindings description for mt7622 and mt6796 * tag 'v4.12-next-dts64' of https://github.com/mbgg/linux-mediatek: dt-bindings: mediatek: add bindings for MediaTek MT7622 SoC arm64: dts: mt8173: Fix mdp device tree dt-bindings: i2c: Add Mediatek MT2701 i2c binding dt-bindings: i2c-mtk: Add mt7623 binding dt-bindings: i2c-mtk: Delete bindings dt-bindings: i2c-mt6577: Rename file to reflect bindings dt-bindings: mtk-sysirq: Correct bindings for supported SoCs arm64: dts: mediatek: add clk and scp nodes for MT6797 dt-bindings: mediatek: add MT6797 power dt-bindings arm64: dts: mediatek: add mt6797 support dt-bindings: mediatek: Add bindings for mediatek MT6797 Platform arm64: dts: mt8173: move clock from phy node into port nodes arm64: dts: mt8173: split usb SuperSpeed port into two ports Signed-off-by: Olof Johansson <olof@lixom.net>
2017-06-18Merge tag 'samsung-dt64-4.13' of ↵Olof Johansson
git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into next/dt64 Samsung DeviceTree ARM64 update for v4.13: 1. Remove unneeded TE interrupt gpio property. * tag 'samsung-dt64-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: arm64: dts: exynos: Remove the te-gpios property in the TM2 boards Signed-off-by: Olof Johansson <olof@lixom.net>
2017-06-18Merge tag 'v4.13-rockchip-dts64-1' of ↵Olof Johansson
git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into next/dt64 Support for the new rk3399 firefly board; extending the pcie ranges to make usage of pci switches possible; some more qos and pinctrl nodes on rk3399; updates for the rk3399 cpu operating points including separate opps for the higher rates OP1 variant of the chip and mmc-nodes for the rk3328. * tag 'v4.13-rockchip-dts64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: arm64: dts: rockchip: update common rk3399 operating points arm64: dts: rockchip: introduce rk3399-op1 operating points arm64: dts: rockchip: enable usb3 controllers on rk3399-firefly arm64: dts: rockchip: add ethernet0 alias on rk3399 arm64: dts: rockchip: bring rk3399-firefly power-tree in line arm64: dts: rockchip: add sdmmc/sdio/emmc nodes for RK3328 SoCs arm64: dts: rockchip: extent IORESOURCE_MEM_64 of PCIe for rk3399 arm64: dts: rockchip: extent bus-ranges of PCIe for rk3399 arm64: dts: rockchip: add pinctrl settings for some rk3399 peripherals arm64: dts: rockchip: add some missing qos nodes on rk3399 arm64: dts: rockchip: add support for firefly-rk3399 board dt-bindings: add firefly-rk3399 board support Signed-off-by: Olof Johansson <olof@lixom.net>
2017-06-13Merge tag 'bcm2835-dt-64-next-2017-06-08' into devicetree-arm64/nextFlorian Fainelli
This pull request brings in the switch to sdhost for MMC on RPi3 (improving storage performance and leaving sdhci for wireless), and the correct CPU thermal coefficients. The thermal changes required a merge from bcm2835-dt-next, where the nodes were added. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2017-06-13arm64: dts: uniphier: add support for LD20 Global boardKunihiko Hayashi
Add initial device tree support for LD20 Global board. Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-06-13arm64: dts: uniphier: add support for LD11 Global boardKunihiko Hayashi
Add initial device tree support for LD11 Global board. Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-06-08arm64: dts: NS2: Add USB DRD PHY device tree nodeRaviteja Garimella
This patch adds device tree node for USB Dual Role Device PHY for Broadcom's Northstar2 SoC. Signed-off-by: Raviteja Garimella <raviteja.garimella@broadcom.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2017-06-08ARM64: dts: bcm2837: Define CPU thermal coefficientsStefan Wahren
This defines the bcm2837 SoC specific thermal coefficients in order to initialize the thermal driver correctly. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Eduardo Valentin <edubezval@gmail.com>
2017-06-08Merge tag 'bcm2835-dt-next-2017-06-08' into bcm2835-dt-64-nextEric Anholt
This merge brings in the cpu-thermal node we in bcm283x that we need in order to set the rpi3's coefficients.
2017-06-08arm64: dts: mt8173: Fix mdp device treeDaniel Kurtz
If the mdp_* nodes are under an mdp sub-node, their corresponding platform device does not automatically get its iommu assigned properly. Fix this by moving the mdp component nodes up a level such that they are siblings of mdp and all other SoC subsystems. This also simplifies the device tree. Although it fixes iommu assignment issue, it also break compatibility with old device tree. So, the patch in driver is needed to iterate over sibling mdp device nodes, not child ones, to keep driver work properly. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Minghsiu Tsai <minghsiu.tsai@mediatek.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
2017-06-08arm64: dts: uniphier: use SPDX-License-IdentifierMasahiro Yamada
Follow the recent trend for the license description, and fix the wrongly stated X11 to MIT. The X11 license text [1] is explicitly for the X Consortium and has a couple of extra clauses. The MIT license text [2] is actually what the current DT files claim. [1] https://spdx.org/licenses/X11.html [2] https://spdx.org/licenses/MIT.html Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-06-08arm64: dts: uniphier: reserve more memory for LD11/LD20Masahiro Yamada
Reserve enough space below the kernel base. The assumed address map is: 80000000 - 80ffffff : for IPP 81000000 - 81ffffff : for ARM secure 82000000 - : for Linux Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-06-05arm64: dts: Add PWM and SDHCI DT nodes for Stingray SOCSrinath Mannam
The Stingray SoC has two instances of SDHCI controller and one instance of iProc PWM. Let's enable above mentioned devices in Stingray DT. Signed-off-by: Srinath Mannam <srinath.mannam@broadcom.com> Signed-off-by: Anup Patel <anup.patel@broadcom.com> Reviewed-by: Ray Jui <ray.jui@broadcom.com> Reviewed-by: Scott Branden <scott.branden@broadcom.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2017-06-05arm64: dts: Add PL022, PL330 and SP805 DT nodes for StingrayAnup Patel
We have two instance of PL022 SPI controllers, one instance of DMA PL330, and one non-secure SP805 Watchdog on Stingray SOC. This patch adds DT nodes for the above mentioned devices in Stingray DT. Signed-off-by: Anup Patel <anup.patel@broadcom.com> Reviewed-by: Pramod KUMAR <pramod.kumar@broadcom.com> Reviewed-by: Ray Jui <rjui@broadcom.com> Reviewed-by: Scott Branden <sbranden@broadcom.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2017-06-05arm64: dts: Add I2C DT nodes for Stingray SoCOza Pawandeep
This patch adds I2C DT nodes on Stingray SoC. Signed-off-by: Oza Pawandeep <oza.oza@broadcom.com> Reviewed-by: Vikram Prakash <vikram.prakash@broadcom.com> Reviewed-by: Ray Jui <ray.jui@broadcom.com> Reviewed-by: Scott Branden <scott.branden@broadcom.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2017-06-05arm64: dts: Add GPIO DT nodes for Stingray SOCPramod Kumar
The GPIOs on Stingray SOC are based on iProc GPIOs hence using this we add GPIO DT nodes for Stingray SOC. Signed-off-by: Pramod Kumar <pramodku@broadcom.com> Reviewed-by: Ray Jui <rjui@broadcom.com> Reviewed-by: Scott Branden <sbranden@broadcom.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2017-06-05arm64: dts: Add pinctrl DT nodes for Stingray SOCPramod Kumar
This patch adds pinctrl and pinmux related DT nodes for Stingray SOC. For manageability, pinctrl and pinmum DT nodes are added as separate DTSi file and included in main DTSi file. Signed-off-by: Pramod Kumar <pramod.kumar@broadcom.com> Signed-off-by: Anup Patel <anup.patel@broadcom.com> Reviewed-by: Ray Jui <ray.jui@broadcom.com> Reviewed-by: Vikram Prakash <vikram.prakash@broadcom.com> Reviewed-by: Scott Branden <scott.branden@broadcom.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2017-06-05arm64: dts: Add NAND DT nodes for Stingray SOCPramod Kumar
This patch adds NAND controller DT Node and NAND chip DT node for Stingray SOC and Stingray reference boards. Signed-off-by: Pramod Kumar <pramod.kumar@broadcom.com> Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com> Reviewed-by: Vikram Prakash <vikram.prakash@broadcom.com> Reviewed-by: Ray Jui <ray.jui@broadcom.com> Reviewed-by: Scott Branden <scott.branden@broadcom.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2017-06-05arm64: dts: Add clock DT nodes for Stingray SOCSandeep Tripathy
This patch describes Stingray SOC clock tree using DT nodes in Stingray DTS. Signed-off-by: Sandeep Tripathy <sandeep.tripathy@broadcom.com> Reviewed-by: Ray Jui <ray.jui@broadcom.com> Reviewed-by: Scott Branden <scott.branden@broadcom.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2017-06-05arm64: dts: Initial DTS files for Broadcom Stingray SOCAnup Patel
The Broadcom Stingray SoC is a new member in Broadcom iProc SoC family. This patch adds initial DTS files for Broadcom Stingray SoC and two of its reference boards (bcm958742k and bcm958742t). We have lot of reference boards and large number of devices in Broadcom Stingray SoC so eventually we will have quite a few DTS files for Stingray. To tackle, we have added a separate directory for Stingray DTS files. Signed-off-by: Anup Patel <anup.patel@broadcom.com> Signed-off-by: Scott Branden <scott.branden@broadcom.com> Reviewed-by: Ray Jui <rjui@broadcom.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2017-06-06arm64: dts: uniphier: fix simple-bus unit address format errorMasahiro Yamada
Compiling the UniPhier DT files with W=1, DTC warns like follows: Warning (simple_bus_reg): Node /soc/smpctrl@59800000 simple-bus unit address format error, expected "59801000" Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-06-06arm64: dts: uniphier: Use - instead of @ for DT OPP entriesViresh Kumar
Compiling the DT file with W=1, DTC warns like follows: Warning (unit_address_vs_reg): Node /opp_table0/opp@1000000000 has a unit name, but no reg property Fix this by replacing '@' with '-' as the OPP nodes will never have a "reg" property. Reported-by: Krzysztof Kozlowski <krzk@kernel.org> Reported-by: Masahiro Yamada <yamada.masahiro@socionext.com> Suggested-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-06-01Merge tag 'realtek-arm64-dt-for-4.12' of git://github.com/afaerber/linux ↵Olof Johansson
into next/dt64 Realtek ARM64 based SoC DT for v4.12 This adds an initial DT for the RTD1295 SoC and a TV box based on it. * tag 'realtek-arm64-dt-for-4.12' of git://github.com/afaerber/linux: ARM64: dts: Add Realtek RTD1295 and Zidoo X9S dt-bindings: arm: Add Realtek RTD1295 bindings dt-bindings: Add vendor prefix for Zidoo Signed-off-by: Olof Johansson <olof@lixom.net>
2017-06-01Merge tag 'renesas-arm64-dt-for-v4.13' of ↵Olof Johansson
https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/dt64 Renesas ARM64 Based SoC DT Updates for v4.13 * Add support for R-Car H3 ES2.0 * Break out common board support * Set drive-strength for ravb pins for r8a7795/h3ulcb and r8a7796/m3ulcb * Enable HDMI outputs on r8a7795/salvator-x * Add R-Car audio to DT of r8a7796 SoC * Add current sense amplifiers to DT of r8a779[56]/salvator-x * Enable NFS-root on r8a7796/salvator-x * Enable HS200 for eMMC on r8a779[56]/salvator-x, r8a7795/h3ulcb and r8a7796/m3ulcb * Enable EthernetAVB, I2C r8a7796/m3ulcb * Update memory node to 2 GiB map on r8a7796/m3ulcb * tag 'renesas-arm64-dt-for-v4.13' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: (35 commits) arm64: dts: r8a7795: salvator-x: Add support for R-Car H3 ES2.0 arm64: dts: r8a7795: Add support for R-Car H3 ES2.0 arm64: dts: ulcb: Set drive-strength for ravb pins arm64: dts: renesas: r8a7795-salvator-x: Enable HDMI outputs arm64: dts: renesas: r8a7795-salvator-x: Add DU external dot clocks arm64: dts: renesas: salvator-x: Add HDMI output connectors arm64: dts: renesas: salvator-x: Add DU external dot clock sources arm64: dts: renesas: r8a7795: Add HDMI encoder support arm64: dts: salvator-x: Add panel backlight support arm64: dts: r8a7796: Add PWM device nodes arm64: dts: r8a7796: add Sound MIX support arm64: dts: r8a7796: add Sound CTU support arm64: dts: r8a7796: add Sound DVC support arm64: dts: r8a7796: add Sound SRC support arm64: dts: r8a7796: add Sound SSI DMA support arm64: dts: r8a7796: add Sound SSI PIO support arm64: dts: r8a7796: add AUDIO_DMAC support arm64: dts: salvator-x: Add current sense amplifiers arm64: dts: renesas: Extract common ULCB board support arm64: dts: renesas: Extract common Salvator-X board support ... Signed-off-by: Olof Johansson <olof@lixom.net>
2017-05-30arm64: dts: rockchip: update common rk3399 operating pointsHeiko Stuebner
The rk3399 has multiple variants with different frequency ratings. The operating points currently in the kernel stem from the op1 variant used in Gru ChromeOS devices and may not be suitable for general rk3399 chips. Therefore bring it back to the official general operating points. Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-05-30arm64: dts: rockchip: introduce rk3399-op1 operating pointsHeiko Stuebner
The OP1 is a rk3399 variant used in ChromeOS devices with a slightly higher frequency rating compared to the regular rk3399, but right now the only available operating points don't match either variant with both needing adjustments to actually fit their specs. Therefore introduce separate operting points, from the ChromeOS kernel, for the OP1 and use it on Gru devices. Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-05-30arm64: dts: rockchip: enable usb3 controllers on rk3399-fireflyHeiko Stuebner
This allows basic usage of usb3 devices but no typec specific things yet. Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-05-30arm64: dts: rockchip: add ethernet0 alias on rk3399Heiko Stuebner
This is used by bootloaders to override the mac address in the devicetree if needed. Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-05-30arm64: dts: rockchip: bring rk3399-firefly power-tree in lineHeiko Stuebner
The power-tree on the rk3399-firefly did not completely match the documentation and vendor devicetree. It was also missing some supply-hirarchy information and some regulator-gpio names did not match the schematics. Fix this for the existing regulators before introducing new things. Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-05-29arm64: dts: rockchip: add sdmmc/sdio/emmc nodes for RK3328 SoCsShawn Lin
This patch adds sdmmc, sdio, emmc nodes for Rockchip RK3328 SoCs. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
2017-05-27Merge tag 'powerpc-4.12-4' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: "Fix running SPU programs on Cell, and a few other minor fixes. Thanks to Alistair Popple, Jeremy Kerr, Michael Neuling, Nicholas Piggin" * tag 'powerpc-4.12-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc: Add PPC_FEATURE userspace bits for SCV and DARN instructions powerpc/spufs: Fix hash faults for kernel regions powerpc: Fix booting P9 hash with CONFIG_PPC_RADIX_MMU=N powerpc/powernv/npu-dma.c: Fix opal_npu_destroy_context() call selftests/powerpc: Fix TM resched DSCR test with some compilers
2017-05-27Merge branch 'x86-urgent-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Thomas Gleixner: "A series of fixes for X86: - The final fix for the end-of-stack issue in the unwinder - Handle non PAT systems gracefully - Prevent access to uninitiliazed memory - Move early delay calaibration after basic init - Fix Kconfig help text - Fix a cross compile issue - Unbreak older make versions" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/timers: Move simple_udelay_calibration past init_hypervisor_platform x86/alternatives: Prevent uninitialized stack byte read in apply_alternatives() x86/PAT: Fix Xorg regression on CPUs that don't support PAT x86/watchdog: Fix Kconfig help text file path reference to lockup watchdog documentation x86/build: Permit building with old make versions x86/unwind: Add end-of-stack check for ftrace handlers Revert "x86/entry: Fix the end of the stack for newly forked tasks" x86/boot: Use CROSS_COMPILE prefix for readelf
2017-05-27Merge branch 'ras-urgent-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull RAS fixes from Thomas Gleixner: "Two fixlets for RAS: - Export memory_error() so the NFIT module can utilize it - Handle memory errors in NFIT correctly" * 'ras-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: acpi, nfit: Fix the memory error check in nfit_handle_mce() x86/MCE: Export memory_error()
2017-05-27Merge tag 'trace-v4.12-rc2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull ftrace fixes from Steven Rostedt: "There's been a few memory issues found with ftrace. One was simply a memory leak where not all was being freed that should have been in releasing a file pointer on set_graph_function. Then Thomas found that the ftrace trampolines were marked for read/write as well as execute. To shrink the possible attack surface, he added calls to set them to ro. Which also uncovered some other issues with freeing module allocated memory that had its permissions changed. Kprobes had a similar issue which is fixed and a selftest was added to trigger that issue again" * tag 'trace-v4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: x86/ftrace: Make sure that ftrace trampolines are not RWX x86/mm/ftrace: Do not bug in early boot on irqs_disabled in cpu_flush_range() selftests/ftrace: Add a testcase for many kprobe events kprobes/x86: Fix to set RWX bits correctly before releasing trampoline ftrace: Fix memory leak in ftrace_graph_release()
2017-05-26x86/ftrace: Make sure that ftrace trampolines are not RWXThomas Gleixner
ftrace use module_alloc() to allocate trampoline pages. The mapping of module_alloc() is RWX, which makes sense as the memory is written to right after allocation. But nothing makes these pages RO after writing to them. Add proper set_memory_rw/ro() calls to protect the trampolines after modification. Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1705251056410.1862@nanos Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-05-26x86/mm/ftrace: Do not bug in early boot on irqs_disabled in cpu_flush_range()Steven Rostedt (VMware)
With function tracing starting in early bootup and having its trampoline pages being read only, a bug triggered with the following: kernel BUG at arch/x86/mm/pageattr.c:189! invalid opcode: 0000 [#1] SMP Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 4.12.0-rc2-test+ #3 Hardware name: MSI MS-7823/CSM-H87M-G43 (MS-7823), BIOS V1.6 02/22/2014 task: ffffffffb4222500 task.stack: ffffffffb4200000 RIP: 0010:change_page_attr_set_clr+0x269/0x302 RSP: 0000:ffffffffb4203c88 EFLAGS: 00010046 RAX: 0000000000000046 RBX: 0000000000000000 RCX: 00000001b6000000 RDX: ffffffffb4203d40 RSI: 0000000000000000 RDI: ffffffffb4240d60 RBP: ffffffffb4203d18 R08: 00000001b6000000 R09: 0000000000000001 R10: ffffffffb4203aa8 R11: 0000000000000003 R12: ffffffffc029b000 R13: ffffffffb4203d40 R14: 0000000000000001 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff9a639ea00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff9a636b384000 CR3: 00000001ea21d000 CR4: 00000000000406b0 Call Trace: change_page_attr_clear+0x1f/0x21 set_memory_ro+0x1e/0x20 arch_ftrace_update_trampoline+0x207/0x21c ? ftrace_caller+0x64/0x64 ? 0xffffffffc029b000 ftrace_startup+0xf4/0x198 register_ftrace_function+0x26/0x3c function_trace_init+0x5e/0x73 tracer_init+0x1e/0x23 tracing_set_tracer+0x127/0x15a register_tracer+0x19b/0x1bc init_function_trace+0x90/0x92 early_trace_init+0x236/0x2b3 start_kernel+0x200/0x3f5 x86_64_start_reservations+0x29/0x2b x86_64_start_kernel+0x17c/0x18f secondary_startup_64+0x9f/0x9f ? secondary_startup_64+0x9f/0x9f Interrupts should not be enabled at this early in the boot process. It is also fine to leave interrupts enabled during this time as there's only one CPU running, and on_each_cpu() means to only run on the current CPU. If early_boot_irqs_disabled is set, it is safe to run cpu_flush_range() with interrupts disabled. Don't trigger a BUG_ON() in that case. Link: http://lkml.kernel.org/r/20170526093717.0be3b849@gandalf.local.home Suggested-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-05-26kprobes/x86: Fix to set RWX bits correctly before releasing trampolineMasami Hiramatsu
Fix kprobes to set(recover) RWX bits correctly on trampoline buffer before releasing it. Releasing readonly page to module_memfree() crash the kernel. Without this fix, if kprobes user register a bunch of kprobes in function body (since kprobes on function entry usually use ftrace) and unregister it, kernel hits a BUG and crash. Link: http://lkml.kernel.org/r/149570868652.3518.14120169373590420503.stgit@devbox Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Fixes: d0381c81c2f7 ("kprobes/x86: Set kprobes pages read-only") Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-05-26x86/timers: Move simple_udelay_calibration past init_hypervisor_platformJan Kiszka
This ensures that adjustments to x86_platform done by the hypervisor setup is already respected by this simple calibration. The current user of this, introduced by 1b5aeebf3a92 ("x86/earlyprintk: Add support for earlyprintk via USB3 debug port"), comes much later into play. Fixes: dd759d93f4dd ("x86/timers: Add simple udelay calibration") Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Lu Baolu <baolu.lu@linux.intel.com> Link: http://lkml.kernel.org/r/5e89fe60-aab3-2c1c-aba8-32f8ad376189@siemens.com
2017-05-25powerpc: Add PPC_FEATURE userspace bits for SCV and DARN instructionsNicholas Piggin
Providing "scv" support to userspace requires kernel support, so it must be advertised as independently to the base ISA 3 instruction set. The darn instruction relies on firmware enablement, so it has been decided to split this out from the core ISA 3 feature as well. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-05-25powerpc/spufs: Fix hash faults for kernel regionsJeremy Kerr
Commit ac29c64089b7 ("powerpc/mm: Replace _PAGE_USER with _PAGE_PRIVILEGED") swapped _PAGE_USER for _PAGE_PRIVILEGED, and introduced check_pte_access() which denied kernel access to non-_PAGE_PRIVILEGED pages. However, it didn't add _PAGE_PRIVILEGED to the hash fault handler for spufs' kernel accesses, so the DMAs required to establish SPE memory no longer work. This change adds _PAGE_PRIVILEGED to the hash fault handler for kernel accesses. Fixes: ac29c64089b7 ("powerpc/mm: Replace _PAGE_USER with _PAGE_PRIVILEGED") Cc: stable@vger.kernel.org # v4.7+ Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Reported-by: Sombat Tragolgosol <sombat3960@gmail.com> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-05-25powerpc: Fix booting P9 hash with CONFIG_PPC_RADIX_MMU=NMichael Neuling
Currently if you disable CONFIG_PPC_RADIX_MMU you'll crash on boot on a P9. This is because we still set MMU_FTR_TYPE_RADIX via ibm,pa-features and MMU_FTR_TYPE_RADIX is what's used for code patching in much of the asm code (ie. slb_miss_realmode) This patch fixes the problem by stopping MMU_FTR_TYPE_RADIX from being set from ibm.pa-features. We may eventually end up removing the CONFIG_PPC_RADIX_MMU option completely but until then this fixes the issue. Fixes: 17a3dd2f5fc7 ("powerpc/mm/radix: Use firmware feature to enable Radix MMU") Cc: stable@vger.kernel.org # v4.7+ Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-05-25powerpc/powernv/npu-dma.c: Fix opal_npu_destroy_context() callAlistair Popple
opal_npu_destroy_context() should be called with the NPU PHB, not the PCIe PHB. Fixes: 1ab66d1fbada ("powerpc/powernv: Introduce address translation services for Nvlink2") Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-05-25ARM64: dts: Add Realtek RTD1295 and Zidoo X9SAndreas Färber
Add initial device trees for the RTD1295 SoC and the Zidoo X9S TV box. The CPUs lack the enable-method property because the vendor device tree uses a custom "rtk-spin-table" method and "psci" did not appear to work. The UARTs lack the interrupts properties because the vendor device tree connects them to a custom interrupt controller. earlycon works without. A list of memory reservations is adopted from v1.2.11 vendor device tree: 0x02200000 can be used for an initrd, 0x01b00000 is audio-related; ion-related 0x02600000, 0x02c00000 and 0x11000000 are left out; 0x10000000 is used for sharing the U-Boot environment; others remain to be investigated. Acked-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Andreas Färber <afaerber@suse.de>
2017-05-24x86/alternatives: Prevent uninitialized stack byte read in apply_alternatives()Mateusz Jurczyk
In the current form of the code, if a->replacementlen is 0, the reference to *insnbuf for comparison touches potentially garbage memory. While it doesn't affect the execution flow due to the subsequent a->replacementlen comparison, it is (rightly) detected as use of uninitialized memory by a runtime instrumentation currently under my development, and could be detected as such by other tools in the future, too (e.g. KMSAN). Fix the "false-positive" by reordering the conditions to first check the replacement instruction length before referencing specific opcode bytes. Signed-off-by: Mateusz Jurczyk <mjurczyk@google.com> Reviewed-by: Borislav Petkov <bp@suse.de> Cc: Andy Lutomirski <luto@kernel.org> Link: http://lkml.kernel.org/r/20170524135500.27223-1-mjurczyk@google.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2017-05-24x86/PAT: Fix Xorg regression on CPUs that don't support PATMikulas Patocka
In the file arch/x86/mm/pat.c, there's a '__pat_enabled' variable. The variable is set to 1 by default and the function pat_init() sets __pat_enabled to 0 if the CPU doesn't support PAT. However, on AMD K6-3 CPUs, the processor initialization code never calls pat_init() and so __pat_enabled stays 1 and the function pat_enabled() returns true, even though the K6-3 CPU doesn't support PAT. The result of this bug is that a kernel warning is produced when attempting to start the Xserver and the Xserver doesn't start (fork() returns ENOMEM). Another symptom of this bug is that the framebuffer driver doesn't set the K6-3 MTRR registers: x86/PAT: Xorg:3891 map pfn expected mapping type uncached-minus for [mem 0xe4000000-0xe5ffffff], got write-combining ------------[ cut here ]------------ WARNING: CPU: 0 PID: 3891 at arch/x86/mm/pat.c:1020 untrack_pfn+0x5c/0x9f ... x86/PAT: Xorg:3891 map pfn expected mapping type uncached-minus for [mem 0xe4000000-0xe5ffffff], got write-combining To fix the bug change pat_enabled() so that it returns true only if PAT initialization was actually done. Also, I changed boot_cpu_has(X86_FEATURE_PAT) to this_cpu_has(X86_FEATURE_PAT) in pat_ap_init(), so that we check the PAT feature on the processor that is being initialized. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> 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: Luis R. Rodriguez <mcgrof@suse.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Toshi Kani <toshi.kani@hp.com> Cc: stable@vger.kernel.org # v4.2+ Link: http://lkml.kernel.org/r/alpine.LRH.2.02.1704181501450.26399@file01.intranet.prod.int.rdu2.redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-05-24x86/watchdog: Fix Kconfig help text file path reference to lockup watchdog ↵Benjamin Peterson
documentation Signed-off-by: Benjamin Peterson <bp@benjamin.pe> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Fixes: 9919cba7ff71147803c988521cc1ceb80e7f0f6d ("watchdog: Update documentation") Link: http://lkml.kernel.org/r/20170521002016.13258-1-bp@benjamin.pe Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-05-24x86/build: Permit building with old make versionsJan Kiszka
At least Make 3.82 dislikes the tab in front of the $(warning) function: arch/x86/Makefile:162: *** recipe commences before first target. Stop. Let's be gentle. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1944fcd8-e3df-d1f7-c0e4-60aeb1917a24@siemens.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-05-24x86/unwind: Add end-of-stack check for ftrace handlersJosh Poimboeuf
Dave Jones and Steven Rostedt reported unwinder warnings like the following: WARNING: kernel stack frame pointer at ffff8800bda0ff30 in sshd:1090 has bad value 000055b32abf1fa8 In both cases, the unwinder was attempting to unwind from an ftrace handler into entry code. The callchain was something like: syscall entry code C function ftrace handler save_stack_trace() The problem is that the unwinder's end-of-stack logic gets confused by the way ftrace lays out the stack frame (with fentry enabled). I was able to recreate this warning with: echo call_usermodehelper_exec_async:stacktrace > /sys/kernel/debug/tracing/set_ftrace_filter (exit login session) I considered fixing this by changing the ftrace code to rewrite the stack to make the unwinder happy. But that seemed too intrusive after I implemented it. Instead, just add another check to the unwinder's end-of-stack logic to detect this special case. Side note: We could probably get rid of these end-of-stack checks by encoding the frame pointer for syscall entry just like we do for interrupt entry. That would be simpler, but it would also be a lot more intrusive since it would slightly affect the performance of every syscall. Reported-by: Dave Jones <davej@codemonkey.org.uk> Reported-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Petr Mladek <pmladek@suse.com> Cc: live-patching@vger.kernel.org Fixes: c32c47c68a0a ("x86/unwind: Warn on bad frame pointer") Link: http://lkml.kernel.org/r/671ba22fbc0156b8f7e0cfa5ab2a795e08bc37e1.1495553739.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>