From patchwork Thu Apr 2 05:40:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 6144351 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D4DDDBF4A6 for ; Thu, 2 Apr 2015 05:45:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E16AA2026C for ; Thu, 2 Apr 2015 05:45:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F3D5C2025A for ; Thu, 2 Apr 2015 05:45:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YdXu3-0008Bi-8x; Thu, 02 Apr 2015 05:42:55 +0000 Received: from mail-pd0-f173.google.com ([209.85.192.173]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YdXsn-0007Kl-Im for linux-arm-kernel@lists.infradead.org; Thu, 02 Apr 2015 05:41:38 +0000 Received: by pdea3 with SMTP id a3so27187175pde.3 for ; Wed, 01 Apr 2015 22:41:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aXdpAzIdO3MhC1p9Crh9kwPRofqwqpzR4Lw/HJG10DU=; b=CiT8ykIGu706Xa4iVGGJ41KK4h2qlgMk9qEnyC0/vPBzWoaTUwpSe36VS11rUsvP6z tQ/5b5ZRRdA2QGF0iwKKmRmmQlItGpWfOZYPgS1Q351uX52vuXVKgsMgzMuoLN/7kzuv VYy+t8HAcXmx14M3442Rw9yiJTUF9FBZafZcrCUtcuApDCiILMSeVltJU9W078ueCius AFO5zBDAYiWmf5cF7vZ59/0zjctGxlRRQ7SzUXfHncqemQbDP/KwVTGkMhVRuauqTlUr JWkxmvZR2GjepJfeAGby73XBqDXi02Z5wuC4LUbtl+Tq/9TQCFNzoyQtLxWjWyrOfzqg orgg== X-Gm-Message-State: ALoCoQlh59DFefy8DShIQAh7KHCcm1XtQl4gQkw1yZfzQTJETrFPrny4ef7I4M3rM4zpvBpeZweL X-Received: by 10.70.18.68 with SMTP id u4mr85371621pdd.38.1427953275310; Wed, 01 Apr 2015 22:41:15 -0700 (PDT) Received: from localhost.localdomain (61-205-5-51m5.grp1.mineo.jp. [61.205.5.51]) by mx.google.com with ESMTPSA id hb6sm3854757pbd.88.2015.04.01.22.41.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Apr 2015 22:41:14 -0700 (PDT) From: AKASHI Takahiro To: catalin.marinas@arm.com, will.deacon@arm.com, marc.zyngier@arm.com, mark.rutland@arm.com Subject: [v3 3/5] arm64: kvm: add cpu reset hook for cpu hotplug Date: Thu, 2 Apr 2015 14:40:14 +0900 Message-Id: <1427953216-11737-4-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427953216-11737-1-git-send-email-takahiro.akashi@linaro.org> References: <1427953216-11737-1-git-send-email-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150401_224137_690194_0769162E X-CRM114-Status: GOOD ( 12.36 ) X-Spam-Score: -0.7 (/) Cc: linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, geoff@infradead.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, AKASHI Takahiro , broonie@kernel.org, david.griego@linaro.org, christoffer.dall@linaro.org, freddy77@gmail.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- arch/arm/include/asm/kvm_host.h | 1 - arch/arm/kvm/arm.c | 9 +++++++++ arch/arm64/include/asm/kvm_host.h | 1 - 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h index 41008cd..ca97764 100644 --- a/arch/arm/include/asm/kvm_host.h +++ b/arch/arm/include/asm/kvm_host.h @@ -237,7 +237,6 @@ void kvm_mmu_wp_memory_region(struct kvm *kvm, int slot); struct kvm_vcpu *kvm_mpidr_to_vcpu(struct kvm *kvm, unsigned long mpidr); -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) {} diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index f64713e..4892974 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -922,6 +922,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; @@ -1165,6 +1169,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 6a8da9c..831e6a4 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -262,7 +262,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) {}