08 Mar, 2020

1 commit

  • Merge Linux stable release v5.4.24 into imx_5.4.y

    * tag 'v5.4.24': (3306 commits)
    Linux 5.4.24
    blktrace: Protect q->blk_trace with RCU
    kvm: nVMX: VMWRITE checks unsupported field before read-only field
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    arch/arm/boot/dts/imx6sll-evk.dts
    arch/arm/boot/dts/imx7ulp.dtsi
    arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
    drivers/clk/imx/clk-composite-8m.c
    drivers/gpio/gpio-mxc.c
    drivers/irqchip/Kconfig
    drivers/mmc/host/sdhci-of-esdhc.c
    drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
    drivers/net/can/flexcan.c
    drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
    drivers/net/ethernet/mscc/ocelot.c
    drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
    drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
    drivers/net/phy/realtek.c
    drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
    drivers/perf/fsl_imx8_ddr_perf.c
    drivers/tee/optee/shm_pool.c
    drivers/usb/cdns3/gadget.c
    kernel/sched/cpufreq.c
    net/core/xdp.c
    sound/soc/fsl/fsl_esai.c
    sound/soc/fsl/fsl_sai.c
    sound/soc/sof/core.c
    sound/soc/sof/imx/Kconfig
    sound/soc/sof/loader.c

    Jason Liu
     

05 Mar, 2020

1 commit

  • [ Upstream commit 0ca2c0319a7bce0e152b51b866979d62dc261e48 ]

    Even though a SMMUv3 PMCG implementation may use an MSI as the form of
    interrupt source, the kernel would still complain that it does not find
    the wired (GSIV) interrupt in this case:

    root@(none)$ dmesg | grep arm-smmu-v3-pmcg | grep "not found"
    [ 59.237219] arm-smmu-v3-pmcg arm-smmu-v3-pmcg.8.auto: IRQ index 0 not found
    [ 59.322841] arm-smmu-v3-pmcg arm-smmu-v3-pmcg.9.auto: IRQ index 0 not found
    [ 59.422155] arm-smmu-v3-pmcg arm-smmu-v3-pmcg.10.auto: IRQ index 0 not found
    [ 59.539014] arm-smmu-v3-pmcg arm-smmu-v3-pmcg.11.auto: IRQ index 0 not found
    [ 59.640329] arm-smmu-v3-pmcg arm-smmu-v3-pmcg.12.auto: IRQ index 0 not found
    [ 59.743112] arm-smmu-v3-pmcg arm-smmu-v3-pmcg.13.auto: IRQ index 0 not found
    [ 59.880577] arm-smmu-v3-pmcg arm-smmu-v3-pmcg.14.auto: IRQ index 0 not found
    [ 60.017528] arm-smmu-v3-pmcg arm-smmu-v3-pmcg.15.auto: IRQ index 0 not found

    Use platform_get_irq_optional() to silence the warning.

    If neither interrupt source is found, then the driver will still warn that
    IRQ setup errored and the probe will fail.

    Reviewed-by: Robin Murphy
    Signed-off-by: John Garry
    Signed-off-by: Will Deacon
    Signed-off-by: Sasha Levin

    John Garry
     

04 Mar, 2020

5 commits

  • Add driver support for i.MX8DXL DB Perf, which supports AXI ID PORT
    CHANNEL filter.

    Reviewed-by: Fugang Duan
    Signed-off-by: Joakim Zhang

    Joakim Zhang
     
  • Add clock support for Perf in DB SS, since Perf LPCG has the clocks off
    by default.

    Reviewed-by: Fugang Duan
    Signed-off-by: Joakim Zhang

    Joakim Zhang
     
  • There is a PMU in DB(DRAM Block) which has the same function with PMU in DDR
    subsystem, the difference is PMU in DB only supports cycles, axid-read,
    axid-write events.
    The role of the DB is to route the read/write transaction from connected
    subsystems to either the DDR subsystem, or to any other subsystems. The AXI
    IDs used is the one seen at the PORT.

    e.g.
    perf stat -a -e imx8_db0/axid-read,axi_mask=0xMMMM,axi_id=0xDDDD,axi_port=0xPP,axi_channel=0xH/ cmd
    perf stat -a -e imx8_db0/axid-write,axi_mask=0xMMMM,axi_id=0xDDDD,axi_port=0xPP,axi_channel=0xH/ cmd

    Reviewed-by: Fugang Duan
    Signed-off-by: Joakim Zhang

    Joakim Zhang
     
  • Add driver support for i.MX8DXL DDR Perf, which supports AXI ID PORT
    CHANNEL filter.

    Reviewed-by: Fugang Duan
    Signed-off-by: Joakim Zhang

    Joakim Zhang
     
  • This is the extension of AXI ID filter.

    Filter is defined with 2 configuration registers per counter 1-3 (counter 0 is
    not used for filtering and lacks these registers).
    * Counter N MASK COMP register - AXI_ID and AXI_MASKING.
    * Counter N MUX CNTL register - AXI CHANNEL and AXI PORT.
    -- 0: address channel
    -- 1: data channel

    This filter is exposed to userspace as an additional (channel, port) pair. The
    definition of axi_channel is inverted in userspace, and it will be reverted in
    driver automatically.

    AXI filter of Perf Monitor in DDR Subsystem, only a single port0 exist, so
    axi_port is reserved which should be 0.

    e.g.
    perf stat -a -e imx8_ddr0/axid-read,axi_mask=0xMMMM,axi_id=0xDDDD,axi_channel=0xH/ cmd
    perf stat -a -e imx8_ddr0/axid-write,axi_mask=0xMMMM,axi_id=0xDDDD,axi_channel=0xH/ cmd

    Reviewed-by: Fugang Duan
    Signed-off-by: Joakim Zhang

    Joakim Zhang
     

25 Feb, 2020

1 commit

  • ddr_perf_event_stop will firstly call ddr_perf_counter_enable to disable
    the counter, and then call ddr_perf_event_update to read the counter value.

    When disable the counter, it will write 0 into COUNTER_CNTL[CLEAR] bit
    which cause the counter value cleared. Counter value will always be 0
    when update the counter.

    The correct definition of CLEAR bit is that write 0 to clear the counter
    value.

    Reviewed-by: Fugang Duan
    Signed-off-by: Joakim Zhang

    Joakim Zhang
     

24 Feb, 2020

1 commit

  • [ Upstream commit 9ee68b314e9aa63ed11b98beb8a68810b8234dcf ]

    This driver allocates a dynamic cpu hotplug state but never releases it.
    If reloaded in a loop it will quickly trigger a WARN message:

    "No more dynamic states available for CPU hotplug"

    Fix by calling cpuhp_remove_multi_state on remove like several other
    perf pmu drivers.

    Also fix the cleanup logic on probe error paths: add the missing
    cpuhp_remove_multi_state call and properly check the return value from
    cpuhp_state_add_instant_nocalls.

    Fixes: 9a66d36cc7ac ("drivers/perf: imx_ddr: Add DDR performance counter support to perf")
    Acked-by: Joakim Zhang
    Signed-off-by: Leonard Crestez
    Signed-off-by: Will Deacon
    Signed-off-by: Sasha Levin

    Leonard Crestez
     

01 Feb, 2020

1 commit

  • [ Upstream commit 44f8bd014a94ed679ddb77d0b92350d4ac4f23a5 ]

    With DDR_CAP_AXI_ID_FILTER quirk, indicating HW supports AXI ID filter
    which only can get bursts from DDR transaction, i.e. DDR read/write
    requests.

    This patch add DDR_CAP_AXI_ID_ENHANCED_FILTER quirk, indicating HW
    supports AXI ID filter which can get bursts and bytes from DDR
    transaction at the same time. We hope PMU always return bytes in the
    driver due to it is more meaningful for users.

    Signed-off-by: Joakim Zhang
    Signed-off-by: Will Deacon
    Signed-off-by: Sasha Levin

    Joakim Zhang
     

12 Jan, 2020

1 commit

  • [ Upstream commit 8ae4bcf4821c18a8fbfa0b2c1df26c1085e9d923 ]

    In smmu_pmu_probe(), there is put_cpu() in the error path,
    which is wrong because we use raw_smp_processor_id() to
    get the cpu ID, not get_cpu(), remove it.

    While we are at it, kill 'out_cpuhp_err' altogether and
    just return err if we fail to add the hotplug instance.

    Acked-by: Robin Murphy
    Acked-by: Will Deacon
    Signed-off-by: Hanjun Guo
    Signed-off-by: Catalin Marinas
    Signed-off-by: Sasha Levin

    Hanjun Guo
     

07 Jan, 2020

2 commits

  • For i.MX8MP, we cannot ensure that cycle counter overflow occurs at
    least 4 times as often as other events. Due to byte counters will count for
    any event configured, it will overflow more often. And if byte counters
    oveflow that related counters would stop since they share the
    COUNTER_CNTL. We can speed up cycle counter overflow frequency by
    setting counter parameter(CP) field of cycle counter.

    Reviewed-by: Fugang Duan
    Signed-off-by: Joakim Zhang

    Joakim Zhang
     
  • DDR perf driver now only supports free running counter, add stop counter
    support which is compabile with free running counter, since i.MX8MP is
    not free running.

    Add spinlock for counter value update and clear.

    Reviewed-by: Fugang Duan
    Signed-off-by: Joakim Zhang

    Joakim Zhang
     

28 Nov, 2019

3 commits

  • caps/filter indicates whether HW supports AXI ID filter or not.
    caps/enhanced_filter indicates whether HW supports enhanced AXI ID filter
    or not.

    Users can check filter features from userspace with these attributions.

    Suggested-by: Will Deacon
    Signed-off-by: Joakim Zhang
    [will: reworked cap switch to be less error-prone]
    Signed-off-by: Will Deacon

    Joakim Zhang
     
  • Add driver for DDR PMU in i.MX8MPlus.

    Signed-off-by: Joakim Zhang
    Signed-off-by: Will Deacon

    Joakim Zhang
     
  • With DDR_CAP_AXI_ID_FILTER quirk, indicating HW supports AXI ID filter
    which only can get bursts from DDR transaction, i.e. DDR read/write
    requests.

    This patch add DDR_CAP_AXI_ID_ENHANCED_FILTER quirk, indicating HW
    supports AXI ID filter which can get bursts and bytes from DDR
    transaction at the same time. We hope PMU always return bytes in the
    driver due to it is more meaningful for users.

    Signed-off-by: Joakim Zhang
    Signed-off-by: Will Deacon

    Joakim Zhang
     

30 Aug, 2019

1 commit

  • …njection', 'for-next/perf', 'for-next/psci-cpuidle', 'for-next/rng', 'for-next/smpboot', 'for-next/tbi' and 'for-next/tlbi' into for-next/core

    * for-next/52-bit-kva: (25 commits)
    Support for 52-bit virtual addressing in kernel space

    * for-next/cpu-topology: (9 commits)
    Move CPU topology parsing into core code and add support for ACPI 6.3

    * for-next/error-injection: (2 commits)
    Support for function error injection via kprobes

    * for-next/perf: (8 commits)
    Support for i.MX8 DDR PMU and proper SMMUv3 group validation

    * for-next/psci-cpuidle: (7 commits)
    Move PSCI idle code into a new CPUidle driver

    * for-next/rng: (4 commits)
    Support for 'rng-seed' property being passed in the devicetree

    * for-next/smpboot: (3 commits)
    Reduce fragility of secondary CPU bringup in debug configurations

    * for-next/tbi: (10 commits)
    Introduce new syscall ABI with relaxed requirements for pointer tags

    * for-next/tlbi: (6 commits)
    Handle spurious page faults arising from kernel space

    Will Deacon
     

28 Aug, 2019

3 commits

  • AXI filtering is used by events 0x41 and 0x42 to count reads or writes
    with an ARID or AWID matching a specified filter. The filter is exposed
    to userspace as an (ID, MASK) pair, where each set bit in the mask
    causes the corresponding bit in the ID to be ignored when matching
    against the ID of memory transactions for the purposes of incrementing
    the counter.

    For example:

    # perf stat -a -e imx8_ddr0/axid-read,axi_mask=0xff,axi_id=0x800/ cmd

    will count all read transactions from AXI IDs 0x800 - 0x8ff. If the
    'axi_mask' is omitted, then it is treated as 0x0 which means that the
    'axi_id' will be matched exactly.

    Signed-off-by: Joakim Zhang
    Signed-off-by: Will Deacon

    Joakim Zhang
     
  • With global filtering, it becomes possible for users to construct
    self-contradictory groups with conflicting filters. Make sure we
    cover that when initially validating events.

    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • Ensure that a group will actually fit into the available counters.

    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     

01 Aug, 2019

2 commits

  • We don't need dev_err() messages when platform_get_irq() fails now that
    platform_get_irq() prints an error message itself when something goes
    wrong. Let's remove these prints with a simple semantic patch.

    //
    @@
    expression ret;
    struct platform_device *E;
    @@

    ret =
    (
    platform_get_irq(E, ...)
    |
    platform_get_irq_byname(E, ...)
    );

    if ( \( ret < 0 \| ret

    While we're here, remove braces on if statements that only have one
    statement (manually).

    Cc: Will Deacon
    Cc: Mark Rutland
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: Greg Kroah-Hartman
    Signed-off-by: Stephen Boyd
    Signed-off-by: Will Deacon

    Stephen Boyd
     
  • This is required for automatic probing when driver is built as a module.

    Fixes: 9a66d36cc7ac ("drivers/perf: imx_ddr: Add DDR performance counter support to perf")
    Acked-by: Frank Li
    Signed-off-by: Leonard Crestez
    Signed-off-by: Will Deacon

    Leonard Crestez
     

29 Jul, 2019

1 commit

  • Handling of the CPU_PM_ENTER_FAILED transition in the Arm PMU PM
    notifier code incorrectly skips restoration of the counters. Fix the
    logic so that CPU_PM_ENTER_FAILED follows the same path as CPU_PM_EXIT.

    Cc:
    Fixes: da4e4f18afe0f372 ("drivers/perf: arm_pmu: implement CPU_PM notifier")
    Reported-by: Anders Roxell
    Acked-by: Lorenzo Pieralisi
    Signed-off-by: Will Deacon

    Will Deacon
     

15 Jul, 2019

2 commits

  • The perf infrastructure is used for userspace to track issues.
    At least a good part of what's described here is related to
    it.

    So, add it to the admin-guide.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Rename the perf documentation files to ReST, add an
    index for them and adjust in order to produce a nice html
    output via the Sphinx build system.

    At its new index.rst, let's add a :orphan: while this is not linked to
    the main index.rst file, in order to avoid build warnings.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

09 Jul, 2019

1 commit

  • Pull arm64 updates from Catalin Marinas:

    - arm64 support for syscall emulation via PTRACE_SYSEMU{,_SINGLESTEP}

    - Wire up VM_FLUSH_RESET_PERMS for arm64, allowing the core code to
    manage the permissions of executable vmalloc regions more strictly

    - Slight performance improvement by keeping softirqs enabled while
    touching the FPSIMD/SVE state (kernel_neon_begin/end)

    - Expose a couple of ARMv8.5 features to user (HWCAP): CondM (new
    XAFLAG and AXFLAG instructions for floating point comparison flags
    manipulation) and FRINT (rounding floating point numbers to integers)

    - Re-instate ARM64_PSEUDO_NMI support which was previously marked as
    BROKEN due to some bugs (now fixed)

    - Improve parking of stopped CPUs and implement an arm64-specific
    panic_smp_self_stop() to avoid warning on not being able to stop
    secondary CPUs during panic

    - perf: enable the ARM Statistical Profiling Extensions (SPE) on ACPI
    platforms

    - perf: DDR performance monitor support for iMX8QXP

    - cache_line_size() can now be set from DT or ACPI/PPTT if provided to
    cope with a system cache info not exposed via the CPUID registers

    - Avoid warning on hardware cache line size greater than
    ARCH_DMA_MINALIGN if the system is fully coherent

    - arm64 do_page_fault() and hugetlb cleanups

    - Refactor set_pte_at() to avoid redundant READ_ONCE(*ptep)

    - Ignore ACPI 5.1 FADTs reported as 5.0 (infer from the
    'arm_boot_flags' introduced in 5.1)

    - CONFIG_RANDOMIZE_BASE now enabled in defconfig

    - Allow the selection of ARM64_MODULE_PLTS, currently only done via
    RANDOMIZE_BASE (and an erratum workaround), allowing modules to spill
    over into the vmalloc area

    - Make ZONE_DMA32 configurable

    * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (54 commits)
    perf: arm_spe: Enable ACPI/Platform automatic module loading
    arm_pmu: acpi: spe: Add initial MADT/SPE probing
    ACPI/PPTT: Add function to return ACPI 6.3 Identical tokens
    ACPI/PPTT: Modify node flag detection to find last IDENTICAL
    x86/entry: Simplify _TIF_SYSCALL_EMU handling
    arm64: rename dump_instr as dump_kernel_instr
    arm64/mm: Drop [PTE|PMD]_TYPE_FAULT
    arm64: Implement panic_smp_self_stop()
    arm64: Improve parking of stopped CPUs
    arm64: Expose FRINT capabilities to userspace
    arm64: Expose ARMv8.5 CondM capability to userspace
    arm64: defconfig: enable CONFIG_RANDOMIZE_BASE
    arm64: ARM64_MODULES_PLTS must depend on MODULES
    arm64: bpf: do not allocate executable memory
    arm64/kprobes: set VM_FLUSH_RESET_PERMS on kprobe instruction pages
    arm64/mm: wire up CONFIG_ARCH_HAS_SET_DIRECT_MAP
    arm64: module: create module allocations without exec permissions
    arm64: Allow user selection of ARM64_MODULE_PLTS
    acpi/arm64: ignore 5.1 FADTs that are reported as 5.0
    arm64: Allow selecting Pseudo-NMI again
    ...

    Linus Torvalds
     

27 Jun, 2019

2 commits

  • Lets add the MODULE_TABLE and platform id_table entries so that
    the SPE driver can attach to the ACPI platform device created by
    the core pmu code.

    Tested-by: Hanjun Guo
    Reviewed-by: Sudeep Holla
    Signed-off-by: Jeremy Linton
    Signed-off-by: Will Deacon

    Jeremy Linton
     
  • ACPI 6.3 adds additional fields to the MADT GICC
    structure to describe SPE PPI's. We pick these out
    of the cached reference to the madt_gicc structure
    similarly to the core PMU code. We then create a platform
    device referring to the IRQ and let the user/module loader
    decide whether to load the SPE driver.

    Tested-by: Hanjun Guo
    Reviewed-by: Sudeep Holla
    Reviewed-by: Lorenzo Pieralisi
    Signed-off-by: Jeremy Linton
    Signed-off-by: Will Deacon

    Jeremy Linton
     

19 Jun, 2019

2 commits

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details you should have received a copy of the gnu general
    public license along with this program if not see http www gnu org
    licenses

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 503 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Alexios Zavras
    Reviewed-by: Allison Randal
    Reviewed-by: Enrico Weigelt
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190602204653.811534538@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

13 Jun, 2019

1 commit

  • Add DDR performance monitor support for iMX8QXP. The PMU consists of 3
    programmable event counters and a single dedicated cycle counter.

    Example usage:

    $ perf stat -a -e \
    imx8_ddr0/read-cycles/,imx8_ddr0/write-cycles/,imx8_ddr0/precharge/ ls

    - or -

    $ perf stat -a -e \
    imx8_ddr0/cycles/,imx8_ddr0/read-access/,imx8_ddr0/write-access/ ls

    Other events are supported, and advertised via perf list.

    Reviewed-by: Andrey Smirnov
    Signed-off-by: Frank Li
    [will: rewrote commit message/kconfig and used #defines for dev/cpuhp names]
    Signed-off-by: Will Deacon

    Frank Li
     

05 Jun, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 and
    only version 2 as published by the free software foundation this
    program is distributed in the hope that it will be useful but
    without any warranty without even the implied warranty of
    merchantability or fitness for a particular purpose see the gnu
    general public license for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 294 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Alexios Zavras
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190529141900.825281744@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 655 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Reviewed-by: Richard Fontana
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070034.575739538@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

22 May, 2019

1 commit

  • Pull arm64 fixes from Will Deacon:

    - Fix SPE probe failure when backing auxbuf with high-order pages

    - Fix handling of DMA allocations from outside of the vmalloc area

    - Fix generation of build-id ELF section for vDSO object

    - Disable huge I/O mappings if kernel page table dumping is enabled

    - A few other minor fixes (comments, kconfig etc)

    * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
    arm64: vdso: Explicitly add build-id option
    arm64/mm: Inhibit huge-vmap with ptdump
    arm64: Print physical address of page table base in show_pte()
    arm64: don't trash config with compat symbol if COMPAT is disabled
    arm64: assembler: Update comment above cond_yield_neon() macro
    drivers/perf: arm_spe: Don't error on high-order pages for aux buf
    arm64/iommu: handle non-remapped addresses in ->mmap and ->get_sgtable

    Linus Torvalds
     

21 May, 2019

3 commits

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it will be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details you
    should have received a copy of the gnu general public license along
    with this program if not see http www gnu org licenses

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it will be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details [based]
    [from] [clk] [highbank] [c] you should have received a copy of the
    gnu general public license along with this program if not see http
    www gnu org licenses

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 355 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Kate Stewart
    Reviewed-by: Jilayne Lovejoy
    Reviewed-by: Steve Winslow
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190519154041.837383322@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Add SPDX license identifiers to all Make/Kconfig files which:

    - Have no license information of any form

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Add SPDX license identifiers to all files which:

    - Have no license information of any form

    - Have EXPORT_.*_SYMBOL_GPL inside which was used in the
    initial scan/conversion to ignore the file

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

14 May, 2019

1 commit

  • Since commit 5768402fd9c6 ("perf/ring_buffer: Use high order allocations
    for AUX buffers optimistically"), the perf core tends to back aux buffer
    allocations with high-order pages with the order encoded in the
    PagePrivate data. The Arm SPE driver explicitly rejects such pages,
    causing the perf tool to fail with:

    | failed to mmap with 12 (Cannot allocate memory)

    In actual fact, we can simply treat these pages just like any other
    since the perf core takes care to populate the page array appropriately.
    In theory we could try to map with PMDs where possible, but for now,
    let's just get things working again.

    Cc: Alexander Shishkin
    Fixes: 5768402fd9c6 ("perf/ring_buffer: Use high order allocations for AUX buffers optimistically")
    Reported-by: Hanjun Guo
    Tested-by: Hanjun Guo
    Tested-by: Sudeep Holla
    Signed-off-by: Will Deacon

    Will Deacon
     

23 Apr, 2019

2 commits

  • Like arm-cci, arm-ccn has the same issue of disabling preemption around
    operations which can take mutexes. Again, remove the definite bug by
    simply not trying to fight the theoretical races. And since we are
    touching the hotplug handling code, take the opportunity to streamline
    it, as there's really no need to store a full-sized cpumask to keep
    track of a single CPU ID.

    Reviewed-by: Suzuki K Poulose
    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy
     
  • Uncore PMU drivers face an awkward cyclic dependency wherein:

    - They have to pick a valid online CPU to associate with before
    registering the PMU device, since it will get exposed to userspace
    immediately.
    - The PMU registration has to be be at least partly complete before
    hotplug events can be handled, since trying to migrate an
    uninitialised context would be bad.
    - The hotplug handler has to be ready as soon as a CPU is chosen, lest
    it go offline without the user-visible cpumask value getting updated.

    The arm-cci driver has tried to solve this by using get_cpu() to pick
    the current CPU and prevent it from disappearing while both
    registrations are performed, but that results in taking mutexes with
    preemption disabled, which makes certain configurations very unhappy:

    [ 1.983337] BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:2004
    [ 1.983340] in_atomic(): 1, irqs_disabled(): 0, pid: 1, name: swapper/0
    [ 1.983342] Preemption disabled at:
    [ 1.983353] [] cci_pmu_probe+0x1dc/0x488
    [ 1.983360] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.18.20-rt8-yocto-preempt-rt #1
    [ 1.983362] Hardware name: ZynqMP ZCU102 Rev1.0 (DT)
    [ 1.983364] Call trace:
    [ 1.983369] dump_backtrace+0x0/0x158
    [ 1.983372] show_stack+0x24/0x30
    [ 1.983378] dump_stack+0x80/0xa4
    [ 1.983383] ___might_sleep+0x138/0x160
    [ 1.983386] __might_sleep+0x58/0x90
    [ 1.983391] __rt_mutex_lock_state+0x30/0xc0
    [ 1.983395] _mutex_lock+0x24/0x30
    [ 1.983400] perf_pmu_register+0x2c/0x388
    [ 1.983404] cci_pmu_probe+0x2bc/0x488
    [ 1.983409] platform_drv_probe+0x58/0xa8

    It is not feasible to resolve all the possible races outside of the perf
    core itself, so address the immediate bug by following the example of
    nearly every other PMU driver and not even trying to do so. Registering
    the hotplug notifier first should minimise the window in which things
    can go wrong, so that's about as much as we can reasonably do here. This
    also revealed an additional race in assigning the global pointer too
    late relative to the hotplug notifier, which gets fixed in the process.

    Reported-by: Li, Meng
    Tested-by: Corentin Labbe
    Reviewed-by: Suzuki K Poulose
    Signed-off-by: Robin Murphy
    Signed-off-by: Will Deacon

    Robin Murphy