1. 15 May, 2019 1 commit
    • Stephen Boyd's avatar
      clk: Remove io.h from clk-provider.h · 62e59c4e
      Stephen Boyd authored
      Now that we've gotten rid of clk_readl() we can remove io.h from the
      clk-provider header and push out the io.h include to any code that isn't
      already including the io.h header but using things like readl/writel,
      etc.
      
      Found with this grep:
      
        git grep -l clk-provider.h | grep '.c$' | xargs git grep -L 'linux/io.h' | \
        	xargs git grep -l \
      	-e '\<__iowrite32_copy\>' --or \
      	-e '\<__ioread32_copy\>' --or \
      	-e '\<__iowrite64_copy\>' --or \
      	-e '\<ioremap_page_range\>' --or \
      	-e '\<ioremap_huge_init\>' --or \
      	-e '\<arch_ioremap_pud_supported\>' --or \
      	-e '\<arch_ioremap_pmd_supported\>' --or \
      	-e '\<devm_ioport_map\>' --or \
      	-e '\<devm_ioport_unmap\>' --or \
      	-e '\<IOMEM_ERR_PTR\>' --or \
      	-e '\<devm_ioremap\>' --or \
      	-e '\<devm_ioremap_nocache\>' --or \
      	-e '\<devm_ioremap_wc\>' --or \
      	-e '\<devm_iounmap\>' --or \
      	-e '\<devm_ioremap_release\>' --or \
      	-e '\<devm_memremap\>' --or \
      	-e '\<devm_memunmap\>' --or \
      	-e '\<__devm_memremap_pages\>' --or \
      	-e '\<pci_remap_cfgspace\>' --or \
      	-e '\<arch_has_dev_port\>' --or \
      	-e '\<arch_phys_wc_add\>' --or \
      	-e '\<arch_phys_wc_del\>' --or \
      	-e '\<memremap\>' --or \
      	-e '\<memunmap\>' --or \
      	-e '\<arch_io_reserve_memtype_wc\>' --or \
      	-e '\<arch_io_free_memtype_wc\>' --or \
      	-e '\<__io_aw\>' --or \
      	-e '\<__io_pbw\>' --or \
      	-e '\<__io_paw\>' --or \
      	-e '\<__io_pbr\>' --or \
      	-e '\<__io_par\>' --or \
      	-e '\<__raw_readb\>' --or \
      	-e '\<__raw_readw\>' --or \
      	-e '\<__raw_readl\>' --or \
      	-e '\<__raw_readq\>' --or \
      	-e '\<__raw_writeb\>' --or \
      	-e '\<__raw_writew\>' --or \
      	-e '\<__raw_writel\>' --or \
      	-e '\<__raw_writeq\>' --or \
      	-e '\<readb\>' --or \
      	-e '\<readw\>' --or \
      	-e '\<readl\>' --or \
      	-e '\<readq\>' --or \
      	-e '\<writeb\>' --or \
      	-e '\<writew\>' --or \
      	-e '\<writel\>' --or \
      	-e '\<writeq\>' --or \
      	-e '\<readb_relaxed\>' --or \
      	-e '\<readw_relaxed\>' --or \
      	-e '\<readl_relaxed\>' --or \
      	-e '\<readq_relaxed\>' --or \
      	-e '\<writeb_relaxed\>' --or \
      	-e '\<writew_relaxed\>' --or \
      	-e '\<writel_relaxed\>' --or \
      	-e '\<writeq_relaxed\>' --or \
      	-e '\<readsb\>' --or \
      	-e '\<readsw\>' --or \
      	-e '\<readsl\>' --or \
      	-e '\<readsq\>' --or \
      	-e '\<writesb\>' --or \
      	-e '\<writesw\>' --or \
      	-e '\<writesl\>' --or \
      	-e '\<writesq\>' --or \
      	-e '\<inb\>' --or \
      	-e '\<inw\>' --or \
      	-e '\<inl\>' --or \
      	-e '\<outb\>' --or \
      	-e '\<outw\>' --or \
      	-e '\<outl\>' --or \
      	-e '\<inb_p\>' --or \
      	-e '\<inw_p\>' --or \
      	-e '\<inl_p\>' --or \
      	-e '\<outb_p\>' --or \
      	-e '\<outw_p\>' --or \
      	-e '\<outl_p\>' --or \
      	-e '\<insb\>' --or \
      	-e '\<insw\>' --or \
      	-e '\<insl\>' --or \
      	-e '\<outsb\>' --or \
      	-e '\<outsw\>' --or \
      	-e '\<outsl\>' --or \
      	-e '\<insb_p\>' --or \
      	-e '\<insw_p\>' --or \
      	-e '\<insl_p\>' --or \
      	-e '\<outsb_p\>' --or \
      	-e '\<outsw_p\>' --or \
      	-e '\<outsl_p\>' --or \
      	-e '\<ioread8\>' --or \
      	-e '\<ioread16\>' --or \
      	-e '\<ioread32\>' --or \
      	-e '\<ioread64\>' --or \
      	-e '\<iowrite8\>' --or \
      	-e '\<iowrite16\>' --or \
      	-e '\<iowrite32\>' --or \
      	-e '\<iowrite64\>' --or \
      	-e '\<ioread16be\>' --or \
      	-e '\<ioread32be\>' --or \
      	-e '\<ioread64be\>' --or \
      	-e '\<iowrite16be\>' --or \
      	-e '\<iowrite32be\>' --or \
      	-e '\<iowrite64be\>' --or \
      	-e '\<ioread8_rep\>' --or \
      	-e '\<ioread16_rep\>' --or \
      	-e '\<ioread32_rep\>' --or \
      	-e '\<ioread64_rep\>' --or \
      	-e '\<iowrite8_rep\>' --or \
      	-e '\<iowrite16_rep\>' --or \
      	-e '\<iowrite32_rep\>' --or \
      	-e '\<iowrite64_rep\>' --or \
      	-e '\<__io_virt\>' --or \
      	-e '\<pci_iounmap\>' --or \
      	-e '\<virt_to_phys\>' --or \
      	-e '\<phys_to_virt\>' --or \
      	-e '\<ioremap_uc\>' --or \
      	-e '\<ioremap\>' --or \
      	-e '\<__ioremap\>' --or \
      	-e '\<iounmap\>' --or \
      	-e '\<ioremap\>' --or \
      	-e '\<ioremap_nocache\>' --or \
      	-e '\<ioremap_uc\>' --or \
      	-e '\<ioremap_wc\>' --or \
      	-e '\<ioremap_wc\>' --or \
      	-e '\<ioremap_wt\>' --or \
      	-e '\<ioport_map\>' --or \
      	-e '\<ioport_unmap\>' --or \
      	-e '\<ioport_map\>' --or \
      	-e '\<ioport_unmap\>' --or \
      	-e '\<xlate_dev_kmem_ptr\>' --or \
      	-e '\<xlate_dev_mem_ptr\>' --or \
      	-e '\<unxlate_dev_mem_ptr\>' --or \
      	-e '\<virt_to_bus\>' --or \
      	-e '\<bus_to_virt\>' --or \
      	-e '\<memset_io\>' --or \
      	-e '\<memcpy_fromio\>' --or \
      	-e '\<memcpy_toio\>'
      
      I also reordered a couple includes when they weren't alphabetical and
      removed clk.h from kona, replacing it with clk-provider.h because
      that driver doesn't use clk consumer APIs.
      Acked-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Cc: Chen-Yu Tsai <wens@csie.org>
      Acked-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
      Acked-by: default avatarTero Kristo <t-kristo@ti.com>
      Acked-by: default avatarSekhar Nori <nsekhar@ti.com>
      Cc: Krzysztof Kozlowski <krzk@kernel.org>
      Acked-by: default avatarMark Brown <broonie@kernel.org>
      Cc: Chris Zankel <chris@zankel.net>
      Acked-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      Acked-by: default avatarJohn Crispin <john@phrozen.org>
      Acked-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      62e59c4e
  2. 07 May, 2019 7 commits
    • Stephen Boyd's avatar
      Merge branch 'clk-parent-rewrite-1' into clk-next · c1157f60
      Stephen Boyd authored
       - Rewrite how clk parents can be specified to be DT/clkdev based instead
         of just string based
      
      * clk-parent-rewrite-1:
        clk: Cache core in clk_fetch_parent_index() without names
        clk: fixed-factor: Initialize clk_init_data on stack
        clk: fixed-factor: Let clk framework find parent
        clk: Allow parents to be specified via clkspec index
        clk: Look for parents with clkdev based clk_lookups
        clk: Allow parents to be specified without string names
        clk: Add of_clk_hw_register() API for early clk drivers
        driver core: Let dev_of_node() accept a NULL dev
        clk: Prepare for clk registration API that uses DT nodes
        clkdev: Move clk creation outside of 'clocks_mutex'
      c1157f60
    • Stephen Boyd's avatar
      Merge branch 'clk-ti' into clk-next · 0caf0008
      Stephen Boyd authored
      * clk-ti:
        clk: Remove CLK_IS_BASIC clk flag
        clk: ti: dra7: disable the RNG and TIMER12 clkctrl clocks on HS devices
        clk: ti: dra7x: prevent non-existing clkctrl clocks from registering
        ARM: omap2+: hwmod: drop CLK_IS_BASIC flag usage
        clk: ti: export the omap2_clk_is_hw_omap call
      0caf0008
    • Stephen Boyd's avatar
      Merge branches 'clk-stm32f4', 'clk-tegra', 'clk-at91', 'clk-sifive-fu540' and... · ff060019
      Stephen Boyd authored
      Merge branches 'clk-stm32f4', 'clk-tegra', 'clk-at91', 'clk-sifive-fu540' and 'clk-spdx' into clk-next
      
       - Support for STM32F769
       - Rework AT91 sckc DT bindings
       - Fix slow RC oscillator issue on sama5d3
       - AT91 sam9x60 PMC support
       - SiFive FU540 PRCI and PLL support
      
      * clk-stm32f4:
        clk: stm32mp1: Add ddrperfm clock
        clk: stm32: Introduce clocks of STM32F769 board
      
      * clk-tegra:
        clk: tegra: divider: Mark Memory Controller clock as read-only
        clk: tegra: emc: Replace BUG() with WARN_ONCE()
        clk: tegra: emc: Fix EMC max-rate clamping
        clk: tegra: emc: Support multiple RAM codes
        clk: tegra: emc: Don't enable EMC clock manually
        clk: tegra124: Remove lock-enable bit from PLLM
        clk: tegra: Fix PLLM programming on Tegra124+ when PMC overrides divider
        clk: tegra: Don't enable already enabled PLLs
      
      * clk-at91:
        clk: at91: Mark struct clk_range as const
        clk: at91: add sam9x60 pmc driver
        dt-bindings: clk: at91: add bindings for SAM9X60 pmc
        clk: at91: add sam9x60 PLL driver
        clk: at91: master: Add sam9x60 support
        clk: at91: usb: Add sam9x60 support
        clk: at91: allow configuring generated PCR layout
        clk: at91: allow configuring peripheral PCR layout
        clk: at91: sckc: handle different RC startup time
        clk: at91: modernize sckc binding
        dt-bindings: clock: at91: new sckc bindings
      
      * clk-sifive-fu540:
        clk: sifive: add a driver for the SiFive FU540 PRCI IP block
        clk: analogbits: add Wide-Range PLL library
        dt-bindings: clk: add documentation for the SiFive PRCI driver
      
      * clk-spdx:
        clk: sunxi-ng: Use the correct style for SPDX License Identifier
        clk: sprd: Use the correct style for SPDX License Identifier
        clk: renesas: Use the correct style for SPDX License Identifier
        clk: qcom: Use the correct style for SPDX License Identifier
        clk: davinci: Use the correct style for SPDX License Identifier
        clk: actions: Use the correct style for SPDX License Identifier
      ff060019
    • Stephen Boyd's avatar
      Merge branches 'clk-hisi', 'clk-lochnagar', 'clk-allwinner', 'clk-rockchip'... · 5816b745
      Stephen Boyd authored
      Merge branches 'clk-hisi', 'clk-lochnagar', 'clk-allwinner', 'clk-rockchip' and 'clk-qoriq' into clk-next
      
       - Mark UFS clk as critical on Hi-Silicon hi3660 SoCs
       - Support for Cirrus Logic Lochnagar clks
      
      * clk-hisi:
        clk: hi3660: Mark clk_gate_ufs_subsys as critical
      
      * clk-lochnagar:
        clk: lochnagar: Add support for the Cirrus Logic Lochnagar
        clk: lochnagar: Add initial binding documentation
      
      * clk-allwinner:
        clk: sunxi-ng: sun5i: Export the MBUS clock
        clk: sunxi-ng: a83t: Add pll-video0 as parent of csi-mclk
        clk: sunxi-ng: h6: Allow video & vpu clocks to change parent rate
        clk: sunxi-ng: h6: Preset hdmi-cec clock parent
        clk: sunxi: Add Kconfig options
        clk: sunxi-ng: f1c100s: fix USB PHY gate bit offset
        clk: sunxi-ng: Allow DE clock to set parent rate
      
      * clk-rockchip:
        clk: rockchip: undo several noc and special clocks as critical on rk3288
        clk: rockchip: add a COMPOSITE_DIV_OFFSET clock-type
        clk: rockchip: Turn on "aclk_dmac1" for suspend on rk3288
        clk: rockchip: Limit use of USB PHY clock to USB on rk3288
        clk: rockchip: Fix video codec clocks on rk3288
        clk: rockchip: Make rkpwm a critical clock on rk3288
        clk: rockchip: fix wrong clock definitions for rk3328
      
      * clk-qoriq:
        clk: qoriq: increase array size of cmux_to_group
        dt-bindings: qoriq-clock: Add ls1028a chip compatible string
        clk: qoriq: Add ls1028a clock configuration
        clk: qoriq: add more PLL divider clocks support
        dt-bindings: qoriq-clock: add more PLL divider clocks support
      5816b745
    • Stephen Boyd's avatar
      Merge branches 'clk-sa', 'clk-aspeed', 'clk-samsung', 'clk-ingenic' and 'clk-zynq' into clk-next · 7e9c62bd
      Stephen Boyd authored
       - Various static analysis fixes/finds
       - Video Engine (ECLK) support on Aspeed SoCs
       - Xilinx ZynqMP Versal platform support
       - Convert Xilinx ZynqMP driver to be struct oriented
      
      * clk-sa:
        clk: mvebu: fix spelling mistake "gatable" -> "gateable"
        clk: ux500: add range to usleep_range
        clk: tegra: Make tegra_clk_super_mux_ops static
        clk: davinci: cfgchip: use PTR_ERR_OR_ZERO in da8xx_cfgchip_register_div4p5
      
      * clk-aspeed:
        clk: Aspeed: Setup video engine clocking
      
      * clk-samsung:
        clk: samsung: exynos5410: Add gate clock for ADC
        clk: samsung: dt-bindings: Add ADC clock ID to Exynos5410
        clk: samsung: dt-bindings: Put CLK_UART3 in order
      
      * clk-ingenic:
        clk: ingenic: jz4725b: Add UDC PHY clock
        dt-bindings: clock: jz4725b-cgu: Add UDC PHY clock
      
      * clk-zynq:
        clk: zynqmp: use structs for clk query responses
        clk: zynqmp: fix check for fractional clock
        clk: zynqmp: do not export zynqmp_clk_register_* functions
        clk: zynqmp: fix kerneldoc of __zynqmp_clock_get_parents
        drivers: clk: Update clock driver to handle clock attribute
        drivers: clk: zynqmp: Allow zero divisor value
      7e9c62bd
    • Stephen Boyd's avatar
      Merge branches 'clk-doc', 'clk-more-critical', 'clk-meson' and 'clk-basic-be' into clk-next · f6111b9d
      Stephen Boyd authored
       - Remove clk_readl() and introduce BE versions of basic clk types
      
      * clk-doc:
        clk: Drop duplicate clk_register() documentation
        clk: Document and simplify clk_core_get_rate_nolock()
        clk: Remove 'flags' member of struct clk_fixed_rate
        clk: nxp: Drop 'flags' on fixed_rate clk macro
        clk: Document __clk_mux_determine_rate()
        clk: Document CLK_MUX_READ_ONLY mux flag
        clk: Document deprecated things
        clk: Collapse gpio clk kerneldoc
      
      * clk-more-critical:
        clk: highbank: Convert to CLK_IS_CRITICAL
      
      * clk-meson: (21 commits)
        clk: meson: axg-audio: add g12a support
        clk: meson: axg-audio: don't register inputs in the onecell data
        clk: meson: axg_audio: replace prefix axg by aud
        dt-bindings: clk: axg-audio: add g12a support
        clk: meson: meson8b: add the video decoder clock trees
        clk: meson: meson8b: add the VPU clock trees
        clk: meson: meson8b: add support for the GP_PLL clock on Meson8m2
        clk: meson: meson8b: use a separate clock table for Meson8m2
        dt-bindings: clock: meson8b: export the video decoder clocks
        clk: meson-g12a: add video decoder clocks
        dt-bindings: clock: meson8b: export the VPU clock
        clk: meson-g12a: add PCIE PLL clocks
        dt-bindings: clock: g12a-aoclk: expose CLKID_AO_CTS_OSCIN
        clk: meson-pll: add reduced specific clk_ops for G12A PCIe PLL
        dt-bindings: clock: meson8b: drop the "ABP" clock definition
        clk: meson: g12a: add cpu clocks
        dt-bindings: clk: g12a-clkc: add VDEC clock IDs
        dt-bindings: clock: axg-audio: unexpose controller inputs
        dt-bindings: clk: g12a-clkc: add PCIE PLL clock ID
        clk: g12a-aoclk: re-export CLKID_AO_SAR_ADC_SEL clock id
        ...
      
      * clk-basic-be:
        clk: core: replace clk_{readl,writel} with {readl,writel}
        clk: core: remove powerpc special handling
        powerpc/512x: mark clocks as big endian
        clk: mux: add explicit big endian support
        clk: multiplier: add explicit big endian support
        clk: gate: add explicit big endian support
        clk: fractional-divider: add explicit big endian support
        clk: divider: add explicit big endian support
      f6111b9d
    • Stephen Boyd's avatar
      Merge branches 'clk-renesas', 'clk-qcom', 'clk-mtk', 'clk-milbeaut' and 'clk-imx' into clk-next · 2ed3b910
      Stephen Boyd authored
       - Qualcomm QCS404 CDSP clk support
       - Qualcomm QCS404 Turing clk support
       - Mediatek MT8183 clock support
       - Mediatek MT8516 clock support
       - Milbeaut M10V clk controller support
      
      * clk-renesas:
        clk: renesas: rcar-gen3: Remove unused variable
        clk: renesas: rcar-gen3: Fix cpg_sd_clock_round_rate() return value
        clk: renesas: r8a77980: Fix RPC-IF module clock's parent
        clk: renesas: rcar-gen3: Rename DRIF clocks
        clk: renesas: rcar-gen3: Correct parent clock of Audio-DMAC
        clk: renesas: rcar-gen3: Correct parent clock of SYS-DMAC
        clk: renesas: rcar-gen3: Correct parent clock of HS-USB
        clk: renesas: rcar-gen3: Correct parent clock of EHCI/OHCI
        clk: renesas: r8a774c0: Add Z2 clock
        clk: renesas: r8a77990: Add Z2 clock
        clk: renesas: rcar-gen3: Support Z and Z2 clocks with high frequency parents
        math64: New DIV64_U64_ROUND_CLOSEST helper
        clk: renesas: rcar-gen3: Remove CLK_TYPE_GEN3_Z2
        clk: renesas: rcar-gen3: Parameterise Z and Z2 clock offset
        clk: renesas: rcar-gen3: Parameterise Z and Z2 clock fixed divisor
        clk: renesas: r9a06g032: Add missing PCI USB clock
        clk: renesas: r7s9210: Always use readl()
        clk: renesas: rcar-gen3: Pass name/offset to cpg_sd_clk_register()
      
      * clk-qcom:
        clk: qcom: Skip halt checks on gcc_pcie_0_pipe_clk for 8998
        clk: qcom: Add QCS404 TuringCC
        clk: qcom: branch: Add AON clock ops
        dt-bindings: clock: Introduce Qualcomm Turing Clock controller
        clk: qcom: gcc-qcs404: Add CDSP related clocks and resets
      
      * clk-mtk:
        clk: mediatek: add clock driver for MT8516
        dt-bindings: mediatek: apmixedsys: add support for MT8516
        dt-bindings: mediatek: infracfg: add support for MT8516
        dt-bindings: mediatek: topckgen: add support for MT8516
        clk: mediatek: Allow changing PLL rate when it is off
        clk: mediatek: Add MT8183 clock support
        clk: mediatek: Add configurable pcw_chg_reg to mtk_pll_data
        clk: mediatek: Add dt-bindings for MT8183 clocks
        dt-bindings: ARM: Mediatek: Document bindings for MT8183
        clk: mediatek: Add configurable pcwibits and fmin to mtk_pll_data
        clk: mediatek: Add new clkmux register API
        clk: mediatek: Disable tuner_en before change PLL rate
      
      * clk-milbeaut:
        clock: milbeaut: Add Milbeaut M10V clock controller
        dt-bindings: clock: milbeaut: add Milbeaut clock description
      
      * clk-imx:
        clk: imx: correct pfdv2 gate_bit/vld_bit operations
        clk: imx: clk-pllv3: mark expected switch fall-throughs
        clk: imx8mq: Add dsi_ipg_div
        clk: imx: pllv4: add fractional-N pll support
        clk: imx: keep uart clock on during system boot
        clk: imx: correct i.MX7D AV PLL num/denom offset
        clk: imx6sll: Fix mispelling uart4_serial as serail
        clk: imx: pll14xx: drop unused variable
        clk: imx: rename clk-imx51-imx53.c to clk-imx5.c
        clk: imx5: Fix i.MX50 ESDHC clock registers
        clk: imx5: Fix i.MX50 mainbus clock registers
        clk: imx: Remove unused imx_get_clk_hw_fixed
        dt-bindings: clock: imx7ulp: remove SNVS clock
        clk: imx7ulp: remove snvs clock
      2ed3b910
  3. 06 May, 2019 1 commit
  4. 05 May, 2019 5 commits
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 7178fb0b
      Linus Torvalds authored
      Pull perf fixes from Ingo Molnar:
       "I'd like to apologize for this very late pull request: I was dithering
        through the week whether to send the fixes, and then yesterday Jiri's
        crash fix for a regression introduced in this cycle clearly marked
        perf/urgent as 'must merge now'.
      
        Most of the commits are tooling fixes, plus there's three kernel fixes
        via four commits:
      
          - race fix in the Intel PEBS code
      
          - fix an AUX bug and roll back a previous attempt
      
          - fix AMD family 17h generic HW cache-event perf counters
      
        The largest diffstat contribution comes from the AMD fix - a new event
        table is introduced, which is a fairly low risk change but has a large
        linecount"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86/intel: Fix race in intel_pmu_disable_event()
        perf/x86/intel/pt: Remove software double buffering PMU capability
        perf/ring_buffer: Fix AUX software double buffering
        perf tools: Remove needless asm/unistd.h include fixing build in some places
        tools arch uapi: Copy missing unistd.h headers for arc, hexagon and riscv
        tools build: Add -ldl to the disassembler-four-args feature test
        perf cs-etm: Always allocate memory for cs_etm_queue::prev_packet
        perf cs-etm: Don't check cs_etm_queue::prev_packet validity
        perf report: Report OOM in status line in the GTK UI
        perf bench numa: Add define for RUSAGE_THREAD if not present
        tools lib traceevent: Change tag string for error
        perf annotate: Fix build on 32 bit for BPF annotation
        tools uapi x86: Sync vmx.h with the kernel
        perf bpf: Return value with unlocking in perf_env__find_btf()
        MAINTAINERS: Include vendor specific files under arch/*/events/*
        perf/x86/amd: Update generic hardware cache events for Family 17h
      7178fb0b
    • Linus Torvalds's avatar
      Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 70c9fb57
      Linus Torvalds authored
      Pull scheduler fix from Ingo Molnar:
       "Fix a kobject memory leak in the cpufreq code"
      
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/cpufreq: Fix kobject memleak
      70c9fb57
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 13369e83
      Linus Torvalds authored
      Pull x86 fix from Ingo Molnar:
       "Disable function tracing during early SME setup to fix a boot crash on
        SME-enabled kernels running distro kernels (some of which have
        function tracing enabled)"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mm/mem_encrypt: Disable all instrumentation for early SME setup
      13369e83
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 51987aff
      Linus Torvalds authored
      Pull vfs fixes from Al Viro:
      
       - a couple of ->i_link use-after-free fixes
      
       - regression fix for wrong errno on absent device name in mount(2)
         (this cycle stuff)
      
       - ancient UFS braino in large GID handling on Solaris UFS images (bogus
         cut'n'paste from large UID handling; wrong field checked to decide
         whether we should look at old (16bit) or new (32bit) field)
      
      * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        ufs: fix braino in ufs_get_inode_gid() for solaris UFS flavour
        Abort file_remove_privs() for non-reg. files
        [fix] get rid of checking for absent device name in vfs_get_tree()
        apparmorfs: fix use-after-free on symlink traversal
        securityfs: fix use-after-free on symlink traversal
      51987aff
    • Jiri Olsa's avatar
      perf/x86/intel: Fix race in intel_pmu_disable_event() · 6f55967a
      Jiri Olsa authored
      New race in x86_pmu_stop() was introduced by replacing the
      atomic __test_and_clear_bit() of cpuc->active_mask by separate
      test_bit() and __clear_bit() calls in the following commit:
      
        3966c3fe ("x86/perf/amd: Remove need to check "running" bit in NMI handler")
      
      The race causes panic for PEBS events with enabled callchains:
      
        BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
        ...
        RIP: 0010:perf_prepare_sample+0x8c/0x530
        Call Trace:
         <NMI>
         perf_event_output_forward+0x2a/0x80
         __perf_event_overflow+0x51/0xe0
         handle_pmi_common+0x19e/0x240
         intel_pmu_handle_irq+0xad/0x170
         perf_event_nmi_handler+0x2e/0x50
         nmi_handle+0x69/0x110
         default_do_nmi+0x3e/0x100
         do_nmi+0x11a/0x180
         end_repeat_nmi+0x16/0x1a
        RIP: 0010:native_write_msr+0x6/0x20
        ...
         </NMI>
         intel_pmu_disable_event+0x98/0xf0
         x86_pmu_stop+0x6e/0xb0
         x86_pmu_del+0x46/0x140
         event_sched_out.isra.97+0x7e/0x160
        ...
      
      The event is configured to make samples from PEBS drain code,
      but when it's disabled, we'll go through NMI path instead,
      where data->callchain will not get allocated and we'll crash:
      
                x86_pmu_stop
                  test_bit(hwc->idx, cpuc->active_mask)
                  intel_pmu_disable_event(event)
                  {
                    ...
                    intel_pmu_pebs_disable(event);
                    ...
      
      EVENT OVERFLOW ->  <NMI>
                           intel_pmu_handle_irq
                             handle_pmi_common
         TEST PASSES ->        test_bit(bit, cpuc->active_mask))
                                 perf_event_overflow
                                   perf_prepare_sample
                                   {
                                     ...
                                     if (!(sample_type & __PERF_SAMPLE_CALLCHAIN_EARLY))
                                           data->callchain = perf_callchain(event, regs);
      
               CRASH ->              size += data->callchain->nr;
                                   }
                         </NMI>
                    ...
                    x86_pmu_disable_event(event)
                  }
      
                  __clear_bit(hwc->idx, cpuc->active_mask);
      
      Fixing this by disabling the event itself before setting
      off the PEBS bit.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: David Arcari <darcari@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Lendacky Thomas <Thomas.Lendacky@amd.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Fixes: 3966c3fe ("x86/perf/amd: Remove need to check "running" bit in NMI handler")
      Link: http://lkml.kernel.org/r/20190504151556.31031-1-jolsa@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      6f55967a
  5. 04 May, 2019 1 commit
  6. 03 May, 2019 13 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · aa1be08f
      Linus Torvalds authored
      Pull KVM fixes from Paolo Bonzini:
      
       - PPC and ARM bugfixes from submaintainers
      
       - Fix old Windows versions on AMD (recent regression)
      
       - Fix old Linux versions on processors without EPT
      
       - Fixes for LAPIC timer optimizations
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (21 commits)
        KVM: nVMX: Fix size checks in vmx_set_nested_state
        KVM: selftests: make hyperv_cpuid test pass on AMD
        KVM: lapic: Check for in-kernel LAPIC before deferencing apic pointer
        KVM: fix KVM_CLEAR_DIRTY_LOG for memory slots of unaligned size
        x86/kvm/mmu: reset MMU context when 32-bit guest switches PAE
        KVM: x86: Whitelist port 0x7e for pre-incrementing %rip
        Documentation: kvm: fix dirty log ioctl arch lists
        KVM: VMX: Move RSB stuffing to before the first RET after VM-Exit
        KVM: arm/arm64: Don't emulate virtual timers on userspace ioctls
        kvm: arm: Skip stage2 huge mappings for unaligned ipa backed by THP
        KVM: arm/arm64: Ensure vcpu target is unset on reset failure
        KVM: lapic: Convert guest TSC to host time domain if necessary
        KVM: lapic: Allow user to disable adaptive tuning of timer advancement
        KVM: lapic: Track lapic timer advance per vCPU
        KVM: lapic: Disable timer advancement if adaptive tuning goes haywire
        x86: kvm: hyper-v: deal with buggy TLB flush requests from WS2012
        KVM: x86: Consider LAPIC TSC-Deadline timer expired if deadline too short
        KVM: PPC: Book3S: Protect memslots while validating user address
        KVM: PPC: Book3S HV: Perserve PSSCR FAKE_SUSPEND bit on guest exit
        KVM: arm/arm64: vgic-v3: Retire pending interrupts on disabling LPIs
        ...
      aa1be08f
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current-fixed' of... · 82463436
      Linus Torvalds authored
      Merge branch 'i2c/for-current-fixed' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/wsa/linux
      
      Pull i2c fixes from Wolfram Sang:
       "I2C driver bugfixes and a MAINTAINERS update for you"
      
      * 'i2c/for-current-fixed' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: Prevent runtime suspend of adapter when Host Notify is required
        i2c: synquacer: fix enumeration of slave devices
        MAINTAINERS: friendly takeover of i2c-gpio driver
        i2c: designware: ratelimit 'transfer when suspended' errors
        i2c: imx: correct the method of getting private data in notifier_call
      82463436
    • Stephen Boyd's avatar
      clk: Cache core in clk_fetch_parent_index() without names · 1a079560
      Stephen Boyd authored
      If a clk has specified parents via clk_hw pointers it won't specify the
      globally unique names for the parents. Without the unique names, we
      can't fallback to comparing them against the name of the 'parent'
      pointer here. Therefore, do a pointer comparison against the clk_hw
      pointers too and cache the clk_core structure if they match. This fixes
      parent lookup code for clks that only specify clk_hw pointers and
      nothing else, like muxes that are purely inside a clk controller.
      
      Similarly, if the parent pointer isn't cached after trying to match
      clk_core or clk_hw pointers, lookup the pointer from DT or via clkdev
      lookups instead of relying purely on the globally unique clk name match.
      This should allow us to move away from having to specify global names
      for clk parents entirely.
      
      While we're in the area, add some comments so it's clearer what's going
      on. The if statements don't lend themselves to much clarity in their raw
      form.
      
      Fixes: fc0c209c ("clk: Allow parents to be specified without string names")
      Reported-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      1a079560
    • Anson Huang's avatar
      clk: imx: correct pfdv2 gate_bit/vld_bit operations · a5a627c6
      Anson Huang authored
      The operations of pfdv2 gate_bit/valid_bit are incorrect,
      they are defined as u8 for bit offset, but gate_bit is
      actually assigned as mask which could be 32 bit long and
      it causes overflow, and vld_bit is assigned as bit offset
      based on incorrect gate_bit value, it causes incorrect
      pfd clock gate status in clock tree, this patch fixes the
      issue by assigning them as correct bit offset.
      
      Fixes: 9fcb6be3 ("clk: imx: add pfdv2 support")
      Signed-off-by: default avatarAnson Huang <Anson.Huang@nxp.com>
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      a5a627c6
    • Paul Walmsley's avatar
      clk: sifive: add a driver for the SiFive FU540 PRCI IP block · 30b8e27e
      Paul Walmsley authored
      Add driver code for the SiFive FU540 PRCI IP block.  This IP block
      handles reset and clock control for the SiFive FU540 device and
      implements SoC-level clock tree controls and dividers.
      
      Based on code written by Wesley Terpstra <wesley@sifive.com>:
      https://github.com/riscv/riscv-linux/commit/999529edf517ed75b56659d456d221b2ee56bb60
      
      Boot and PLL rate change were tested on a SiFive HiFive Unleashed
      board.
      
      This version includes several changes requested by Stephen Boyd
      <sboyd@kernel.org>.
      Signed-off-by: default avatarPaul Walmsley <paul.walmsley@sifive.com>
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@kernel.org>
      Cc: Albert Ou <aou@eecs.berkeley.edu>
      Cc: Wesley W. Terpstra <wesley@sifive.com>
      Cc: Palmer Dabbelt <palmer@sifive.com>
      Cc: Megan Wachs <megan@sifive.com>
      Cc: linux-riscv@lists.infradead.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-clk@vger.kernel.org
      [sboyd@kernel.org: Fix some const and ARRAY_SIZE() issues, make makefile
      only descend if CLK_SIFIVE=y]
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      30b8e27e
    • Paul Walmsley's avatar
      clk: analogbits: add Wide-Range PLL library · 7b9487a9
      Paul Walmsley authored
      Add common library code for the Analog Bits Wide-Range PLL (WRPLL) IP
      block, as implemented in TSMC CLN28HPC.
      
      There is no bus interface or register target associated with this PLL.
      This library is intended to be used by drivers for IP blocks that
      expose registers connected to the PLL configuration and status
      signals.
      
      Based on code originally written by Wesley Terpstra
      <wesley@sifive.com>:
      https://github.com/riscv/riscv-linux/commit/999529edf517ed75b56659d456d221b2ee56bb60
      
      This version incorporates several changes requested by Stephen
      Boyd <sboyd@kernel.org>.
      Signed-off-by: default avatarPaul Walmsley <paul.walmsley@sifive.com>
      Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Wesley Terpstra <wesley@sifive.com>
      Cc: Palmer Dabbelt <palmer@sifive.com>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Stephen Boyd <sboyd@kernel.org>
      Cc: Megan Wachs <megan@sifive.com>
      Cc: linux-clk@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      [sboyd@kernel.org: Fix some const issues]
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      7b9487a9
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2019-05-03' of git://anongit.freedesktop.org/drm/drm · a4ccb5f9
      Linus Torvalds authored
      Pull drm fix from Dave Airlie:
       "Just a single qxl revert"
      
      * tag 'drm-fixes-2019-05-03' of git://anongit.freedesktop.org/drm/drm:
        Revert "drm/qxl: drop prime import/export callbacks"
      a4ccb5f9
    • Gustavo A. R. Silva's avatar
      clk: imx: clk-pllv3: mark expected switch fall-throughs · 53dd5c70
      Gustavo A. R. Silva authored
      In preparation to enabling -Wimplicit-fallthrough, mark switch
      cases where we are expecting to fall through.
      
      This patch fixes the following warnings:
      
      drivers/clk/imx/clk-pllv3.c: In function ‘imx_clk_pllv3’:
      drivers/clk/imx/clk-pllv3.c:446:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
         pll->div_shift = 1;
         ~~~~~~~~~~~~~~~^~~
      drivers/clk/imx/clk-pllv3.c:447:2: note: here
        case IMX_PLLV3_USB:
        ^~~~
      drivers/clk/imx/clk-pllv3.c:453:21: warning: this statement may fall through [-Wimplicit-fallthrough=]
         pll->denom_offset = PLL_IMX7_DENOM_OFFSET;
                           ^
      drivers/clk/imx/clk-pllv3.c:454:2: note: here
        case IMX_PLLV3_AV:
        ^~~~
      
      Warning level 3 was used: -Wimplicit-fallthrough=3
      
      This patch is part of the ongoing efforts to enable
      -Wimplicit-fallthrough.
      
      Fixes: b4a4cb5a ("clk: imx: correct i.MX7D AV PLL num/denom offset")
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Reviewed-by: default avatarAnson Huang <Anson.Huang@nxp.com>
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      53dd5c70
    • Linus Torvalds's avatar
      Merge tag 'clk-fixes-for-linus' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/clk/linux · 8f76216c
      Linus Torvalds authored
      Pull clk fixes from Stephen Boyd:
       "Two fixes for the NKMP clks on Allwinner SoCs, a locking fix for
        clkdev where we forgot to hold a lock while iterating a list that can
        change, and finally a build fix that adds some stubs for clk APIs that
        are used by devfreq drivers on platforms without the clk APIs"
      
      * tag 'clk-fixes-for-linus' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/clk/linux:
        clk: Add missing stubs for a few functions
        clkdev: Hold clocks_mutex while iterating clocks list
        clk: sunxi-ng: nkmp: Explain why zero width check is needed
        clk: sunxi-ng: nkmp: Avoid GENMASK(-1, 0)
      8f76216c
    • Linus Torvalds's avatar
      Merge tag 'sound-5.1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 46572f78
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "A few stable fixes at this round.
      
        The USB Line6 audio fixes are a bit large, but they are rather trivial
        and pretty much device-specific, so should be safe to apply at this
        late stage. Ditto for other HD-audio quirks"
      
      * tag 'sound-5.1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda/realtek - Apply the fixup for ASUS Q325UAR
        ALSA: line6: use dynamic buffers
        ALSA: hda/realtek - Fixed Dell AIO speaker noise
        ALSA: hda/realtek - Add new Dell platform for headset mode
      46572f78
    • Alexander Shishkin's avatar
      perf/x86/intel/pt: Remove software double buffering PMU capability · 72e830f6
      Alexander Shishkin authored
      Now that all AUX allocations are high-order by default, the software
      double buffering PMU capability doesn't make sense any more, get rid
      of it. In case some PMUs choose to opt out, we can re-introduce it.
      Signed-off-by: default avatarAlexander Shishkin <alexander.shishkin@linux.intel.com>
      Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: adrian.hunter@intel.com
      Link: http://lkml.kernel.org/r/20190503085536.24119-3-alexander.shishkin@linux.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      72e830f6
    • Alexander Shishkin's avatar
      perf/ring_buffer: Fix AUX software double buffering · 26ae4f44
      Alexander Shishkin authored
      This recent commit:
      
        5768402f ("perf/ring_buffer: Use high order allocations for AUX buffers optimistically")
      
      overlooked the fact that the previous one page granularity of the AUX buffer
      provided an implicit double buffering capability to the PMU driver, which
      went away when the entire buffer became one high-order page.
      
      Always make the full-trace mode AUX allocation at least two-part to preserve
      the previous behavior and allow the implicit double buffering to continue.
      Reported-by: default avatarAmmy Yi <ammy.yi@intel.com>
      Signed-off-by: default avatarAlexander Shishkin <alexander.shishkin@linux.intel.com>
      Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: adrian.hunter@intel.com
      Fixes: 5768402f ("perf/ring_buffer: Use high order allocations for AUX buffers optimistically")
      Link: http://lkml.kernel.org/r/20190503085536.24119-2-alexander.shishkin@linux.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      26ae4f44
    • Ingo Molnar's avatar
      Merge tag 'perf-urgent-for-mingo-5.1-20190502' of... · 221856b1
      Ingo Molnar authored
      Merge tag 'perf-urgent-for-mingo-5.1-20190502' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Pull perf/urgent fixes from Arnaldo Carvalho de Melo:
      
      tools UAPI:
      
        Arnaldo Carvalho de Melo:
      
        - Sync x86's vmx.h with the kernel.
      
        - Copy missing unistd.h headers for arc, hexagon and riscv, fixing
          a reported build regression on the ARC 32-bit architecture.
      
      perf bench numa:
      
        Arnaldo Carvalho de Melo:
      
        - Add define for RUSAGE_THREAD if not present, fixing the build on the
          ARC architecture when only zlib and libnuma are present.
      
      perf BPF:
      
        Arnaldo Carvalho de Melo:
      
        - The disassembler-four-args feature test needs -ldl on distros such as
          Mageia 7.
      
        Bo YU:
      
        - Fix unlocking on success in perf_env__find_btf(), detected with
          the coverity tool.
      
      libtraceevent:
      
        Leo Yan:
      
        - Change misleading hard coded 'trace-cmd' string in error messages.
      
      ARM hardware tracing:
      
        Leo Yan:
      
        - Always allocate memory for cs_etm_queue::prev_packet, fixing a segfault
          when processing CoreSight perf data.
      
      perf annotate:
      
        Thadeu Lima de Souza Cascardo:
      
        - Fix build on 32 bit for BPF.
      
      perf report:
      
        Thomas Richter:
      
        - Report OOM in status line in the GTK UI.
      
      core libs:
      
        - Remove needless asm/unistd.h that, used with sys/syscall.h ended
          up redefining the syscalls defines in environments such as the
          ARC arch when using uClibc.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      221856b1
  7. 02 May, 2019 12 commits
    • Dave Airlie's avatar
      Merge tag 'drm-misc-fixes-2019-05-02' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes · 1daa0449
      Dave Airlie authored
      - One revert for QXL for a DRI3 breakage
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Maxime Ripard <maxime.ripard@bootlin.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190502122529.hguztj3kncaixe3d@flea
      1daa0449
    • Guido Günther's avatar
      clk: imx8mq: Add dsi_ipg_div · 4d13c67a
      Guido Günther authored
      It's defined in imx8mq-clock.h but wasn't assigned yet. It's used as
      clk_tx_esc in the nwl dsi host controller (i.MX8MQ RM, Rev. 0, 01/2018
      Sect. 13.5.3.7.4).
      Signed-off-by: default avatarGuido Günther <agx@sigxcpu.org>
      Reviewed-by: default avatarFabio Estevam <festevam@gmail.com>
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      4d13c67a
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Remove needless asm/unistd.h include fixing build in some places · 7e221b81
      Arnaldo Carvalho de Melo authored
      We were including sys/syscall.h and asm/unistd.h, since sys/syscall.h
      includes asm/unistd.h, sometimes this leads to the redefinition of
      defines, breaking the build.
      
      Noticed on ARC with uCLibc.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
      Link: https://lkml.kernel.org/n/tip-xjpf80o64i2ko74aj2jih0qg@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7e221b81
    • Arnaldo Carvalho de Melo's avatar
      tools arch uapi: Copy missing unistd.h headers for arc, hexagon and riscv · 18f90d37
      Arnaldo Carvalho de Melo authored
      Since those were introduced in:
      
        c8ce48f0 ("asm-generic: Make time32 syscall numbers optional")
      
      But when the asm-generic/unistd.h was sync'ed with tools/ in:
      
        1a787fc5 ("tools headers uapi: Sync copy of asm-generic/unistd.h with the kernel sources")
      
      I forgot to copy the files for the architectures that define
      __ARCH_WANT_TIME32_SYSCALLS, so the perf build was breaking there, as
      reported by Vineet Gupta for the ARC architecture.
      
      After updating my ARC container to use the glibc based toolchain + cross
      building libnuma, zlib and elfutils, I finally managed to reproduce the
      problem and verify that this now is fixed and will not regress as will
      be tested before each pull req sent upstream.
      Reported-by: default avatarVineet Gupta <Vineet.Gupta1@synopsys.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Jiri Olsa <jolsa@kernel.org>
      CC: linux-snps-arc@lists.infradead.org
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/r/20190426193531.GC28586@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      18f90d37
    • Arnaldo Carvalho de Melo's avatar
      tools build: Add -ldl to the disassembler-four-args feature test · c638417e
      Arnaldo Carvalho de Melo authored
      Thomas Backlund reported that the perf build was failing on the Mageia 7
      distro, that is because it uses:
      
        cat /tmp/build/perf/feature/test-disassembler-four-args.make.output
        /usr/bin/ld: /usr/lib64/libbfd.a(plugin.o): in function `try_load_plugin':
        /home/iurt/rpmbuild/BUILD/binutils-2.32/objs/bfd/../../bfd/plugin.c:243:
        undefined reference to `dlopen'
        /usr/bin/ld:
        /home/iurt/rpmbuild/BUILD/binutils-2.32/objs/bfd/../../bfd/plugin.c:271:
        undefined reference to `dlsym'
        /usr/bin/ld:
        /home/iurt/rpmbuild/BUILD/binutils-2.32/objs/bfd/../../bfd/plugin.c:256:
        undefined reference to `dlclose'
        /usr/bin/ld:
        /home/iurt/rpmbuild/BUILD/binutils-2.32/objs/bfd/../../bfd/plugin.c:246:
        undefined reference to `dlerror'
        as we allow dynamic linking and loading
      
      Mageia 7 uses these linker flags:
        $ rpm --eval %ldflags
          -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags
      
      So add -ldl to this feature LDFLAGS.
      Reported-by: default avatarThomas Backlund <tmb@mageia.org>
      Tested-by: default avatarThomas Backlund <tmb@mageia.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Song Liu <songliubraving@fb.com>
      Link: https://lkml.kernel.org/r/20190501173158.GC21436@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c638417e
    • Leo Yan's avatar
      perf cs-etm: Always allocate memory for cs_etm_queue::prev_packet · 35bb59c1
      Leo Yan authored
      Robert Walker reported a segmentation fault is observed when process
      CoreSight trace data; this issue can be easily reproduced by the command
      'perf report --itrace=i1000i' for decoding tracing data.
      
      If neither the 'b' flag (synthesize branches events) nor 'l' flag
      (synthesize last branch entries) are specified to option '--itrace',
      cs_etm_queue::prev_packet will not been initialised.  After merging the
      code to support exception packets and sample flags, there introduced a
      number of uses of cs_etm_queue::prev_packet without checking whether it
      is valid, for these cases any accessing to uninitialised prev_packet
      will cause crash.
      
      As cs_etm_queue::prev_packet is used more widely now and it's already
      hard to follow which functions have been called in a context where the
      validity of cs_etm_queue::prev_packet has been checked, this patch
      always allocates memory for cs_etm_queue::prev_packet.
      Reported-by: default avatarRobert Walker <robert.walker@arm.com>
      Suggested-by: default avatarRobert Walker <robert.walker@arm.com>
      Signed-off-by: default avatarLeo Yan <leo.yan@linaro.org>
      Tested-by: default avatarRobert Walker <robert.walker@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Suzuki K Poulouse <suzuki.poulose@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Fixes: 7100b12c ("perf cs-etm: Generate branch sample for exception packet")
      Fixes: 24fff5eb ("perf cs-etm: Avoid stale branch samples when flush packet")
      Link: http://lkml.kernel.org/r/20190428083228.20246-1-leo.yan@linaro.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      35bb59c1
    • Leo Yan's avatar
      perf cs-etm: Don't check cs_etm_queue::prev_packet validity · cf0c37b6
      Leo Yan authored
      Since cs_etm_queue::prev_packet is allocated for all cases, it will
      never be NULL pointer; now validity checking prev_packet is pointless,
      remove all of them.
      Signed-off-by: default avatarLeo Yan <leo.yan@linaro.org>
      Tested-by: default avatarRobert Walker <robert.walker@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Suzuki K Poulouse <suzuki.poulose@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lkml.kernel.org/r/20190428083228.20246-2-leo.yan@linaro.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      cf0c37b6
    • Thomas Richter's avatar
      perf report: Report OOM in status line in the GTK UI · 167e418f
      Thomas Richter authored
      An -ENOMEM error is not reported in the GTK GUI.  Instead this error
      message pops up on the screen:
      
      [root@m35lp76 perf]# ./perf  report -i perf.data.error68-1
      
      	Processing events... [974K/3M]
      	Error:failed to process sample
      
      	0xf4198 [0x8]: failed to process type: 68
      
      However when I use the same perf.data file with --stdio it works:
      
      [root@m35lp76 perf]# ./perf  report -i perf.data.error68-1 --stdio \
      		| head -12
      
        # Total Lost Samples: 0
        #
        # Samples: 76K of event 'cycles'
        # Event count (approx.): 99056160000
        #
        # Overhead  Command          Shared Object      Symbol
        # ........  ...............  .................  .........
        #
           8.81%  find             [kernel.kallsyms]  [k] ftrace_likely_update
           8.74%  swapper          [kernel.kallsyms]  [k] ftrace_likely_update
           8.34%  sshd             [kernel.kallsyms]  [k] ftrace_likely_update
           2.19%  kworker/u512:1-  [kernel.kallsyms]  [k] ftrace_likely_update
      
      The sample precentage is a bit low.....
      
      The GUI always fails in the FINISHED_ROUND event (68) and does not
      indicate the reason why.
      
      When happened is the following. Perf report calls a lot of functions and
      down deep when a FINISHED_ROUND event is processed, these functions are
      called:
      
        perf_session__process_event()
        + perf_session__process_user_event()
          + process_finished_round()
            + ordered_events__flush()
              + __ordered_events__flush()
      	  + do_flush()
      	    + ordered_events__deliver_event()
      	      + perf_session__deliver_event()
      	        + machine__deliver_event()
      	          + perf_evlist__deliver_event()
      	            + process_sample_event()
      	              + hist_entry_iter_add() --> only called in GUI case!!!
      	                + hist_iter__report__callback()
      	                  + symbol__inc_addr_sample()
      
      	                    Now this functions runs out of memory and
      			    returns -ENOMEM. This is reported all the way up
      			    until function
      
      perf_session__process_event() returns to its caller, where -ENOMEM is
      changed to -EINVAL and processing stops:
      
       if ((skip = perf_session__process_event(session, event, head)) < 0) {
            pr_err("%#" PRIx64 " [%#x]: failed to process type: %d\n",
      	     head, event->header.size, event->header.type);
            err = -EINVAL;
            goto out_err;
       }
      
      This occurred in the FINISHED_ROUND event when it has to process some
      10000 entries and ran out of memory.
      
      This patch indicates the root cause and displays it in the status line
      of ther perf report GUI.
      
      Output before (on GUI status line):
      
        0xf4198 [0x8]: failed to process type: 68
      
      Output after:
      
        0xf4198 [0x8]: failed to process type: 68 [not enough memory]
      
      Committer notes:
      
      the 'skip' variable needs to be initialized to -EINVAL, so that when the
      size is less than sizeof(struct perf_event_attr) we avoid this valid
      compiler warning:
      
        util/session.c: In function ‘perf_session__process_events’:
        util/session.c:1936:7: error: ‘skip’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
           err = skip;
           ~~~~^~~~~~
        util/session.c:1874:6: note: ‘skip’ was declared here
          s64 skip;
              ^~~~
        cc1: all warnings being treated as errors
      Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: default avatarHendrik Brueckner <brueckner@linux.ibm.com>
      Reviewed-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Link: http://lkml.kernel.org/r/20190423105303.61683-1-tmricht@linux.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      167e418f
    • Arnaldo Carvalho de Melo's avatar
      perf bench numa: Add define for RUSAGE_THREAD if not present · bf561d3c
      Arnaldo Carvalho de Melo authored
      While cross building perf to the ARC architecture on a fedora 30 host,
      we were failing with:
      
            CC       /tmp/build/perf/bench/numa.o
        bench/numa.c: In function ‘worker_thread’:
        bench/numa.c:1261:12: error: ‘RUSAGE_THREAD’ undeclared (first use in this function); did you mean ‘SIGEV_THREAD’?
          getrusage(RUSAGE_THREAD, &rusage);
                    ^~~~~~~~~~~~~
                    SIGEV_THREAD
        bench/numa.c:1261:12: note: each undeclared identifier is reported only once for each function it appears in
      
      [perfbuilder@60d5802468f6 perf]$ /arc_gnu_2019.03-rc1_prebuilt_uclibc_le_archs_linux_install/bin/arc-linux-gcc --version | head -1
      arc-linux-gcc (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1) 8.3.1 20190225
      [perfbuilder@60d5802468f6 perf]$
      
      Trying to reproduce a report by Vineet, I noticed that, with just
      cross-built zlib and numactl libraries, I ended up with the above
      failure.
      
      So, since RUSAGE_THREAD is available as a define, check for that and
      numactl libraries, I ended up with the above failure.
      
      So, since RUSAGE_THREAD is available as a define in the system headers,
      check if it is defined in the 'perf bench numa' sources and define it if
      not.
      
      Now it builds and I have to figure out if the problem reported by Vineet
      only takes place if we have libelf or some other library available.
      
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: linux-snps-arc@lists.infradead.org
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
      Link: https://lkml.kernel.org/n/tip-2wb4r1gir9xrevbpq7qp0amk@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      bf561d3c
    • Leo Yan's avatar
      tools lib traceevent: Change tag string for error · 5f05182f
      Leo Yan authored
      The traceevent lib is used by the perf tool, and when executing
      
        perf test -v 6
      
      it outputs error log on the ARM64 platform:
      
        running test 33 '*:*'trace-cmd: No such file or directory
      
        [...]
      
        trace-cmd: Invalid argument
      
      The trace event parsing code originally came from trace-cmd so it keeps
      the tag string "trace-cmd" for errors, this easily introduces the
      impression that the perf tool launches trace-cmd command for trace event
      parsing, but in fact the related parsing is accomplished by the
      traceevent lib.
      
      This patch changes the tag string to "libtraceevent" so that we can
      avoid confusion and let users to more easily connect the error with
      traceevent lib.
      Signed-off-by: default avatarLeo Yan <leo.yan@linaro.org>
      Acked-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/20190424013802.27569-1-leo.yan@linaro.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5f05182f
    • Thadeu Lima de Souza Cascardo's avatar
      perf annotate: Fix build on 32 bit for BPF annotation · 01e985e9
      Thadeu Lima de Souza Cascardo authored
      Commit 6987561c ("perf annotate: Enable annotation of BPF programs") adds
      support for BPF programs annotations but the new code does not build on 32-bit.
      Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
      Acked-by: default avatarSong Liu <songliubraving@fb.com>
      Fixes: 6987561c ("perf annotate: Enable annotation of BPF programs")
      Link: http://lkml.kernel.org/r/20190403194452.10845-1-cascardo@canonical.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      01e985e9
    • Arnaldo Carvalho de Melo's avatar
      tools uapi x86: Sync vmx.h with the kernel · 24e45b49
      Arnaldo Carvalho de Melo authored
      To pick up the changes from:
      
        2b27924b ("KVM: nVMX: always use early vmcs check when EPT is disabled")
      
      That causes this object in the tools/perf build process to be rebuilt:
      
        CC       /tmp/build/perf/arch/x86/util/kvm-stat.o
      
      But it isn't using VMX_ABORT_ prefixed constants, so no change in
      behaviour.
      
      This silences this perf build warning:
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/vmx.h' differs from latest version at 'arch/x86/include/uapi/asm/vmx.h'
        diff -u tools/arch/x86/include/uapi/asm/vmx.h arch/x86/include/uapi/asm/vmx.h
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Link: https://lkml.kernel.org/n/tip-bjbo3zc0r8i8oa0udpvftya6@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      24e45b49