15 Jan, 2020

1 commit

  • commit 3aa3c5882e4fb2274448908aaed605a3ed7dd15d upstream.

    RAPL MMIO support depends on the RAPL common driver. During CPU
    initialization rapl_mmio_cpu_online() is called via CPU hotplug
    to initialize the MMIO RAPL for the new CPU, but if that CPU is
    not present in the common RAPL driver's support list, rapl_defaults
    is NULL and the kernel crashes on an attempt to dereference it:

    [ 4.188566] BUG: kernel NULL pointer dereference, address: 0000000000000020
    ...snip...
    [ 4.189555] RIP: 0010:rapl_add_package+0x223/0x574
    [ 4.189555] Code: b5 a0 31 c0 49 8b 4d 78 48 01 d9 48 8b 0c c1 49 89 4c c6 10 48 ff c0 48 83 f8 05 75 e7 49 83 ff 03 75 15 48 8b 05 09 bc 18 01 70 20 41 89 b6 0c 05 00 00 85 f6 75 1a 49 81 c6 18 9
    [ 4.189555] RSP: 0000:ffffb3adc00b3d90 EFLAGS: 00010246
    [ 4.189555] RAX: 0000000000000000 RBX: 0000000000000098 RCX: 0000000000000000
    [ 4.267161] usb 1-1: New USB device found, idVendor=2109, idProduct=2812, bcdDevice= b.e0
    [ 4.189555] RDX: 0000000000001000 RSI: 0000000000000000 RDI: ffff9340caafd000
    [ 4.189555] RBP: ffffb3adc00b3df8 R08: ffffffffa0246e28 R09: ffff9340caafc000
    [ 4.189555] R10: 000000000000024a R11: ffffffff9ff1f6f2 R12: 00000000ffffffed
    [ 4.189555] R13: ffff9340caa94800 R14: ffff9340caafc518 R15: 0000000000000003
    [ 4.189555] FS: 0000000000000000(0000) GS:ffff9340ce200000(0000) knlGS:0000000000000000
    [ 4.189555] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [ 4.189555] CR2: 0000000000000020 CR3: 0000000302c14001 CR4: 00000000003606f0
    [ 4.189555] Call Trace:
    [ 4.189555] ? __switch_to_asm+0x40/0x70
    [ 4.189555] rapl_mmio_cpu_online+0x47/0x64
    [ 4.189555] ? rapl_mmio_write_raw+0x33/0x33
    [ 4.281059] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [ 4.189555] cpuhp_invoke_callback+0x29f/0x66f
    [ 4.189555] ? __schedule+0x46d/0x6a0
    [ 4.189555] cpuhp_thread_fun+0xb9/0x11c
    [ 4.189555] smpboot_thread_fn+0x17d/0x22f
    [ 4.297006] usb 1-1: Product: USB2.0 Hub
    [ 4.189555] ? cpu_report_death+0x43/0x43
    [ 4.189555] kthread+0x137/0x13f
    [ 4.189555] ? cpu_report_death+0x43/0x43
    [ 4.189555] ? kthread_blkcg+0x2e/0x2e
    [ 4.312951] usb 1-1: Manufacturer: VIA Labs, Inc.
    [ 4.189555] ret_from_fork+0x1f/0x40
    [ 4.189555] Modules linked in:
    [ 4.189555] CR2: 0000000000000020
    [ 4.189555] ---[ end trace 01bb812aabc791f4 ]---

    To avoid that problem, check rapl_defaults NULL upfront and return an
    error code if it is NULL. [Note that it does not make sense to even
    try to allocate memory in that case, because it is not going to be
    used anyway.]

    Fixes: 555c45fe0d04 ("int340X/processor_thermal_device: add support for MMIO RAPL")
    Cc: 5.3+ # 5.3+
    Signed-off-by: Harry Pan
    [ rjw: Subject & changelog ]
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Harry Pan
     

18 Sep, 2019

1 commit

  • Pull power management updates from Rafael Wysocki:
    "These include a rework of the main suspend-to-idle code flow (related
    to the handling of spurious wakeups), a switch over of several users
    of cpufreq notifiers to QoS-based limits, a new devfreq driver for
    Tegra20, a new cpuidle driver and governor for virtualized guests, an
    extension of the wakeup sources framework to expose wakeup sources as
    device objects in sysfs, and more.

    Specifics:

    - Rework the main suspend-to-idle control flow to avoid repeating
    "noirq" device resume and suspend operations in case of spurious
    wakeups from the ACPI EC and decouple the ACPI EC wakeups support
    from the LPS0 _DSM support (Rafael Wysocki).

    - Extend the wakeup sources framework to expose wakeup sources as
    device objects in sysfs (Tri Vo, Stephen Boyd).

    - Expose system suspend statistics in sysfs (Kalesh Singh).

    - Introduce a new haltpoll cpuidle driver and a new matching governor
    for virtualized guests wanting to do guest-side polling in the idle
    loop (Marcelo Tosatti, Joao Martins, Wanpeng Li, Stephen Rothwell).

    - Fix the menu and teo cpuidle governors to allow the scheduler tick
    to be stopped if PM QoS is used to limit the CPU idle state exit
    latency in some cases (Rafael Wysocki).

    - Increase the resolution of the play_idle() argument to microseconds
    for more fine-grained injection of CPU idle cycles (Daniel
    Lezcano).

    - Switch over some users of cpuidle notifiers to the new QoS-based
    frequency limits and drop the CPUFREQ_ADJUST and CPUFREQ_NOTIFY
    policy notifier events (Viresh Kumar).

    - Add new cpufreq driver based on nvmem for sun50i (Yangtao Li).

    - Add support for MT8183 and MT8516 to the mediatek cpufreq driver
    (Andrew-sh.Cheng, Fabien Parent).

    - Add i.MX8MN support to the imx-cpufreq-dt cpufreq driver (Anson
    Huang).

    - Add qcs404 to cpufreq-dt-platdev blacklist (Jorge Ramirez-Ortiz).

    - Update the qcom cpufreq driver (among other things, to make it
    easier to extend and to use kryo cpufreq for other nvmem-based
    SoCs) and add qcs404 support to it (Niklas Cassel, Douglas
    RAILLARD, Sibi Sankar, Sricharan R).

    - Fix assorted issues and make assorted minor improvements in the
    cpufreq code (Colin Ian King, Douglas RAILLARD, Florian Fainelli,
    Gustavo Silva, Hariprasad Kelam).

    - Add new devfreq driver for NVidia Tegra20 (Dmitry Osipenko, Arnd
    Bergmann).

    - Add new Exynos PPMU events to devfreq events and extend that
    mechanism (Lukasz Luba).

    - Fix and clean up the exynos-bus devfreq driver (Kamil Konieczny).

    - Improve devfreq documentation and governor code, fix spelling typos
    in devfreq (Ezequiel Garcia, Krzysztof Kozlowski, Leonard Crestez,
    MyungJoo Ham, Gaël PORTAY).

    - Add regulators enable and disable to the OPP (operating performance
    points) framework (Kamil Konieczny).

    - Update the OPP framework to support multiple opp-suspend properties
    (Anson Huang).

    - Fix assorted issues and make assorted minor improvements in the OPP
    code (Niklas Cassel, Viresh Kumar, Yue Hu).

    - Clean up the generic power domains (genpd) framework (Ulf Hansson).

    - Clean up assorted pieces of power management code and documentation
    (Akinobu Mita, Amit Kucheria, Chuhong Yuan).

    - Update the pm-graph tool to version 5.5 including multiple fixes
    and improvements (Todd Brandt).

    - Update the cpupower utility (Benjamin Weis, Geert Uytterhoeven,
    Sébastien Szymanski)"

    * tag 'pm-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (126 commits)
    cpuidle-haltpoll: Enable kvm guest polling when dedicated physical CPUs are available
    cpuidle-haltpoll: do not set an owner to allow modunload
    cpuidle-haltpoll: return -ENODEV on modinit failure
    cpuidle-haltpoll: set haltpoll as preferred governor
    cpuidle: allow governor switch on cpuidle_register_driver()
    PM: runtime: Documentation: add runtime_status ABI document
    pm-graph: make setVal unbuffered again for python2 and python3
    powercap: idle_inject: Use higher resolution for idle injection
    cpuidle: play_idle: Increase the resolution to usec
    cpuidle-haltpoll: vcpu hotplug support
    cpufreq: Add qcs404 to cpufreq-dt-platdev blacklist
    cpufreq: qcom: Add support for qcs404 on nvmem driver
    cpufreq: qcom: Refactor the driver to make it easier to extend
    cpufreq: qcom: Re-organise kryo cpufreq to use it for other nvmem based qcom socs
    dt-bindings: opp: Add qcom-opp bindings with properties needed for CPR
    dt-bindings: opp: qcom-nvmem: Support pstates provided by a power domain
    Documentation: cpufreq: Update policy notifier documentation
    cpufreq: Remove CPUFREQ_ADJUST and CPUFREQ_NOTIFY policy notifier events
    PM / Domains: Verify PM domain type in dev_pm_genpd_set_performance_state()
    PM / Domains: Simplify genpd_lookup_dev()
    ...

    Linus Torvalds
     

03 Sep, 2019

2 commits

  • The resolution of the idle injection is limited to 1ms. If there is
    a need for an injection of 1.2 ms, it is not possible.

    The idle injection API is not yet used, so it is safe to convert the
    existing API to the new time unit instead of adding more functions.

    Convert to microsecond in order to use a finer grain time unit when
    injecting idle cycles.

    Signed-off-by: Daniel Lezcano
    Signed-off-by: Rafael J. Wysocki

    Daniel Lezcano
     
  • The play_idle resolution is 1ms. The intel_powerclamp bases the idle
    duration on jiffies. The idle injection API is also using msec based
    duration but has no user yet.

    Unfortunately, msec based time does not fit well when we want to
    inject idle cycle precisely with shallow idle state.

    In order to set the scene for the incoming idle injection user, move
    the precision up to usec when calling play_idle.

    Signed-off-by: Daniel Lezcano
    Signed-off-by: Rafael J. Wysocki

    Daniel Lezcano
     

28 Aug, 2019

4 commits

  • Currently big microservers have _XEON_D while small microservers have
    _X, Make it uniformly: _D.

    for i in `git grep -l "\(INTEL_FAM6_\|VULNWL_INTEL\|INTEL_CPU_FAM6\).*_\(X\|XEON_D\)"`
    do
    sed -i -e 's/\(\(INTEL_FAM6_\|VULNWL_INTEL\|INTEL_CPU_FAM6\).*ATOM.*\)_X/\1_D/g' \
    -e 's/\(\(INTEL_FAM6_\|VULNWL_INTEL\|INTEL_CPU_FAM6\).*\)_XEON_D/\1_D/g' ${i}
    done

    Signed-off-by: Peter Zijlstra (Intel)
    Reviewed-by: Tony Luck
    Cc: x86@kernel.org
    Cc: Dave Hansen
    Cc: Thomas Gleixner
    Cc: Borislav Petkov
    Link: https://lkml.kernel.org/r/20190827195122.677152989@infradead.org

    Peter Zijlstra
     
  • Currently big core clients with extra graphics on have:

    - _G
    - _GT3E

    Make it uniformly: _G

    for i in `git grep -l "\(INTEL_FAM6_\|VULNWL_INTEL\|INTEL_CPU_FAM6\).*_GT3E"`
    do
    sed -i -e 's/\(\(INTEL_FAM6_\|VULNWL_INTEL\|INTEL_CPU_FAM6\).*\)_GT3E/\1_G/g' ${i}
    done

    Signed-off-by: Peter Zijlstra (Intel)
    Reviewed-by: Tony Luck
    Cc: x86@kernel.org
    Cc: Dave Hansen
    Cc: Thomas Gleixner
    Cc: Borislav Petkov
    Link: https://lkml.kernel.org/r/20190827195122.622802314@infradead.org

    Peter Zijlstra
     
  • Currently big core mobile chips have either:

    - _L
    - _ULT
    - _MOBILE

    Make it uniformly: _L.

    for i in `git grep -l "\(INTEL_FAM6_\|VULNWL_INTEL\|INTEL_CPU_FAM6\).*_\(MOBILE\|ULT\)"`
    do
    sed -i -e 's/\(\(INTEL_FAM6_\|VULNWL_INTEL\|INTEL_CPU_FAM6\).*\)_\(MOBILE\|ULT\)/\1_L/g' ${i}
    done

    Signed-off-by: Peter Zijlstra (Intel)
    Reviewed-by: Tony Luck
    Cc: x86@kernel.org
    Cc: Dave Hansen
    Cc: Borislav Petkov
    Cc: Thomas Gleixner
    Link: https://lkml.kernel.org/r/20190827195122.568978530@infradead.org

    Peter Zijlstra
     
  • Currently the big core client models either have:

    - no OPTDIFF
    - _CORE
    - _DESKTOP

    Make it uniformly: 'no OPTDIFF'.

    for i in `git grep -l "\(INTEL_FAM6_\|VULNWL_INTEL\|INTEL_CPU_FAM6\).*_\(CORE\|DESKTOP\)"`
    do
    sed -i -e 's/\(\(INTEL_FAM6_\|VULNWL_INTEL\|INTEL_CPU_FAM6\).*\)_\(CORE\|DESKTOP\)/\1/g' ${i}
    done

    Signed-off-by: Peter Zijlstra (Intel)
    Reviewed-by: Tony Luck
    Cc: x86@kernel.org
    Cc: Dave Hansen
    Cc: Borislav Petkov
    Cc: Thomas Gleixner
    Link: https://lkml.kernel.org/r/20190827195122.513945586@infradead.org

    Peter Zijlstra
     

22 Jul, 2019

1 commit

  • The MMIO RAPL interface driver depends on both powercap subsystem and
    the intel_rapl_common code.

    But when all of them are built-in, the MMIO RAPL interface driver can
    be loaded before the other two and this breaks the system during boot.

    Fix this by adjusting the init order of the powercap subsystem and the
    intel_rapl_common code, so that it can be initialized first.

    Fixes: 555c45fe0d04 ("int340X/processor_thermal_device: add support for MMIO RAPL")
    Reported-by: Kenneth R. Crudup
    Tested-by: Kenneth R. Crudup
    Signed-off-by: Zhang Rui
    [ rjw: Subject & changelog ]
    Signed-off-by: Rafael J. Wysocki

    Zhang Rui
     

11 Jul, 2019

16 commits

  • Enables support for ICL-NNPI, which is a neural network processor for deep
    learning inference. From RAPL point of view it is same as Ice Lake Mobile
    processor.

    Link: https://lkml.org/lkml/2019/6/5/1034
    Signed-off-by: Rajneesh Bhardwaj
    Signed-off-by: Zhang Rui
    Signed-off-by: Rafael J. Wysocki

    Rajneesh Bhardwaj
     
  • Add ICX-D support in intel_rapl driver

    Signed-off-by: Zhang Rui
    Signed-off-by: Rafael J. Wysocki

    Zhang Rui
     
  • Add ICX support in intel_rapl driver

    Signed-off-by: Jacob Pan
    Signed-off-by: Rajneesh Bhardwaj
    Signed-off-by: Zhang Rui
    Signed-off-by: Rafael J. Wysocki

    Zhang Rui
     
  • Add IceLake desktop support in intel_rapl driver

    Signed-off-by: Gayatri Kammela
    Signed-off-by: Joe Konno
    Signed-off-by: Zhang Rui
    Signed-off-by: Rafael J. Wysocki

    Zhang Rui
     
  • intel_rapl driver used to have a list of cpuids, which is used to
    1. check if the processor support RAPL MSRs
    2. do some cpu model specific setting
    3. module autoloading

    Now, the cpu model specific setting are moved to intel_rapl_common.c as
    part of the common code, because the setup is also needed by RAPL MMIO
    interface on those platforms.
    But removing the cpuid list from intel_rapl MSR interface driver results
    in that the driver can not be loaded automatically.

    Maintaining another copy of the cpuid list in intel_rapl_msr.c does not make
    sense because it increases the complexity when enabling RAPL support on a
    new cpu model.

    Fix the problem by creating an "intel_rapl_msr" platform device in the
    common code, and make RAPL MSR interface driver (intel_rapl_msr.c) probe the
    platform device directly.

    Reviewed-by: Pandruvada, Srinivas
    Tested-by: Pandruvada, Srinivas
    Signed-off-by: Zhang Rui
    Signed-off-by: Rafael J. Wysocki

    Zhang Rui
     
  • RAPL MSR interface supports 2 power limits for package domain, and 1 power
    limit for other domains, while RAPL MMIO interface supports 2 power limits
    for both package and dram domains.
    And when 2 power limits are supported, the FW_LOCK bit is in bit 63 of the
    register, instead of bit 31.

    Remove the assumption that only pakcage domain supports 2 power limits.
    And allow the RAPL interface driver to specify the number of power limits
    supported, for every single RAPL domain it owns..

    Reviewed-by: Pandruvada, Srinivas
    Tested-by: Pandruvada, Srinivas
    Signed-off-by: Zhang Rui
    Signed-off-by: Rafael J. Wysocki

    Zhang Rui
     
  • RAPL MMIO interface uses 64 bit registers, thus force use 64 bit register
    for all the RAPL code.

    Reviewed-by: Pandruvada, Srinivas
    Tested-by: Pandruvada, Srinivas
    Signed-off-by: Zhang Rui
    Signed-off-by: Rafael J. Wysocki

    Zhang Rui
     
  • Split intel_rapl.c to intel_rapl_common.c and intel_rapl_msr.c, where
    intel_rapl_common.c contains the common code that can be used by both MSR
    and MMIO interface.
    intel_rapl_msr.c contains the implementation of RAPL MSR interface.

    Reviewed-by: Pandruvada, Srinivas
    Tested-by: Pandruvada, Srinivas
    Signed-off-by: Zhang Rui
    Signed-off-by: Rafael J. Wysocki

    Zhang Rui
     
  • There are still some places in the common code that have hardcoded
    MSR access, convert them to follow the abstracted register access.

    Reviewed-by: Pandruvada, Srinivas
    Tested-by: Pandruvada, Srinivas
    Signed-off-by: Zhang Rui
    Signed-off-by: Rafael J. Wysocki

    Zhang Rui
     
  • Previously, there are three functions:
    rapl_register_psys(), which registers platform rapl domain.
    rapl_register_powercap(), which registers powercap control type.
    rapl_unregsiter_powercap(), which unregisters platform rapl domain and
    powercap control type.

    This is confusing as the function name does not describe what it does
    clearly.

    With this patch, the three functions are removed, and two new functions
    rapl_register_platform_domain()/rapl_unregister_platform_domain() are
    introduced instead, and they do exactly what their function name describes.

    Plus, as part of the common code, hardcoded MSR accesses in these functions
    are converted to follow the abstracted register access.

    Reviewed-by: Pandruvada, Srinivas
    Tested-by: Pandruvada, Srinivas
    Signed-off-by: Zhang Rui
    Signed-off-by: Rafael J. Wysocki

    Zhang Rui
     
  • MSR and MMIO RAPL interfaces have different ways to access the registers,
    thus in order to abstract the register access operations, two callbacks,
    .read_raw()/.write_raw() are introduced, and they should be implemented by
    MSR RAPL and MMIO RAPL interface driver respectly.

    This patch implements them for the MSR I/F only.

    Reviewed-by: Pandruvada, Srinivas
    Tested-by: Pandruvada, Srinivas
    Signed-off-by: Zhang Rui
    Signed-off-by: Rafael J. Wysocki

    Zhang Rui
     
  • MSR and MMIO RAPL interface have different sets of registers, thus the
    RAPL register address should be obtained from interface specific
    structure, i.e. struct rapl_if_private, instead.

    Reviewed-by: Pandruvada, Srinivas
    Tested-by: Pandruvada, Srinivas
    Signed-off-by: Zhang Rui
    Signed-off-by: Rafael J. Wysocki

    Zhang Rui
     
  • Introduce a new structure, rapl_if_private, to save the private data
    for different RAPL Interface.

    Reviewed-by: Pandruvada, Srinivas
    Tested-by: Pandruvada, Srinivas
    Signed-off-by: Zhang Rui
    Signed-off-by: Rafael J. Wysocki

    Zhang Rui
     
  • Create a new header file for the common definitions that might be used
    by different RAPL Interface.

    Reviewed-by: Pandruvada, Srinivas
    Tested-by: Pandruvada, Srinivas
    Signed-off-by: Zhang Rui
    Signed-off-by: Rafael J. Wysocki

    Zhang Rui
     
  • enum rapl_domain_reg_id is defined for the RAPL registers for each RAPL
    domain, thus use it whenever possible.

    Reviewed-by: Pandruvada, Srinivas
    Tested-by: Pandruvada, Srinivas
    Signed-off-by: Zhang Rui
    Signed-off-by: Rafael J. Wysocki

    Zhang Rui
     
  • To support both MSR and MMIO Interface, use 'reg' to discribe RAPL
    registers instead of 'msr'.

    Reviewed-by: Pandruvada, Srinivas
    Tested-by: Pandruvada, Srinivas
    Signed-off-by: Zhang Rui
    Signed-off-by: Rafael J. Wysocki

    Zhang Rui
     

09 Jul, 2019

1 commit

  • Pull x86 topology updates from Ingo Molnar:
    "Implement multi-die topology support on Intel CPUs and expose the die
    topology to user-space tooling, by Len Brown, Kan Liang and Zhang Rui.

    These changes should have no effect on the kernel's existing
    understanding of topologies, i.e. there should be no behavioral impact
    on cache, NUMA, scheduler, perf and other topologies and overall
    system performance"

    * 'x86-topology-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf/x86/intel/rapl: Cosmetic rename internal variables in response to multi-die/pkg support
    perf/x86/intel/uncore: Cosmetic renames in response to multi-die/pkg support
    hwmon/coretemp: Cosmetic: Rename internal variables to zones from packages
    thermal/x86_pkg_temp_thermal: Cosmetic: Rename internal variables to zones from packages
    perf/x86/intel/cstate: Support multi-die/package
    perf/x86/intel/rapl: Support multi-die/package
    perf/x86/intel/uncore: Support multi-die/package
    topology: Create core_cpus and die_cpus sysfs attributes
    topology: Create package_cpus sysfs attribute
    hwmon/coretemp: Support multi-die/package
    powercap/intel_rapl: Update RAPL domain name and debug messages
    thermal/x86_pkg_temp_thermal: Support multi-die/package
    powercap/intel_rapl: Support multi-die/package
    powercap/intel_rapl: Simplify rapl_find_package()
    x86/topology: Define topology_logical_die_id()
    x86/topology: Define topology_die_id()
    cpu/topology: Export die_id
    x86/topology: Create topology_max_die_per_package()
    x86/topology: Add CPUID.1F multi-die/package support

    Linus Torvalds
     

05 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    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 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

    this program is free software you can redistribute it and or modify
    it under the terms and conditions of the gnu general public license
    version 2 as published by the free software foundation this program
    is distributed in the hope 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

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

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

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

    Thomas Gleixner
     

23 May, 2019

3 commits

  • The RAPL domain "name" attribute contains "Package-N", which is ambiguous
    on multi-die per-package systems.

    Update the name to "package-X-die-Y" on those systems.

    No change on systems without multi-die/package.

    Update driver debug messages.

    Signed-off-by: Zhang Rui
    Signed-off-by: Len Brown
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Ingo Molnar
    Acked-by: Rafael J. Wysocki
    Acked-by: Peter Zijlstra (Intel)
    Cc: linux-pm@vger.kernel.org
    Link: https://lkml.kernel.org/r/6510b784e16374447965925588ec6e46d5d007d8.1557769318.git.len.brown@intel.com

    Zhang Rui
     
  • RAPL "package" domains are actually implemented in hardware per-die.
    Thus, the new multi-die/package systems have mulitple domains
    within each physical package.

    Update the intel_rapl driver to be "die aware" -- exporting multiple
    domains within a single package, when present. No change on single
    die/package systems.

    Signed-off-by: Zhang Rui
    Signed-off-by: Len Brown
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Ingo Molnar
    Acked-by: Rafael J. Wysocki
    Acked-by: Peter Zijlstra (Intel)
    Cc: linux-pm@vger.kernel.org
    Link: https://lkml.kernel.org/r/9fcb4719aeb7efccf3bc75ed8dd559e46121649f.1557769318.git.len.brown@intel.com

    Zhang Rui
     
  • Simplify how the code to discover a package is called. Rename
    find_package_by_id() to rapl_find_package_domain()

    Syntax only, no functional or semantic change.

    Signed-off-by: Zhang Rui
    Signed-off-by: Len Brown
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Ingo Molnar
    Acked-by: Rafael J. Wysocki
    Acked-by: Peter Zijlstra (Intel)
    Cc: linux-pm@vger.kernel.org
    Link: https://lkml.kernel.org/r/ae3d1903407fd6e3684234b674f4f0e62c2ab54c.1557769318.git.len.brown@intel.com

    Zhang Rui
     

21 May, 2019

1 commit


18 Feb, 2019

1 commit


13 Feb, 2019

1 commit


23 Oct, 2018

1 commit

  • Pull perf updates from Ingo Molnar:
    "The main updates in this cycle were:

    - Lots of perf tooling changes too voluminous to list (big perf trace
    and perf stat improvements, lots of libtraceevent reorganization,
    etc.), so I'll list the authors and refer to the changelog for
    details:

    Benjamin Peterson, Jérémie Galarneau, Kim Phillips, Peter
    Zijlstra, Ravi Bangoria, Sangwon Hong, Sean V Kelley, Steven
    Rostedt, Thomas Gleixner, Ding Xiang, Eduardo Habkost, Thomas
    Richter, Andi Kleen, Sanskriti Sharma, Adrian Hunter, Tzvetomir
    Stoyanov, Arnaldo Carvalho de Melo, Jiri Olsa.

    ... with the bulk of the changes written by Jiri Olsa, Tzvetomir
    Stoyanov and Arnaldo Carvalho de Melo.

    - Continued intel_rdt work with a focus on playing well with perf
    events. This also imported some non-perf RDT work due to
    dependencies. (Reinette Chatre)

    - Implement counter freezing for Arch Perfmon v4 (Skylake and newer).
    This allows to speed up the PMI handler by avoiding unnecessary MSR
    writes and make it more accurate. (Andi Kleen)

    - kprobes cleanups and simplification (Masami Hiramatsu)

    - Intel Goldmont PMU updates (Kan Liang)

    - ... plus misc other fixes and updates"

    * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (155 commits)
    kprobes/x86: Use preempt_enable() in optimized_callback()
    x86/intel_rdt: Prevent pseudo-locking from using stale pointers
    kprobes, x86/ptrace.h: Make regs_get_kernel_stack_nth() not fault on bad stack
    perf/x86/intel: Export mem events only if there's PEBS support
    x86/cpu: Drop pointless static qualifier in punit_dev_state_show()
    x86/intel_rdt: Fix initial allocation to consider CDP
    x86/intel_rdt: CBM overlap should also check for overlap with CDP peer
    x86/intel_rdt: Introduce utility to obtain CDP peer
    tools lib traceevent, perf tools: Move struct tep_handler definition in a local header file
    tools lib traceevent: Separate out tep_strerror() for strerror_r() issues
    perf python: More portable way to make CFLAGS work with clang
    perf python: Make clang_has_option() work on Python 3
    perf tools: Free temporary 'sys' string in read_event_files()
    perf tools: Avoid double free in read_event_file()
    perf tools: Free 'printk' string in parse_ftrace_printk()
    perf tools: Cleanup trace-event-info 'tdata' leak
    perf strbuf: Match va_{add,copy} with va_end
    perf test: S390 does not support watchpoints in test 22
    perf auxtrace: Include missing asm/bitsperlong.h to get BITS_PER_LONG
    tools include: Adopt linux/bits.h
    ...

    Linus Torvalds
     

02 Oct, 2018

1 commit

  • Going primarily by:

    https://en.wikipedia.org/wiki/List_of_Intel_Atom_microprocessors

    with additional information gleaned from other related pages; notably:

    - Bonnell shrink was called Saltwell
    - Moorefield is the Merriefield refresh which makes it Airmont

    The general naming scheme is: FAM6_ATOM_UARCH_SOCTYPE

    for i in `git grep -l FAM6_ATOM` ; do
    sed -i -e 's/ATOM_PINEVIEW/ATOM_BONNELL/g' \
    -e 's/ATOM_LINCROFT/ATOM_BONNELL_MID/' \
    -e 's/ATOM_PENWELL/ATOM_SALTWELL_MID/g' \
    -e 's/ATOM_CLOVERVIEW/ATOM_SALTWELL_TABLET/g' \
    -e 's/ATOM_CEDARVIEW/ATOM_SALTWELL/g' \
    -e 's/ATOM_SILVERMONT1/ATOM_SILVERMONT/g' \
    -e 's/ATOM_SILVERMONT2/ATOM_SILVERMONT_X/g' \
    -e 's/ATOM_MERRIFIELD/ATOM_SILVERMONT_MID/g' \
    -e 's/ATOM_MOOREFIELD/ATOM_AIRMONT_MID/g' \
    -e 's/ATOM_DENVERTON/ATOM_GOLDMONT_X/g' \
    -e 's/ATOM_GEMINI_LAKE/ATOM_GOLDMONT_PLUS/g' ${i}
    done

    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Alexander Shishkin
    Cc: Arnaldo Carvalho de Melo
    Cc: Jiri Olsa
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Thomas Gleixner
    Cc: Vince Weaver
    Cc: dave.hansen@linux.intel.com
    Cc: len.brown@intel.com
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

10 Sep, 2018

1 commit


02 Jul, 2018

1 commit

  • Initially, the cpu_cooling device for ARM was changed by adding a new
    policy inserting idle cycles. The intel_powerclamp driver does a
    similar action.

    Instead of implementing idle injections privately in the cpu_cooling
    device, move the idle injection code in a dedicated framework and give
    the opportunity to other frameworks to make use of it.

    The framework relies on the smpboot kthreads which handles via its
    main loop the common code for hotplugging and [un]parking.

    This code was previously tested with the cpu cooling device and went
    through several iterations. It results now in split code and API
    exported in the header file. It was tested with the cpu cooling device
    with success.

    Signed-off-by: Daniel Lezcano
    Reviewed-by: Viresh Kumar
    [ rjw: Rewrite of all comments ]
    Signed-off-by: Rafael J. Wysocki

    Daniel Lezcano
     

13 Jun, 2018

1 commit

  • The kzalloc() function has a 2-factor argument form, kcalloc(). This
    patch replaces cases of:

    kzalloc(a * b, gfp)

    with:
    kcalloc(a * b, gfp)

    as well as handling cases of:

    kzalloc(a * b * c, gfp)

    with:

    kzalloc(array3_size(a, b, c), gfp)

    as it's slightly less ugly than:

    kzalloc_array(array_size(a, b), c, gfp)

    This does, however, attempt to ignore constant size factors like:

    kzalloc(4 * 1024, gfp)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    type TYPE;
    expression THING, E;
    @@

    (
    kzalloc(
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    kzalloc(
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    kzalloc(
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (COUNT_ID)
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * COUNT_ID
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (COUNT_CONST)
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * COUNT_CONST
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (COUNT_ID)
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * COUNT_ID
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (COUNT_CONST)
    + COUNT_CONST, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * COUNT_CONST
    + COUNT_CONST, sizeof(THING)
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    identifier SIZE, COUNT;
    @@

    - kzalloc
    + kcalloc
    (
    - SIZE * COUNT
    + COUNT, SIZE
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    kzalloc(
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    kzalloc(
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kzalloc(
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    kzalloc(
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products,
    // when they're not all constants...
    @@
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    kzalloc(C1 * C2 * C3, ...)
    |
    kzalloc(
    - (E1) * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - (E1) * (E2) * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - (E1) * (E2) * (E3)
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants,
    // keeping sizeof() as the second factor argument.
    @@
    expression THING, E1, E2;
    type TYPE;
    constant C1, C2, C3;
    @@

    (
    kzalloc(sizeof(THING) * C2, ...)
    |
    kzalloc(sizeof(TYPE) * C2, ...)
    |
    kzalloc(C1 * C2 * C3, ...)
    |
    kzalloc(C1 * C2, ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (E2)
    + E2, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * E2
    + E2, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (E2)
    + E2, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * E2
    + E2, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - (E1) * E2
    + E1, E2
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - (E1) * (E2)
    + E1, E2
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - E1 * E2
    + E1, E2
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     

19 Mar, 2018

1 commit


17 Jan, 2018

1 commit