From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> To: linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, Dave Martin <dave.martin@arm.com>, Will Deacon <will.deacon@arm.com>, Catalin Marinas <catalin.marinas@arm.com>, Marc Zyngier <marc.zyngier@arm.com>, Mark Rutland <mark.rutland@arm.com>, Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>, Russell King <linux@arm.linux.org.uk>, Colin Cross <ccross@android.com>, Yu Tang <ytang5@marvell.com>, Zhou Zhu <zzhu3@marvell.com>, Kumar Sankaran <ksankaran@apm.com>, Loc Ho <lho@apm.com>, Feng Kan <fkan@apm.com>, Nicolas Pitre <nico@linaro.org>, Santosh Shilimkar <santosh.shilimkar@ti.com>, Stephen Boyd <sboyd@codeaurora.org>, Graeme Gregory <graeme.gregory@linaro.org>, Hanjun Guo <hanjun.guo@linaro.org>, Daniel Lezcano <daniel.lezcano@linaro.org>, Christoffer Dall <christoffer.dall@linaro.org> Subject: [PATCH RFC v3 00/12] arm64: suspend/resume implementation Date: Thu, 21 Nov 2013 11:24:07 +0000 [thread overview] Message-ID: <1385033059-25896-1-git-send-email-lorenzo.pieralisi@arm.com> (raw) This series is v3 of a previous posting: http://lists.infradead.org/pipermail/linux-arm-kernel/2013-October/204471.html CPU idle driver and PSCI suspend implementation used for testing are not published as part of this series since they depend on standardization of PSCI bindings for C-states; code can be made available on a separate branch if required. v3 changes: - Rebased to 3.12 - Removed unused macros, merged them in generic cpu_do_{suspend}/{resume} - Refactored hw breakpoint reset code - Split Kconfig and make infrastructure - Moved debug monitors save/restore to cpu_do_{suspend}/{resume} and cpu_suspend interface v2 changes: - Rebased to 3.12-rc4 - Changed cpu_suspend prototype - Added macros to save/restore CPU registers - Improved register/load/store scheduling in context save/restore - Changed Kconfig option - Refactored the stack allocation and context struct layout - Fixed a bug in cpu_suspend return path - Added tick broadcast support - Dropped RFC tag This patch series provides an implementation of suspend/resume and related CPU PM notifiers for the arm64 architecture. The implementation has been tweaked and code made a bit more generic wrt ARM 32 bits version. The cpu_suspend call prototype accepts a single parameter that is translated by the CPU operations suspend protocol backend into a series of protocol (eg PSCI) specific parameters and function calls. This allows for generic suspend-to-RAM and CPU idle drivers, where the platform complexity is hidden behind the CPU ops suspend protocol implementation. 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 shutdown 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 (12): arm64: kernel: add MPIDR_EL1 accessors macros arm64: kernel: build MPIDR_EL1 hash function data structure arm64: kernel: suspend/resume registers save/restore arm64: kernel: cpu_{suspend/resume} implementation arm64: kernel: implement fpsimd CPU PM notifier arm: kvm: implement CPU PM notifier arm64: kernel: refactor code to install/uninstall breakpoints arm64: kernel: implement HW breakpoints CPU PM notifier arm64: enable generic clockevent broadcast arm64: kernel: add CPU idle call arm64: kernel: add PM build infrastructure arm64: add CPU power management menu/entries arch/arm/kvm/arm.c | 30 ++++++ arch/arm64/Kconfig | 21 ++++ arch/arm64/include/asm/cpu_ops.h | 6 ++ arch/arm64/include/asm/cputype.h | 10 ++ arch/arm64/include/asm/hardirq.h | 2 +- arch/arm64/include/asm/proc-fns.h | 3 + arch/arm64/include/asm/smp_plat.h | 13 +++ arch/arm64/include/asm/suspend.h | 27 +++++ arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/asm-offsets.c | 11 ++ arch/arm64/kernel/fpsimd.c | 36 +++++++ arch/arm64/kernel/hw_breakpoint.c | 221 ++++++++++++++++++++++++++------------ arch/arm64/kernel/process.c | 7 +- arch/arm64/kernel/setup.c | 70 ++++++++++++ arch/arm64/kernel/sleep.S | 184 +++++++++++++++++++++++++++++++ arch/arm64/kernel/smp.c | 17 +++ arch/arm64/kernel/suspend.c | 109 +++++++++++++++++++ arch/arm64/mm/proc.S | 69 ++++++++++++ 18 files changed, 767 insertions(+), 70 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.4
WARNING: multiple messages have this Message-ID (diff)
From: lorenzo.pieralisi@arm.com (Lorenzo Pieralisi) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH RFC v3 00/12] arm64: suspend/resume implementation Date: Thu, 21 Nov 2013 11:24:07 +0000 [thread overview] Message-ID: <1385033059-25896-1-git-send-email-lorenzo.pieralisi@arm.com> (raw) This series is v3 of a previous posting: http://lists.infradead.org/pipermail/linux-arm-kernel/2013-October/204471.html CPU idle driver and PSCI suspend implementation used for testing are not published as part of this series since they depend on standardization of PSCI bindings for C-states; code can be made available on a separate branch if required. v3 changes: - Rebased to 3.12 - Removed unused macros, merged them in generic cpu_do_{suspend}/{resume} - Refactored hw breakpoint reset code - Split Kconfig and make infrastructure - Moved debug monitors save/restore to cpu_do_{suspend}/{resume} and cpu_suspend interface v2 changes: - Rebased to 3.12-rc4 - Changed cpu_suspend prototype - Added macros to save/restore CPU registers - Improved register/load/store scheduling in context save/restore - Changed Kconfig option - Refactored the stack allocation and context struct layout - Fixed a bug in cpu_suspend return path - Added tick broadcast support - Dropped RFC tag This patch series provides an implementation of suspend/resume and related CPU PM notifiers for the arm64 architecture. The implementation has been tweaked and code made a bit more generic wrt ARM 32 bits version. The cpu_suspend call prototype accepts a single parameter that is translated by the CPU operations suspend protocol backend into a series of protocol (eg PSCI) specific parameters and function calls. This allows for generic suspend-to-RAM and CPU idle drivers, where the platform complexity is hidden behind the CPU ops suspend protocol implementation. 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 shutdown 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 (12): arm64: kernel: add MPIDR_EL1 accessors macros arm64: kernel: build MPIDR_EL1 hash function data structure arm64: kernel: suspend/resume registers save/restore arm64: kernel: cpu_{suspend/resume} implementation arm64: kernel: implement fpsimd CPU PM notifier arm: kvm: implement CPU PM notifier arm64: kernel: refactor code to install/uninstall breakpoints arm64: kernel: implement HW breakpoints CPU PM notifier arm64: enable generic clockevent broadcast arm64: kernel: add CPU idle call arm64: kernel: add PM build infrastructure arm64: add CPU power management menu/entries arch/arm/kvm/arm.c | 30 ++++++ arch/arm64/Kconfig | 21 ++++ arch/arm64/include/asm/cpu_ops.h | 6 ++ arch/arm64/include/asm/cputype.h | 10 ++ arch/arm64/include/asm/hardirq.h | 2 +- arch/arm64/include/asm/proc-fns.h | 3 + arch/arm64/include/asm/smp_plat.h | 13 +++ arch/arm64/include/asm/suspend.h | 27 +++++ arch/arm64/kernel/Makefile | 1 + arch/arm64/kernel/asm-offsets.c | 11 ++ arch/arm64/kernel/fpsimd.c | 36 +++++++ arch/arm64/kernel/hw_breakpoint.c | 221 ++++++++++++++++++++++++++------------ arch/arm64/kernel/process.c | 7 +- arch/arm64/kernel/setup.c | 70 ++++++++++++ arch/arm64/kernel/sleep.S | 184 +++++++++++++++++++++++++++++++ arch/arm64/kernel/smp.c | 17 +++ arch/arm64/kernel/suspend.c | 109 +++++++++++++++++++ arch/arm64/mm/proc.S | 69 ++++++++++++ 18 files changed, 767 insertions(+), 70 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.4
next reply other threads:[~2013-11-21 11:24 UTC|newest] Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-11-21 11:24 Lorenzo Pieralisi [this message] 2013-11-21 11:24 ` [PATCH RFC v3 00/12] arm64: suspend/resume implementation Lorenzo Pieralisi 2013-11-21 11:24 ` [PATCH RFC v3 01/12] arm64: kernel: add MPIDR_EL1 accessors macros Lorenzo Pieralisi 2013-11-21 11:24 ` Lorenzo Pieralisi 2013-11-21 11:24 ` [PATCH RFC v3 02/12] arm64: kernel: build MPIDR_EL1 hash function data structure Lorenzo Pieralisi 2013-11-21 11:24 ` Lorenzo Pieralisi 2013-11-21 11:24 ` [PATCH RFC v3 03/12] arm64: kernel: suspend/resume registers save/restore Lorenzo Pieralisi 2013-11-21 11:24 ` Lorenzo Pieralisi 2013-11-21 11:24 ` [PATCH RFC v3 04/12] arm64: kernel: cpu_{suspend/resume} implementation Lorenzo Pieralisi 2013-11-21 11:24 ` Lorenzo Pieralisi 2013-12-20 11:30 ` Leo Yan 2013-12-20 11:30 ` Leo Yan 2013-12-20 11:57 ` Catalin Marinas 2013-12-20 11:57 ` Catalin Marinas 2013-12-23 14:04 ` Lorenzo Pieralisi 2013-12-23 14:04 ` Lorenzo Pieralisi 2013-12-24 6:18 ` Leo Yan 2013-12-24 6:18 ` Leo Yan 2013-11-21 11:24 ` [PATCH RFC v3 05/12] arm64: kernel: implement fpsimd CPU PM notifier Lorenzo Pieralisi 2013-11-21 11:24 ` Lorenzo Pieralisi 2013-11-21 11:24 ` [PATCH RFC v3 06/12] arm: kvm: implement " Lorenzo Pieralisi 2013-11-21 11:24 ` Lorenzo Pieralisi 2013-11-27 3:02 ` Christoffer Dall 2013-11-27 3:02 ` Christoffer Dall 2013-11-21 11:24 ` [PATCH RFC v3 07/12] arm64: kernel: refactor code to install/uninstall breakpoints Lorenzo Pieralisi 2013-11-21 11:24 ` Lorenzo Pieralisi 2013-11-21 11:24 ` [PATCH RFC v3 08/12] arm64: kernel: implement HW breakpoints CPU PM notifier Lorenzo Pieralisi 2013-11-21 11:24 ` Lorenzo Pieralisi 2013-12-20 17:29 ` Will Deacon 2013-12-20 17:29 ` Will Deacon 2013-12-23 13:50 ` Lorenzo Pieralisi 2013-12-23 13:50 ` Lorenzo Pieralisi 2013-11-21 11:24 ` [PATCH RFC v3 09/12] arm64: enable generic clockevent broadcast Lorenzo Pieralisi 2013-11-21 11:24 ` Lorenzo Pieralisi 2013-11-21 11:24 ` [PATCH RFC v3 10/12] arm64: kernel: add CPU idle call Lorenzo Pieralisi 2013-11-21 11:24 ` Lorenzo Pieralisi 2013-11-21 11:24 ` [PATCH RFC v3 11/12] arm64: kernel: add PM build infrastructure Lorenzo Pieralisi 2013-11-21 11:24 ` Lorenzo Pieralisi 2013-11-21 11:24 ` [PATCH RFC v3 12/12] arm64: add CPU power management menu/entries Lorenzo Pieralisi 2013-11-21 11:24 ` Lorenzo Pieralisi
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1385033059-25896-1-git-send-email-lorenzo.pieralisi@arm.com \ --to=lorenzo.pieralisi@arm.com \ --cc=catalin.marinas@arm.com \ --cc=ccross@android.com \ --cc=christoffer.dall@linaro.org \ --cc=daniel.lezcano@linaro.org \ --cc=dave.martin@arm.com \ --cc=fkan@apm.com \ --cc=graeme.gregory@linaro.org \ --cc=hanjun.guo@linaro.org \ --cc=ksankaran@apm.com \ --cc=lho@apm.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-pm@vger.kernel.org \ --cc=linux@arm.linux.org.uk \ --cc=marc.zyngier@arm.com \ --cc=mark.rutland@arm.com \ --cc=nico@linaro.org \ --cc=santosh.shilimkar@ti.com \ --cc=sboyd@codeaurora.org \ --cc=sudeep.karkadanagesha@arm.com \ --cc=will.deacon@arm.com \ --cc=ytang5@marvell.com \ --cc=zzhu3@marvell.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.