linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: takahiro.akashi@linaro.org (AKASHI Takahiro)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 3/4] arm64: kvm: add cpu reset hook for cpu hotplug
Date: Mon, 23 Mar 2015 20:53:58 +0900	[thread overview]
Message-ID: <1427111639-4575-4-git-send-email-takahiro.akashi@linaro.org> (raw)
In-Reply-To: <1427111639-4575-1-git-send-email-takahiro.akashi@linaro.org>

This patch doesn't enable cpu hotplug under kvm, but is a prerequiste
when the feature is implemented.
Once kvm_arch_hardware_enable/disable() is properly implemented,
arm64-specific cpu notifier hook, hyp_init_cpu_notify(), will be
able to be removed and replaced by generic kvm_cpu_hotplug().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 arch/arm/kvm/arm.c                |    9 +++++++++
 arch/arm64/include/asm/kvm_host.h |    1 -
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index b879cf6..08804d3 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -925,6 +925,10 @@ static int hyp_init_cpu_notify(struct notifier_block *self,
 		if (__hyp_get_vectors() == hyp_default_vectors)
 			cpu_init_hyp_mode(NULL);
 		break;
+	case CPU_DYING:
+	case CPU_DYING_FROZEN:
+		kvm_cpu_reset(NULL);
+		break;
 	}
 
 	return NOTIFY_OK;
@@ -1168,6 +1172,11 @@ out_err:
 	return err;
 }
 
+void kvm_arch_hardware_disable(void)
+{
+	kvm_cpu_reset(NULL);
+}
+
 /* NOP: Compiling as a module not supported */
 void kvm_arch_exit(void)
 {
diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
index 97f88fe..a97b2fe 100644
--- a/arch/arm64/include/asm/kvm_host.h
+++ b/arch/arm64/include/asm/kvm_host.h
@@ -261,7 +261,6 @@ static inline void vgic_arch_setup(const struct vgic_params *vgic)
 	}
 }
 
-static inline void kvm_arch_hardware_disable(void) {}
 static inline void kvm_arch_hardware_unsetup(void) {}
 static inline void kvm_arch_sync_events(struct kvm *kvm) {}
 static inline void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu) {}
-- 
1.7.9.5

  parent reply	other threads:[~2015-03-23 11:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23 11:53 [RFC 0/4] arm64: kexec: fix kvm issue in kexec AKASHI Takahiro
2015-03-23 11:53 ` [RFC 1/4] arm64: kvm: add a cpu tear-down function AKASHI Takahiro
2015-03-23 16:46   ` Geoff Levand
2015-03-24  7:48     ` AKASHI Takahiro
2015-03-24 10:00   ` Marc Zyngier
2015-03-25  8:06     ` AKASHI Takahiro
2015-03-25  9:48       ` Marc Zyngier
2015-03-23 11:53 ` [RFC 2/4] arm64: kexec: fix kvm issue AKASHI Takahiro
2015-03-23 15:56   ` Geoff Levand
2015-03-24  7:52     ` AKASHI Takahiro
2015-03-24  8:46     ` Marc Zyngier
2015-03-24 16:56       ` Geoff Levand
2015-03-23 11:53 ` AKASHI Takahiro [this message]
2015-03-23 11:53 ` [RFC 4/4] arm64: kvm: add cpu reset at module exit AKASHI Takahiro

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=1427111639-4575-4-git-send-email-takahiro.akashi@linaro.org \
    --to=takahiro.akashi@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).