linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 00/14] arm64: suspend/resume implementation
@ 2013-08-28 11:35 Lorenzo Pieralisi
  2013-08-28 11:35 ` [RFC PATCH 01/14] arm64: kernel: add MPIDR_EL1 accessors macros Lorenzo Pieralisi
                   ` (13 more replies)
  0 siblings, 14 replies; 23+ messages in thread
From: Lorenzo Pieralisi @ 2013-08-28 11:35 UTC (permalink / raw)
  To: linux-pm, linux-arm-kernel
  Cc: Lorenzo Pieralisi, Dave Martin, Will Deacon, Catalin Marinas,
	Marc Zyngier, Mark Rutland, Sudeep KarkadaNagesha, Russell King,
	Colin Cross, Yu Tang, Zhou Zhu, Kumar Sankaran, Loc Ho, Feng Kan,
	Nicolas Pitre, Santosh Shilimkar, Stephen Boyd, Graeme Gregory,
	Hanjun Guo

This patch series provides an implementation of suspend/resume and
related CPU PM notifiers for the arm64 architecture. The implementation
mirrors the arm32 version, so that the usage model is left unchanged
and the suspend/resume interface is kept common for both implementations.

The context restore split between processor specific functions and
generic code has been kept similar to arm32 as well, since this makes
sense from a functionality perspective, even though there is just a
an architecture specific save/restore implementation for arm64, for v8.
Code that deals with turning on the MMU and returning from suspend is kept
in the same file as the the suspend method itself, so that assembly code is
self contained in a single file and separated from the interface.

The CPU register context is allocated on the stack; this behaviour is
the same as in the arm 32-bit port, even though context could have been
allocated statically as a NR_CPUS array of struct and the context
addresses stored once of all in the context pointers array after virtual
to physical conversion. Current solution uses the stack, since there is
no need to allocate additional context space for context that can be
easily saved on the suspend threads stacks, with no additional memory
requirement.

Cache flushing is kept to a minimum; the cpu_suspend method cleans only the
few bytes of context to DRAM that need to be retrieved with the MMU off,
the remainder of cache cleaning is delegated to suspend finishers.

The series also provides patches to simplify the MPIDR_EL1 management
and MPIDR_EL1 hashing that are integrated to the series but are also useful
as stand alone code.

Code has been tested on AEM v8 models and a simple CPU idle driver that
enables a C-state where CPUs are reset when wfi is hit.

KVM CPU PM notifier has been tested using kvm-tools, and by booting a KVM guest
on a host with deep idle states enabled.

HW breakpoint CPU PM notifier has been tested using a simple perf test that
sets up per-cpu watchpoints and checks the proper behaviour when deep idle
states are enabled.

Lorenzo Pieralisi (14):
  arm64: kernel: add MPIDR_EL1 accessors macros
  arm64: kernel: build MPIDR_EL1 hash function data structure
  arm64: kernel: add structure to define cpu context layout
  arm64: kernel: suspend/resume registers save/restore
  arm64: kernel: cpu_{suspend/resume} implementation
  arm64: add CPU PM infrastructure selection
  arm64: kernel: implement fpsimd CPU PM notifier
  arm: kvm: implement CPU PM notifier
  arm64: kernel: implement debug monitors CPU PM notifiers
  arm64: kernel: refactor code to install/uninstall breakpoints
  arm64: kernel: implement HW breakpoints CPU PM notifier
  arm64: kernel: add cpu_{suspend}/{resume} build infrastructure
  arm64: kernel: add CPU idle call
  arm64: add CPU power management menu/entries

 arch/arm/kvm/arm.c                 |  30 ++++++
 arch/arm64/Kconfig                 |  19 ++++
 arch/arm64/include/asm/cputype.h   |  10 ++
 arch/arm64/include/asm/proc-fns.h  |   3 +
 arch/arm64/include/asm/processor.h |  18 ++++
 arch/arm64/include/asm/smp_plat.h  |  13 +++
 arch/arm64/include/asm/suspend.h   |  12 +++
 arch/arm64/kernel/Makefile         |   1 +
 arch/arm64/kernel/asm-offsets.c    |  21 ++++
 arch/arm64/kernel/debug-monitors.c |  38 +++++++
 arch/arm64/kernel/fpsimd.c         |  36 +++++++
 arch/arm64/kernel/hw_breakpoint.c  | 205 +++++++++++++++++++++++++++----------
 arch/arm64/kernel/process.c        |   7 +-
 arch/arm64/kernel/setup.c          |  70 +++++++++++++
 arch/arm64/kernel/sleep.S          | 181 ++++++++++++++++++++++++++++++++
 arch/arm64/kernel/suspend.c        |  76 ++++++++++++++
 arch/arm64/mm/proc.S               |  64 ++++++++++++
 17 files changed, 746 insertions(+), 58 deletions(-)
 create mode 100644 arch/arm64/include/asm/suspend.h
 create mode 100644 arch/arm64/kernel/sleep.S
 create mode 100644 arch/arm64/kernel/suspend.c

-- 
1.8.3.4



^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2013-09-05  5:07 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-28 11:35 [RFC PATCH 00/14] arm64: suspend/resume implementation Lorenzo Pieralisi
2013-08-28 11:35 ` [RFC PATCH 01/14] arm64: kernel: add MPIDR_EL1 accessors macros Lorenzo Pieralisi
2013-08-28 11:35 ` [RFC PATCH 02/14] arm64: kernel: build MPIDR_EL1 hash function data structure Lorenzo Pieralisi
2013-08-28 11:35 ` [RFC PATCH 03/14] arm64: kernel: add structure to define cpu context layout Lorenzo Pieralisi
2013-08-28 11:35 ` [RFC PATCH 04/14] arm64: kernel: suspend/resume registers save/restore Lorenzo Pieralisi
2013-08-30 17:23   ` Catalin Marinas
2013-09-02  9:57     ` Lorenzo Pieralisi
2013-09-02 11:17       ` Catalin Marinas
2013-09-02 16:24         ` Lorenzo Pieralisi
2013-08-28 11:35 ` [RFC PATCH 05/14] arm64: kernel: cpu_{suspend/resume} implementation Lorenzo Pieralisi
2013-08-30 17:27   ` Catalin Marinas
2013-09-02 10:05     ` Lorenzo Pieralisi
2013-08-28 11:35 ` [RFC PATCH 06/14] arm64: add CPU PM infrastructure selection Lorenzo Pieralisi
2013-08-28 11:35 ` [RFC PATCH 07/14] arm64: kernel: implement fpsimd CPU PM notifier Lorenzo Pieralisi
2013-08-28 11:36 ` [RFC PATCH 08/14] arm: kvm: implement " Lorenzo Pieralisi
2013-08-28 11:36 ` [RFC PATCH 09/14] arm64: kernel: implement debug monitors CPU PM notifiers Lorenzo Pieralisi
2013-08-28 11:36 ` [RFC PATCH 10/14] arm64: kernel: refactor code to install/uninstall breakpoints Lorenzo Pieralisi
2013-08-28 11:36 ` [RFC PATCH 11/14] arm64: kernel: implement HW breakpoints CPU PM notifier Lorenzo Pieralisi
2013-08-28 11:36 ` [RFC PATCH 12/14] arm64: kernel: add cpu_{suspend}/{resume} build infrastructure Lorenzo Pieralisi
2013-08-30 17:32   ` Catalin Marinas
2013-09-02 10:25     ` Lorenzo Pieralisi
2013-08-28 11:36 ` [RFC PATCH 13/14] arm64: kernel: add CPU idle call Lorenzo Pieralisi
2013-08-28 11:36 ` [RFC PATCH 14/14] arm64: add CPU power management menu/entries Lorenzo Pieralisi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).