From: Christoffer Dall <christoffer.dall@linaro.org>
To: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org,
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>
Subject: Re: [PATCH RFC v3 06/12] arm: kvm: implement CPU PM notifier
Date: Tue, 26 Nov 2013 19:02:51 -0800 [thread overview]
Message-ID: <20131127030251.GW9314@cbox> (raw)
In-Reply-To: <1385033059-25896-7-git-send-email-lorenzo.pieralisi@arm.com>
On Thu, Nov 21, 2013 at 11:24:13AM +0000, Lorenzo Pieralisi wrote:
> Upon CPU shutdown and consequent warm-reboot, the hypervisor CPU state
> must be re-initialized. This patch implements a CPU PM notifier that
> upon warm-boot calls a KVM hook to reinitialize properly the hypervisor
> state so that the CPU can be safely resumed.
>
> Acked-by: Marc Zyngier <marc.zyngier@arm.com>
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> ---
> arch/arm/kvm/arm.c | 30 ++++++++++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
> diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
> index 2a700e0..b18165c 100644
> --- a/arch/arm/kvm/arm.c
> +++ b/arch/arm/kvm/arm.c
> @@ -17,6 +17,7 @@
> */
>
> #include <linux/cpu.h>
> +#include <linux/cpu_pm.h>
> #include <linux/errno.h>
> #include <linux/err.h>
> #include <linux/kvm_host.h>
> @@ -853,6 +854,33 @@ static struct notifier_block hyp_init_cpu_nb = {
> .notifier_call = hyp_init_cpu_notify,
> };
>
> +#ifdef CONFIG_CPU_PM
> +static int hyp_init_cpu_pm_notifier(struct notifier_block *self,
> + unsigned long cmd,
> + void *v)
> +{
> + if (cmd == CPU_PM_EXIT) {
> + cpu_init_hyp_mode(NULL);
> + return NOTIFY_OK;
> + }
> +
> + return NOTIFY_DONE;
> +}
> +
> +static struct notifier_block hyp_init_cpu_pm_nb = {
> + .notifier_call = hyp_init_cpu_pm_notifier,
> +};
> +
> +static void __init hyp_cpu_pm_init(void)
> +{
> + cpu_pm_register_notifier(&hyp_init_cpu_pm_nb);
> +}
> +#else
> +static inline void hyp_cpu_pm_init(void)
> +{
> +}
> +#endif
> +
> /**
> * Inits Hyp-mode on all online CPUs
> */
> @@ -1013,6 +1041,8 @@ int kvm_arch_init(void *opaque)
> goto out_err;
> }
>
> + hyp_cpu_pm_init();
> +
> kvm_coproc_table_init();
> return 0;
> out_err:
> --
> 1.8.4
>
>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
next prev parent reply other threads:[~2013-11-27 3:01 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` [PATCH RFC v3 02/12] arm64: kernel: build MPIDR_EL1 hash function data structure 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 ` [PATCH RFC v3 04/12] arm64: kernel: cpu_{suspend/resume} implementation Lorenzo Pieralisi
2013-12-20 11:30 ` Leo Yan
2013-12-20 11:57 ` Catalin Marinas
2013-12-23 14:04 ` Lorenzo Pieralisi
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 ` [PATCH RFC v3 06/12] arm: kvm: implement " Lorenzo Pieralisi
2013-11-27 3:02 ` Christoffer Dall [this message]
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 ` [PATCH RFC v3 08/12] arm64: kernel: implement HW breakpoints CPU PM notifier Lorenzo Pieralisi
2013-12-20 17:29 ` Will Deacon
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 ` [PATCH RFC v3 10/12] arm64: kernel: add CPU idle call 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 ` [PATCH RFC v3 12/12] arm64: add CPU power management menu/entries 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=20131127030251.GW9314@cbox \
--to=christoffer.dall@linaro.org \
--cc=catalin.marinas@arm.com \
--cc=ccross@android.com \
--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=lorenzo.pieralisi@arm.com \
--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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox