20 Feb, 2020

1 commit

  • commit e3728b50cd9be7d4b1469447cdf1feb93e3b7adb upstream.

    It is theoretically possible for the ACPI EC GPE to be set after the
    s2idle_ops->wake() called from s2idle_loop() has returned and before
    the subsequent pm_wakeup_pending() check is carried out. If that
    happens, the resulting wakeup event will cause the system to resume
    even though it may be a spurious one.

    To avoid that race, first make the ->wake() callback in struct
    platform_s2idle_ops return a bool value indicating whether or not
    to let the system resume and rearrange s2idle_loop() to use that
    value instad of the direct pm_wakeup_pending() call if ->wake() is
    present.

    Next, rework acpi_s2idle_wake() to process EC events and check
    pm_wakeup_pending() before re-arming the SCI for system wakeup
    to prevent it from triggering prematurely and add comments to
    that function to explain the rationale for the new code flow.

    Fixes: 56b991849009 ("PM: sleep: Simplify suspend-to-idle control flow")
    Cc: 5.4+ # 5.4+
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Rafael J. Wysocki
     

29 Jan, 2020

1 commit

  • commit 18451f9f9e5810b8bd1245c5ae166f257e0e2b9d upstream.

    Upon resuming from hibernation, free pages may contain stale data from
    the kernel that initiated the resume. This breaks the invariant
    inflicted by init_on_free=1 that freed pages must be zeroed.

    To deal with this problem, make clear_free_pages() also clear the free
    pages when init_on_free is enabled.

    Fixes: 6471384af2a6 ("mm: security: introduce init_on_alloc=1 and init_on_free=1 boot options")
    Reported-by: Johannes Stezenbach
    Signed-off-by: Alexander Potapenko
    Cc: 5.3+ # 5.3+
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Alexander Potapenko
     

09 Jan, 2020

1 commit

  • [ Upstream commit da6043fe85eb5ec621e34a92540735dcebbea134 ]

    When looking for a bit by number we make use of the cached result from the
    preceding lookup to speed up operation. Firstly we check if the requested
    pfn is within the cached zone and if not lookup the new zone. We then
    check if the offset for that pfn falls within the existing cached node.
    This happens regardless of whether the node is within the zone we are
    now scanning. With certain memory layouts it is possible for this to
    false trigger creating a temporary alias for the pfn to a different bit.
    This leads the hibernation code to free memory which it was never allocated
    with the expected fallout.

    Ensure the zone we are scanning matches the cached zone before considering
    the cached node.

    Deep thanks go to Andrea for many, many, many hours of hacking and testing
    that went into cornering this bug.

    Reported-by: Andrea Righi
    Tested-by: Andrea Righi
    Signed-off-by: Andy Whitcroft
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Sasha Levin

    Andy Whitcroft
     

20 Nov, 2019

1 commit

  • Switching cpufreq drivers (or switching operation modes of the
    intel_pstate driver from "active" to "passive" and vice versa)
    does not work on some x86 systems with ACPI after commit
    3000ce3c52f8 ("cpufreq: Use per-policy frequency QoS"), because
    the ACPI _PPC and thermal code uses the same frequency QoS request
    object for a given CPU every time a cpufreq driver is registered
    and freq_qos_remove_request() does not invalidate the request after
    removing it from its QoS list, so freq_qos_add_request() complains
    and fails when that request is passed to it again.

    Fix the issue by modifying freq_qos_remove_request() to clear the qos
    and type fields of the frequency request pointed to by its argument
    after removing it from its QoS list so as to invalidate it.

    Fixes: 3000ce3c52f8 ("cpufreq: Use per-policy frequency QoS")
    Reported-and-tested-by: Doug Smythies
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Viresh Kumar

    Rafael J. Wysocki
     

21 Oct, 2019

1 commit

  • Introduce frequency QoS, based on the "raw" low-level PM QoS, to
    represent min and max frequency requests and aggregate constraints.

    The min and max frequency requests are to be represented by
    struct freq_qos_request objects and the aggregate constraints are to
    be represented by struct freq_constraints objects. The latter are
    expected to be initialized with the help of freq_constraints_init().

    The freq_qos_read_value() helper is defined to retrieve the aggregate
    constraints values from a given struct freq_constraints object and
    there are the freq_qos_add_request(), freq_qos_update_request() and
    freq_qos_remove_request() helpers to manipulate the min and max
    frequency requests. It is assumed that the the helpers will not
    run concurrently with each other for the same struct freq_qos_request
    object, so if that may be the case, their uses must ensure proper
    synchronization between them (e.g. through locking).

    In addition, freq_qos_add_notifier() and freq_qos_remove_notifier()
    are provided to add and remove notifiers that will trigger on aggregate
    constraint changes to and from a given struct freq_constraints object,
    respectively.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Viresh Kumar

    Rafael J. Wysocki
     

10 Oct, 2019

1 commit


28 Sep, 2019

1 commit

  • Pull kernel lockdown mode from James Morris:
    "This is the latest iteration of the kernel lockdown patchset, from
    Matthew Garrett, David Howells and others.

    From the original description:

    This patchset introduces an optional kernel lockdown feature,
    intended to strengthen the boundary between UID 0 and the kernel.
    When enabled, various pieces of kernel functionality are restricted.
    Applications that rely on low-level access to either hardware or the
    kernel may cease working as a result - therefore this should not be
    enabled without appropriate evaluation beforehand.

    The majority of mainstream distributions have been carrying variants
    of this patchset for many years now, so there's value in providing a
    doesn't meet every distribution requirement, but gets us much closer
    to not requiring external patches.

    There are two major changes since this was last proposed for mainline:

    - Separating lockdown from EFI secure boot. Background discussion is
    covered here: https://lwn.net/Articles/751061/

    - Implementation as an LSM, with a default stackable lockdown LSM
    module. This allows the lockdown feature to be policy-driven,
    rather than encoding an implicit policy within the mechanism.

    The new locked_down LSM hook is provided to allow LSMs to make a
    policy decision around whether kernel functionality that would allow
    tampering with or examining the runtime state of the kernel should be
    permitted.

    The included lockdown LSM provides an implementation with a simple
    policy intended for general purpose use. This policy provides a coarse
    level of granularity, controllable via the kernel command line:

    lockdown={integrity|confidentiality}

    Enable the kernel lockdown feature. If set to integrity, kernel features
    that allow userland to modify the running kernel are disabled. If set to
    confidentiality, kernel features that allow userland to extract
    confidential information from the kernel are also disabled.

    This may also be controlled via /sys/kernel/security/lockdown and
    overriden by kernel configuration.

    New or existing LSMs may implement finer-grained controls of the
    lockdown features. Refer to the lockdown_reason documentation in
    include/linux/security.h for details.

    The lockdown feature has had signficant design feedback and review
    across many subsystems. This code has been in linux-next for some
    weeks, with a few fixes applied along the way.

    Stephen Rothwell noted that commit 9d1f8be5cf42 ("bpf: Restrict bpf
    when kernel lockdown is in confidentiality mode") is missing a
    Signed-off-by from its author. Matthew responded that he is providing
    this under category (c) of the DCO"

    * 'next-lockdown' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (31 commits)
    kexec: Fix file verification on S390
    security: constify some arrays in lockdown LSM
    lockdown: Print current->comm in restriction messages
    efi: Restrict efivar_ssdt_load when the kernel is locked down
    tracefs: Restrict tracefs when the kernel is locked down
    debugfs: Restrict debugfs when the kernel is locked down
    kexec: Allow kexec_file() with appropriate IMA policy when locked down
    lockdown: Lock down perf when in confidentiality mode
    bpf: Restrict bpf when kernel lockdown is in confidentiality mode
    lockdown: Lock down tracing and perf kprobes when in confidentiality mode
    lockdown: Lock down /proc/kcore
    x86/mmiotrace: Lock down the testmmiotrace module
    lockdown: Lock down module params that specify hardware parameters (eg. ioport)
    lockdown: Lock down TIOCSSERIAL
    lockdown: Prohibit PCMCIA CIS storage when the kernel is locked down
    acpi: Disable ACPI table override if the kernel is locked down
    acpi: Ignore acpi_rsdp kernel param when the kernel has been locked down
    ACPI: Limit access to custom_method when the kernel is locked down
    x86/msr: Restrict MSR access when the kernel is locked down
    x86: Lock down IO port access when the kernel is locked down
    ...

    Linus Torvalds
     

17 Sep, 2019

2 commits

  • * pm-opp:
    PM / OPP: Correct Documentation about library location
    opp: of: Support multiple suspend OPPs defined in DT
    dt-bindings: opp: Support multiple opp-suspend properties
    opp: core: add regulators enable and disable
    opp: Don't decrement uninitialized list_kref

    * pm-qos:
    PM: QoS: Get rid of unused flags

    * acpi-pm:
    ACPI: PM: Print debug messages on device power state changes

    * pm-domains:
    PM / Domains: Verify PM domain type in dev_pm_genpd_set_performance_state()
    PM / Domains: Simplify genpd_lookup_dev()
    PM / Domains: Align in-parameter names for some genpd functions

    * pm-tools:
    pm-graph: make setVal unbuffered again for python2 and python3
    cpupower: update German translation
    tools/power/cpupower: fix 64bit detection when cross-compiling
    cpupower: Add missing newline at end of file
    pm-graph v5.5

    Rafael J. Wysocki
     
  • * pm-s2idle-rework: (21 commits)
    ACPI: PM: s2idle: Always set up EC GPE for system wakeup
    ACPI: PM: s2idle: Avoid rearming SCI for wakeup unnecessarily
    PM: suspend: Fix platform_suspend_prepare_noirq()
    intel-hid: Disable button array during suspend-to-idle
    intel-hid: intel-vbtn: Avoid leaking wakeup_mode set
    ACPI: PM: s2idle: Execute LPS0 _DSM functions with suspended devices
    ACPI: EC: PM: Make acpi_ec_dispatch_gpe() print debug message
    ACPI: EC: PM: Consolidate some code depending on PM_SLEEP
    ACPI: PM: s2idle: Eliminate acpi_sleep_no_ec_events()
    ACPI: PM: s2idle: Switch EC over to polling during "noirq" suspend
    ACPI: PM: s2idle: Add acpi.sleep_no_lps0 module parameter
    ACPI: PM: s2idle: Rearrange lps0_device_attach()
    ACPI: PM: Set up EC GPE for system wakeup from drivers that need it
    PM: sleep: Drop dpm_noirq_begin() and dpm_noirq_end()
    PM: sleep: Integrate suspend-to-idle with generig suspend flow
    PM: sleep: Simplify suspend-to-idle control flow
    ACPI: PM: Set s2idle_wakeup earlier and clear it later
    PM: sleep: Fix possible overflow in pm_system_cancel_wakeup()
    ACPI: EC: Return bool from acpi_ec_dispatch_gpe()
    ACPICA: Return u32 from acpi_dispatch_gpe()
    ...

    Rafael J. Wysocki
     

21 Aug, 2019

3 commits

  • The network_latency and network_throughput flags for PM-QoS have not
    found much use in drivers or in userspace since they were introduced.

    Commit 4a733ef1bea7 ("mac80211: remove PM-QoS listener") removed the
    only user PM_QOS_NETWORK_LATENCY in the kernel a while ago and there
    don't seem to be any userspace tools using the character device files
    either.

    PM_QOS_MEMORY_BANDWIDTH was never even added to the trace events.

    Remove all the flags except cpu_dma_latency.

    Signed-off-by: Amit Kucheria
    Acked-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki

    Amit Kucheria
     
  • Add an ID and a device pointer to 'struct wakeup_source'. Use them to to
    expose wakeup sources statistics in sysfs under
    /sys/class/wakeup/wakeup/*.

    Co-developed-by: Greg Kroah-Hartman
    Signed-off-by: Greg Kroah-Hartman
    Co-developed-by: Stephen Boyd
    Signed-off-by: Stephen Boyd
    Signed-off-by: Tri Vo
    Tested-by: Kalesh Singh
    Signed-off-by: Rafael J. Wysocki

    Tri Vo
     
  • kernel/power/wakelock.c duplicates wakeup source creation and
    registration code from drivers/base/power/wakeup.c.

    Change struct wakelock's wakeup source to a pointer and use
    wakeup_source_register() function to create and register said wakeup
    source. Use wakeup_source_unregister() on cleanup path.

    Signed-off-by: Tri Vo
    Reviewed-by: Stephen Boyd
    Reviewed-by: Greg Kroah-Hartman
    Signed-off-by: Rafael J. Wysocki

    Tri Vo
     

20 Aug, 2019

1 commit

  • There is currently no way to verify the resume image when returning
    from hibernate. This might compromise the signed modules trust model,
    so until we can work with signed hibernate images we disable it when the
    kernel is locked down.

    Signed-off-by: Josh Boyer
    Signed-off-by: David Howells
    Signed-off-by: Matthew Garrett
    Reviewed-by: Kees Cook
    Cc: rjw@rjwysocki.net
    Cc: pavel@ucw.cz
    cc: linux-pm@vger.kernel.org
    Signed-off-by: James Morris

    Josh Boyer
     

16 Aug, 2019

1 commit


10 Aug, 2019

1 commit

  • After commit ac9eafbe930a ("ACPI: PM: s2idle: Execute LPS0 _DSM
    functions with suspended devices"), a NULL pointer may be dereferenced
    if suspend-to-idle is attempted on a platform without "traditional"
    suspend support due to invalid fall-through in
    platform_suspend_prepare_noirq().

    Fix that and while at it add missing braces in platform_resume_noirq().

    Fixes: ac9eafbe930a ("ACPI: PM: s2idle: Execute LPS0 _DSM functions with suspended devices")
    Reported-by: Marek Szyprowski
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

08 Aug, 2019

1 commit

  • According to Section 3.5 of the "Intel Low Power S0 Idle" document [1],
    Function 5 of the LPS0 _DSM is expected to be invoked when the system
    configuration matches the criteria for entering the target low-power
    state of the platform. In particular, this means that all devices
    should be suspended and in low-power states already when that function
    is invoked.

    This is not the case currently, however, because Function 5 of the
    LPS0 _DSM is invoked by it before the "noirq" phase of device suspend,
    which means that some devices may not have been put into low-power
    states yet at that point. That is a consequence of the previous
    design of the suspend-to-idle flow that allowed the "noirq" phase of
    device suspend and the "noirq" phase of device resume to be carried
    out for multiple times while "suspended" (if any spurious wakeup
    events were detected) and the point of the LPS0 _DSM Function 5
    invocation was chosen so as to call it (and LPS0 _DSM Function 6
    analogously) once per suspend-resume cycle (regardless of how many
    times the "noirq" phases of device suspend and resume were carried
    out while "suspended").

    Now that the suspend-to-idle flow has been redesigned to carry out
    the "noirq" phases of device suspend and resume once in each cycle,
    the code can be reordered to follow the specification that it is
    based on more closely.

    For this purpose, add ->prepare_late and ->restore_early platform
    callbacks for suspend-to-idle, to be executed, respectively, after
    the "noirq" phase of suspending devices and before the "noirq"
    phase of resuming them and make ACPI use them for the invocation
    of LPS0 _DSM functions as appropriate.

    While at it, move the LPS0 entry requirements check to be made
    before invoking Functions 3 and 5 of the LPS0 _DSM (also once
    per cycle) as follows from the specification [1].

    Link: https://uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf # [1]
    Signed-off-by: Rafael J. Wysocki
    Tested-by: Kai-Heng Feng

    Rafael J. Wysocki
     

05 Aug, 2019

1 commit

  • Userspace can get suspend stats from the suspend stats debugfs node.
    Since debugfs doesn't have stable ABI, expose suspend stats in
    sysfs under /sys/power/suspend_stats.

    Signed-off-by: Kalesh Singh
    Reviewed-by: Greg Kroah-Hartman
    Signed-off-by: Rafael J. Wysocki

    Kalesh Singh
     

23 Jul, 2019

2 commits

  • After previous changes the suspend-to-idle code flow can be
    integrated more tightly with the generic system suspend code flow
    by making suspend_enter() call s2idle_loop() later and removing
    the direct invocations of dpm_noirq_begin(),
    dpm_noirq_suspend_devices(), dpm_noirq_end(), and
    dpm_noirq_resume_devices() from the latter, so do that.

    This change is not expected to alter functionality.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Thomas Gleixner

    Rafael J. Wysocki
     
  • After commit 33e4f80ee69b ("ACPI / PM: Ignore spurious SCI wakeups
    from suspend-to-idle") the "noirq" phases of device suspend and
    resume may run for multiple times during suspend-to-idle, if there
    are spurious system wakeup events while suspended. However, this
    is complicated and fragile and actually unnecessary.

    The main reason for doing this is that on some systems the EC may
    signal system wakeup events (power button events, for example) as
    well as events that should not cause the system to resume (spurious
    system wakeup events). Thus, in order to determine whether or not
    a given event signaled by the EC while suspended is a proper system
    wakeup one, the EC GPE needs to be dispatched and to start with that
    was achieved by allowing the ACPI SCI action handler to run, which
    was only possible after calling resume_device_irqs().

    However, dispatching the EC GPE this way turned out to take too much
    time in some cases and some EC events might be missed due to that, so
    commit 68e22011856f ("ACPI: EC: Dispatch the EC GPE directly on
    s2idle wake") started to dispatch the EC GPE right after a wakeup
    event has been detected, so in fact the full ACPI SCI action handler
    doesn't need to run any more to deal with the wakeups coming from the
    EC.

    Use this observation to simplify the suspend-to-idle control flow
    so that the "noirq" phases of device suspend and resume are each
    run only once in every suspend-to-idle cycle, which is reported to
    significantly reduce power drawn by some systems when suspended to
    idle (by allowing them to reach a deep platform-wide low-power state
    through the suspend-to-idle flow). [What appears to happen is that
    the "noirq" resume of devices after a spurious EC wakeup brings some
    devices into a state in which they prevent the platform from reaching
    the deep low-power state going forward, even after a subsequent
    "noirq" suspend phase, and on some systems the EC triggers such
    wakeups already when the "noirq" suspend of devices is running for
    the first time in the given suspend/resume cycle, so the platform
    cannot reach the deep low-power state at all.]

    First, make acpi_s2idle_wake() use the acpi_ec_dispatch_gpe() return
    value to determine whether or not the wakeup may have been triggered
    by the EC (in which case the system wakeup is canceled and ACPI
    events are processed in order to determine whether or not the event
    is a proper system wakeup one) and use rearm_wake_irq() (introduced
    by a previous change) in it to rearm the ACPI SCI for system wakeup
    detection in case the system will remain suspended.

    Second, drop acpi_s2idle_sync(), which is not needed any more, and
    the corresponding global platform suspend-to-idle callback.

    Next, drop the pm_wakeup_pending() check (which is an optimization
    only) from __device_suspend_noirq() to prevent it from returning
    errors on system wakeups occurring before the "noirq" phase of
    device suspend is complete (as in the case of suspend-to-idle it is
    not known whether or not these wakeups are suprious at that point),
    in order to avoid having to carry out a "noirq" resume of devices
    on a spurious system wakeup.

    Finally, change the code flow in s2idle_loop() to (1) run the
    "noirq" suspend of devices once before starting the loop, (2) check
    for spurious EC wakeups (via the platform ->wake callback) for the
    first time before calling s2idle_enter(), and (3) run the "noirq"
    resume of devices once after leaving the loop.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Thomas Gleixner

    Rafael J. Wysocki
     

16 Jul, 2019

1 commit

  • Pull PCI updates from Bjorn Helgaas:
    "Enumeration changes:

    - Evaluate PCI Boot Configuration _DSM to learn if firmware wants us
    to preserve its resource assignments (Benjamin Herrenschmidt)

    - Simplify resource distribution (Nicholas Johnson)

    - Decode 32 GT/s link speed (Gustavo Pimentel)

    Virtualization:

    - Fix incorrect caching of VF config space size (Alex Williamson)

    - Fix VF driver probing sysfs knobs (Alex Williamson)

    Peer-to-peer DMA:

    - Fix dma_virt_ops check (Logan Gunthorpe)

    Altera host bridge driver:

    - Allow building as module (Ley Foon Tan)

    Armada 8K host bridge driver:

    - add PHYs support (Miquel Raynal)

    DesignWare host bridge driver:

    - Export APIs to support removable loadable module (Vidya Sagar)

    - Enable Relaxed Ordering erratum workaround only on Tegra20 &
    Tegra30 (Vidya Sagar)

    Hyper-V host bridge driver:

    - Fix use-after-free in eject (Dexuan Cui)

    Mobiveil host bridge driver:

    - Clean up and fix many issues, including non-identify mapped
    windows, 64-bit windows, multi-MSI, class code, INTx clearing (Hou
    Zhiqiang)

    Qualcomm host bridge driver:

    - Use clk bulk API for 2.4.0 controllers (Bjorn Andersson)

    - Add QCS404 support (Bjorn Andersson)

    - Assert PERST for at least 100ms (Niklas Cassel)

    R-Car host bridge driver:

    - Add r8a774a1 DT support (Biju Das)

    Tegra host bridge driver:

    - Add support for Gen2, opportunistic UpdateFC and ACK (PCIe protocol
    details) AER, GPIO-based PERST# (Manikanta Maddireddy)

    - Fix many issues, including power-on failure cases, interrupt
    masking in suspend, UPHY settings, AFI dynamic clock gating,
    pending DLL transactions (Manikanta Maddireddy)

    Xilinx host bridge driver:

    - Fix NWL Multi-MSI programming (Bharat Kumar Gogada)

    Endpoint support:

    - Fix 64bit BAR support (Alan Mikhak)

    - Fix pcitest build issues (Alan Mikhak, Andy Shevchenko)

    Bug fixes:

    - Fix NVIDIA GPU multi-function power dependencies (Abhishek Sahu)

    - Fix NVIDIA GPU HDA enablement issue (Lukas Wunner)

    - Ignore lockdep for sysfs "remove" (Marek Vasut)

    Misc:

    - Convert docs to reST (Changbin Du, Mauro Carvalho Chehab)"

    * tag 'pci-v5.3-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (107 commits)
    PCI: Enable NVIDIA HDA controllers
    tools: PCI: Fix installation when `make tools/pci_install`
    PCI: dwc: pci-dra7xx: Fix compilation when !CONFIG_GPIOLIB
    PCI: Fix typos and whitespace errors
    PCI: mobiveil: Fix INTx interrupt clearing in mobiveil_pcie_isr()
    PCI: mobiveil: Fix infinite-loop in the INTx handling function
    PCI: mobiveil: Move PCIe PIO enablement out of inbound window routine
    PCI: mobiveil: Add upper 32-bit PCI base address setup in inbound window
    PCI: mobiveil: Add upper 32-bit CPU base address setup in outbound window
    PCI: mobiveil: Mask out hardcoded bits in inbound/outbound windows setup
    PCI: mobiveil: Clear the control fields before updating it
    PCI: mobiveil: Add configured inbound windows counter
    PCI: mobiveil: Fix the valid check for inbound and outbound windows
    PCI: mobiveil: Clean-up program_{ib/ob}_windows()
    PCI: mobiveil: Remove an unnecessary return value check
    PCI: mobiveil: Fix error return values
    PCI: mobiveil: Refactor the MEM/IO outbound window initialization
    PCI: mobiveil: Make some register updates more readable
    PCI: mobiveil: Reformat the code for readability
    dt-bindings: PCI: mobiveil: Change gpio_slave and apb_csr to optional
    ...

    Linus Torvalds
     

10 Jul, 2019

1 commit

  • Pull power management updates from Rafael Wysocki:
    "These update PCI and ACPI power management (improved handling of ACPI
    power resources and PCIe link delays, fixes related to corner cases,
    hibernation handling rework), fix and extend the operating performance
    points (OPP) framework, add new cpufreq drivers for Raspberry Pi and
    imx8m chips, update some other cpufreq drivers, clean up assorted
    pieces of PM code and documentation and update tools.

    Specifics:

    - Improve the handling of shared ACPI power resources in the PCI bus
    type layer (Mika Westerberg).

    - Make the PCI layer take link delays required by the PCIe spec into
    account as appropriate and avoid polling devices in D3cold for PME
    (Mika Westerberg).

    - Fix some corner case issues in ACPI device power management and in
    the PCI bus type layer, optimiza and clean up the handling of
    runtime-suspended PCI devices during system-wide transitions to
    sleep states (Rafael Wysocki).

    - Rework hibernation handling in the ACPI core and the PCI bus type
    to resume runtime-suspended devices before hibernation (which
    allows some functional problems to be avoided) and fix some ACPI
    power management issues related to hiberation (Rafael Wysocki).

    - Extend the operating performance points (OPP) framework to support
    a wider range of devices (Rajendra Nayak, Stehpen Boyd).

    - Fix issues related to genpd_virt_devs and issues with platforms
    using the set_opp() callback in the OPP framework (Viresh Kumar,
    Dmitry Osipenko).

    - Add new cpufreq driver for Raspberry Pi (Nicolas Saenz Julienne).

    - Add new cpufreq driver for imx8m and imx7d chips (Leonard Crestez).

    - Fix and clean up the pcc-cpufreq, brcmstb-avs-cpufreq, s5pv210, and
    armada-37xx cpufreq drivers (David Arcari, Florian Fainelli, Paweł
    Chmiel, YueHaibing).

    - Clean up and fix the cpufreq core (Viresh Kumar, Daniel Lezcano).

    - Fix minor issue in the ACPI system sleep support code and export
    one function from it (Lenny Szubowicz, Dexuan Cui).

    - Clean up assorted pieces of PM code and documentation (Kefeng Wang,
    Andy Shevchenko, Bart Van Assche, Greg Kroah-Hartman, Fuqian Huang,
    Geert Uytterhoeven, Mathieu Malaterre, Rafael Wysocki).

    - Update the pm-graph utility to v5.4 (Todd Brandt).

    - Fix and clean up the cpupower utility (Abhishek Goel, Nick Black)"

    * tag 'pm-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (57 commits)
    ACPI: PM: Make acpi_sleep_state_supported() non-static
    PM: sleep: Drop dev_pm_skip_next_resume_phases()
    ACPI: PM: Unexport acpi_device_get_power()
    Documentation: ABI: power: Add missing newline at end of file
    ACPI: PM: Drop unused function and function header
    ACPI: PM: Introduce "poweroff" callbacks for ACPI PM domain and LPSS
    ACPI: PM: Simplify and fix PM domain hibernation callbacks
    PCI: PM: Simplify bus-level hibernation callbacks
    PM: ACPI/PCI: Resume all devices during hibernation
    cpufreq: Avoid calling cpufreq_verify_current_freq() from handle_update()
    cpufreq: Consolidate cpufreq_update_current_freq() and __cpufreq_get()
    kernel: power: swap: use kzalloc() instead of kmalloc() followed by memset()
    cpufreq: Don't skip frequency validation for has_target() drivers
    PCI: PM/ACPI: Refresh all stale power state data in pci_pm_complete()
    PCI / ACPI: Add _PR0 dependent devices
    ACPI / PM: Introduce concept of a _PR0 dependent device
    PCI / ACPI: Use cached ACPI device state to get PCI device power state
    ACPI: PM: Allow transitions to D0 to occur in special cases
    ACPI: PM: Avoid evaluating _PS3 on transitions from D3hot to D3cold
    cpufreq: Use has_target() instead of !setpolicy
    ...

    Linus Torvalds
     

09 Jul, 2019

1 commit

  • Pull scheduler updates from Ingo Molnar:

    - Remove the unused per rq load array and all its infrastructure, by
    Dietmar Eggemann.

    - Add utilization clamping support by Patrick Bellasi. This is a
    refinement of the energy aware scheduling framework with support for
    boosting of interactive and capping of background workloads: to make
    sure critical GUI threads get maximum frequency ASAP, and to make
    sure background processing doesn't unnecessarily move to cpufreq
    governor to higher frequencies and less energy efficient CPU modes.

    - Add the bare minimum of tracepoints required for LISA EAS regression
    testing, by Qais Yousef - which allows automated testing of various
    power management features, including energy aware scheduling.

    - Restructure the former tsk_nr_cpus_allowed() facility that the -rt
    kernel used to modify the scheduler's CPU affinity logic such as
    migrate_disable() - introduce the task->cpus_ptr value instead of
    taking the address of &task->cpus_allowed directly - by Sebastian
    Andrzej Siewior.

    - Misc optimizations, fixes, cleanups and small enhancements - see the
    Git log for details.

    * 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (33 commits)
    sched/uclamp: Add uclamp support to energy_compute()
    sched/uclamp: Add uclamp_util_with()
    sched/cpufreq, sched/uclamp: Add clamps for FAIR and RT tasks
    sched/uclamp: Set default clamps for RT tasks
    sched/uclamp: Reset uclamp values on RESET_ON_FORK
    sched/uclamp: Extend sched_setattr() to support utilization clamping
    sched/core: Allow sched_setattr() to use the current policy
    sched/uclamp: Add system default clamps
    sched/uclamp: Enforce last task's UCLAMP_MAX
    sched/uclamp: Add bucket local max tracking
    sched/uclamp: Add CPU's clamp buckets refcounting
    sched/fair: Rename weighted_cpuload() to cpu_runnable_load()
    sched/debug: Export the newly added tracepoints
    sched/debug: Add sched_overutilized tracepoint
    sched/debug: Add new tracepoint to track PELT at se level
    sched/debug: Add new tracepoints to track PELT at rq level
    sched/debug: Add a new sched_trace_*() helper functions
    sched/autogroup: Make autogroup_path() always available
    sched/wait: Deduplicate code with do-while
    sched/topology: Remove unused 'sd' parameter from arch_scale_cpu_capacity()
    ...

    Linus Torvalds
     

08 Jul, 2019

1 commit

  • * pm-sleep:
    PM: sleep: Drop dev_pm_skip_next_resume_phases()
    ACPI: PM: Drop unused function and function header
    ACPI: PM: Introduce "poweroff" callbacks for ACPI PM domain and LPSS
    ACPI: PM: Simplify and fix PM domain hibernation callbacks
    PCI: PM: Simplify bus-level hibernation callbacks
    PM: ACPI/PCI: Resume all devices during hibernation
    kernel: power: swap: use kzalloc() instead of kmalloc() followed by memset()
    PM: sleep: Update struct wakeup_source documentation
    drivers: base: power: remove wakeup_sources_stats_dentry variable
    PM: suspend: Rename pm_suspend_via_s2idle()
    PM: sleep: Show how long dpm_suspend_start() and dpm_suspend_end() take
    PM: hibernate: powerpc: Expose pfn_is_nosave() prototype

    Rafael J. Wysocki
     

28 Jun, 2019

1 commit


27 Jun, 2019

1 commit

  • There are platforms that do not call pm_set_suspend_via_firmware(),
    so pm_suspend_via_firmware() returns 'false' on them, but the power
    states of PCI devices (PCIe ports in particular) are changed as a
    result of powering down core platform components during system-wide
    suspend. Thus the pm_suspend_via_firmware() checks in
    pci_pm_suspend_noirq() and pci_pm_resume_noirq() introduced by
    commit 3e26c5feed2a ("PCI: PM: Skip devices in D0 for suspend-to-
    idle") are not sufficient to determine that devices left in D0
    during suspend will remain in D0 during resume and so the bus-level
    power management can be skipped for them.

    For this reason, introduce a new global suspend flag,
    PM_SUSPEND_FLAG_NO_PLATFORM, set it for suspend-to-idle only
    and replace the pm_suspend_via_firmware() checks mentioned above
    with checks against this flag.

    Fixes: 3e26c5feed2a ("PCI: PM: Skip devices in D0 for suspend-to-idle")
    Reported-by: Jon Hunter
    Tested-by: Jon Hunter
    Signed-off-by: Rafael J. Wysocki
    Tested-by: Mika Westerberg
    Reviewed-by: Mika Westerberg

    Rafael J. Wysocki
     

25 Jun, 2019

1 commit

  • The 'struct sched_domain *sd' parameter to arch_scale_cpu_capacity() is
    unused since commit:

    765d0af19f5f ("sched/topology: Remove the ::smt_gain field from 'struct sched_domain'")

    Remove it.

    Signed-off-by: Vincent Guittot
    Signed-off-by: Peter Zijlstra (Intel)
    Reviewed-by: Viresh Kumar
    Reviewed-by: Valentin Schneider
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: gregkh@linuxfoundation.org
    Cc: linux@armlinux.org.uk
    Cc: quentin.perret@arm.com
    Cc: rafael@kernel.org
    Link: https://lkml.kernel.org/r/1560783617-5827-1-git-send-email-vincent.guittot@linaro.org
    Signed-off-by: Ingo Molnar

    Vincent Guittot
     

19 Jun, 2019

2 commits

  • Based on 1 normalized pattern(s):

    this file is released under the gpl v2

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

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

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

    Thomas Gleixner
     
  • The name of pm_suspend_via_s2idle() is confusing, as it doesn't
    reflect the purpose of the function precisely enough and it is
    very similar to pm_suspend_via_firmware(), which has a different
    purpose, so rename it as pm_suspend_default_s2idle() and update
    its only caller, i8042_register_ports(), accordingly.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Dmitry Torokhov

    Rafael J. Wysocki
     

15 Jun, 2019

1 commit

  • Convert the PM documents to ReST, in order to allow them to
    build with Sphinx.

    The conversion is actually:
    - add blank lines and indentation in order to identify paragraphs;
    - fix tables markups;
    - add some lists markups;
    - mark literal blocks;
    - adjust title markups.

    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
    Signed-off-by: Bjorn Helgaas
    Acked-by: Mark Brown
    Acked-by: Srivatsa S. Bhat (VMware)

    Mauro Carvalho Chehab
     

14 Jun, 2019

1 commit

  • The declaration for pfn_is_nosave is only available in
    kernel/power/power.h. Since this function can be override in arch,
    expose it globally. Having a prototype will make sure to avoid warning
    (sometime treated as error with W=1) such as:

    arch/powerpc/kernel/suspend.c:18:5: error: no previous prototype for 'pfn_is_nosave' [-Werror=missing-prototypes]

    This moves the declaration into a globally visible header file and add
    missing include to avoid a warning on powerpc.

    Also remove the duplicated prototypes since not required anymore.

    Signed-off-by: Mathieu Malaterre
    Acked-by: Michael Ellerman (powerpc)
    Signed-off-by: Rafael J. Wysocki

    Mathieu Malaterre
     

09 Jun, 2019

1 commit

  • Pull yet more SPDX updates from Greg KH:
    "Another round of SPDX header file fixes for 5.2-rc4

    These are all more "GPL-2.0-or-later" or "GPL-2.0-only" tags being
    added, based on the text in the files. We are slowly chipping away at
    the 700+ different ways people tried to write the license text. All of
    these were reviewed on the spdx mailing list by a number of different
    people.

    We now have over 60% of the kernel files covered with SPDX tags:
    $ ./scripts/spdxcheck.py -v 2>&1 | grep Files
    Files checked: 64533
    Files with SPDX: 40392
    Files with errors: 0

    I think the majority of the "easy" fixups are now done, it's now the
    start of the longer-tail of crazy variants to wade through"

    * tag 'spdx-5.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (159 commits)
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 450
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 449
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 448
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 446
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 445
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 444
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 443
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 442
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 440
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 438
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 437
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 436
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 435
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 434
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 433
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 432
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 431
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 430
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 429
    ...

    Linus Torvalds
     

07 Jun, 2019

1 commit


05 Jun, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this file is released under the gplv2

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

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

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

    Thomas Gleixner
     

03 Jun, 2019

2 commits

  • As explained in

    0cc3cd21657b ("cpu/hotplug: Boot HT siblings at least once")

    we always, no matter what, have to bring up x86 HT siblings during boot at
    least once in order to avoid first MCE bringing the system to its knees.

    That means that whenever 'nosmt' is supplied on the kernel command-line,
    all the HT siblings are as a result sitting in mwait or cpudile after
    going through the online-offline cycle at least once.

    This causes a serious issue though when a kernel, which saw 'nosmt' on its
    commandline, is going to perform resume from hibernation: if the resume
    from the hibernated image is successful, cr3 is flipped in order to point
    to the address space of the kernel that is being resumed, which in turn
    means that all the HT siblings are all of a sudden mwaiting on address
    which is no longer valid.

    That results in triple fault shortly after cr3 is switched, and machine
    reboots.

    Fix this by always waking up all the SMT siblings before initiating the
    'restore from hibernation' process; this guarantees that all the HT
    siblings will be properly carried over to the resumed kernel waiting in
    resume_play_dead(), and acted upon accordingly afterwards, based on the
    target kernel configuration.

    Symmetricaly, the resumed kernel has to push the SMT siblings to mwait
    again in case it has SMT disabled; this means it has to online all
    the siblings when resuming (so that they come out of hlt) and offline
    them again to let them reach mwait.

    Cc: 4.19+ # v4.19+
    Debugged-by: Thomas Gleixner
    Fixes: 0cc3cd21657b ("cpu/hotplug: Boot HT siblings at least once")
    Signed-off-by: Jiri Kosina
    Acked-by: Pavel Machek
    Reviewed-by: Thomas Gleixner
    Reviewed-by: Josh Poimboeuf
    Signed-off-by: Rafael J. Wysocki

    Jiri Kosina
     
  • Add kerneldoc comments to pm_suspend_via_firmware(),
    pm_resume_via_firmware() and pm_suspend_via_s2idle()
    to explain what they do.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

27 May, 2019

1 commit

  • On systems with ACPI platform firmware the last stage of hibernation
    is analogous to system suspend to S3 (suspend-to-RAM), so it should
    be handled analogously. In particular, pm_suspend_via_firmware()
    should return 'true' in that stage to let the callers of it know that
    control will be passed to the platform firmware going forward, so
    pm_set_suspend_via_firmware() needs to be called then in analogy with
    acpi_suspend_begin().

    However, the platform hibernation ->begin() callback is invoked
    during the "freeze" transition (before creating a snapshot image of
    system memory) as well as during the "hibernate" transition which is
    the last stage of it and pm_set_suspend_via_firmware() should be
    invoked by that callback in the latter stage only.

    In order to implement that redefine the hibernation ->begin()
    callback to take a pm_message_t argument to indicate which stage
    of hibernation is taking place and rework acpi_hibernation_begin()
    and acpi_hibernation_begin_old() to take it into account as needed.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

21 May, 2019

2 commits

  • 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
     

07 May, 2019

2 commits

  • Pull power management updates from Rafael Wysocki:
    "These fix the (Intel-specific) Performance and Energy Bias Hint (EPB)
    handling and expose it to user space via sysfs, fix and clean up
    several cpufreq drivers, add support for two new chips to the qoriq
    cpufreq driver, fix, simplify and clean up the cpufreq core and the
    schedutil governor, add support for "CPU" domains to the generic power
    domains (genpd) framework and provide low-level PSCI firmware support
    for that feature, fix the exynos cpuidle driver and fix a couple of
    issues in the devfreq subsystem and clean it up.

    Specifics:

    - Fix the handling of Performance and Energy Bias Hint (EPB) on Intel
    processors and expose it to user space via sysfs to avoid having to
    access it through the generic MSR I/F (Rafael Wysocki).

    - Improve the handling of global turbo changes made by the platform
    firmware in the intel_pstate driver (Rafael Wysocki).

    - Convert some slow-path static_cpu_has() callers to boot_cpu_has()
    in cpufreq (Borislav Petkov).

    - Fix the frequency calculation loop in the armada-37xx cpufreq
    driver (Gregory CLEMENT).

    - Fix possible object reference leaks in multuple cpufreq drivers
    (Wen Yang).

    - Fix kerneldoc comment in the centrino cpufreq driver (dongjian).

    - Clean up the ACPI and maple cpufreq drivers (Viresh Kumar, Mohan
    Kumar).

    - Add support for lx2160a and ls1028a to the qoriq cpufreq driver
    (Vabhav Sharma, Yuantian Tang).

    - Fix kobject memory leak in the cpufreq core (Viresh Kumar).

    - Simplify the IOwait boosting in the schedutil cpufreq governor and
    rework the TSC cpufreq notifier on x86 (Rafael Wysocki).

    - Clean up the cpufreq core and statistics code (Yue Hu, Kyle Lin).

    - Improve the cpufreq documentation, add SPDX license tags to some PM
    documentation files and unify copyright notices in them (Rafael
    Wysocki).

    - Add support for "CPU" domains to the generic power domains (genpd)
    framework and provide low-level PSCI firmware support for that
    feature (Ulf Hansson).

    - Rearrange the PSCI firmware support code and add support for
    SYSTEM_RESET2 to it (Ulf Hansson, Sudeep Holla).

    - Improve genpd support for devices in multiple power domains (Ulf
    Hansson).

    - Unify target residency for the AFTR and coupled AFTR states in the
    exynos cpuidle driver (Marek Szyprowski).

    - Introduce new helper routine in the operating performance points
    (OPP) framework (Andrew-sh.Cheng).

    - Add support for passing on-die termination (ODT) and auto power
    down parameters from the kernel to Trusted Firmware-A (TF-A) to the
    rk3399_dmc devfreq driver (Enric Balletbo i Serra).

    - Add tracing to devfreq (Lukasz Luba).

    - Make the exynos-bus devfreq driver suspend all devices on system
    shutdown (Marek Szyprowski).

    - Fix a few minor issues in the devfreq subsystem and clean it up
    somewhat (Enric Balletbo i Serra, MyungJoo Ham, Rob Herring,
    Saravana Kannan, Yangtao Li).

    - Improve system wakeup diagnostics (Stephen Boyd).

    - Rework filesystem sync messages emitted during system suspend and
    hibernation (Harry Pan)"

    * tag 'pm-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (72 commits)
    cpufreq: Fix kobject memleak
    cpufreq: armada-37xx: fix frequency calculation for opp
    cpufreq: centrino: Fix centrino_setpolicy() kerneldoc comment
    cpufreq: qoriq: add support for lx2160a
    x86: tsc: Rework time_cpufreq_notifier()
    PM / Domains: Allow to attach a CPU via genpd_dev_pm_attach_by_id|name()
    PM / Domains: Search for the CPU device outside the genpd lock
    PM / Domains: Drop unused in-parameter to some genpd functions
    PM / Domains: Use the base device for driver_deferred_probe_check_state()
    cpufreq: qoriq: Add ls1028a chip support
    PM / Domains: Enable genpd_dev_pm_attach_by_id|name() for single PM domain
    PM / Domains: Allow OF lookup for multi PM domain case from ->attach_dev()
    PM / Domains: Don't kfree() the virtual device in the error path
    cpufreq: Move ->get callback check outside of __cpufreq_get()
    PM / Domains: remove unnecessary unlikely()
    cpufreq: Remove needless bios_limit check in show_bios_limit()
    drivers/cpufreq/acpi-cpufreq.c: This fixes the following checkpatch warning
    firmware/psci: add support for SYSTEM_RESET2
    PM / devfreq: add tracing for scheduling work
    trace: events: add devfreq trace event file
    ...

    Linus Torvalds
     
  • Pull x86 mm updates from Ingo Molnar:
    "The changes in here are:

    - text_poke() fixes and an extensive set of executability lockdowns,
    to (hopefully) eliminate the last residual circumstances under
    which we are using W|X mappings even temporarily on x86 kernels.
    This required a broad range of surgery in text patching facilities,
    module loading, trampoline handling and other bits.

    - tweak page fault messages to be more informative and more
    structured.

    - remove DISCONTIGMEM support on x86-32 and make SPARSEMEM the
    default.

    - reduce KASLR granularity on 5-level paging kernels from 512 GB to
    1 GB.

    - misc other changes and updates"

    * 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (36 commits)
    x86/mm: Initialize PGD cache during mm initialization
    x86/alternatives: Add comment about module removal races
    x86/kprobes: Use vmalloc special flag
    x86/ftrace: Use vmalloc special flag
    bpf: Use vmalloc special flag
    modules: Use vmalloc special flag
    mm/vmalloc: Add flag for freeing of special permsissions
    mm/hibernation: Make hibernation handle unmapped pages
    x86/mm/cpa: Add set_direct_map_*() functions
    x86/alternatives: Remove the return value of text_poke_*()
    x86/jump-label: Remove support for custom text poker
    x86/modules: Avoid breaking W^X while loading modules
    x86/kprobes: Set instruction page as executable
    x86/ftrace: Set trampoline pages as executable
    x86/kgdb: Avoid redundant comparison of patched code
    x86/alternatives: Use temporary mm for text poking
    x86/alternatives: Initialize temporary mm for patching
    fork: Provide a function for copying init_mm
    uprobes: Initialize uprobes earlier
    x86/mm: Save debug registers when loading a temporary mm
    ...

    Linus Torvalds