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: 46702 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 80993216D1 for ; Thu, 2 Apr 2015 05:41:30 +0000 (UTC) Received: by lbcne10 with SMTP id ne10sf7616510lbc.1 for ; Wed, 01 Apr 2015 22:41:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=q4MvKHhNJw2JrLtf3xAACmQhqOSaqDg9Odve9oW9F7w=; b=g7IiYtx9JbGZjx9HBuzJOOniqIr0kFIosChPSKrEKCHmS3gq11raWTH96a43+YDEj7 5bz1t8sEOPLEcqxeKnhHTPl4xSIeRGt5Wfw+4adsDUktcU3xEyH4xgPJzSKKHpqrD37P C/6MPPX1kr4JqlbZkgj8BNv4yBPu9VARZ6pWWsyHwXRFTcuo/mFTfausZcClCxCX7wsb dBkpYoh8STFyR6Q4DIUmK7ozJDw7SDf4hoyQiqkhQoMr/tUnBZOff+yOd0ahh80MpIKS ZcArHF0/poP/TqHnOh+yMNzQ5qH1Z1SG2CxqYca2UAbFZtjpJHHDyCgktwFIrBu03VYc BOtA== X-Gm-Message-State: ALoCoQkI6Ynyll9/ZVpibh3iStX53SkmNjLJo3k7OMj2875ugnl+WgHDyr+9Ff0Sn33sfmIXpMg4 X-Received: by 10.180.73.137 with SMTP id l9mr646281wiv.5.1427953289482; Wed, 01 Apr 2015 22:41:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.182.138 with SMTP id ee10ls64952lac.44.gmail; Wed, 01 Apr 2015 22:41:29 -0700 (PDT) X-Received: by 10.153.4.12 with SMTP id ca12mr10311145lad.90.1427953289120; Wed, 01 Apr 2015 22:41:29 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id ww6si3354729lbb.20.2015.04.01.22.41.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Apr 2015 22:41:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lboc7 with SMTP id c7so51737919lbo.1 for ; Wed, 01 Apr 2015 22:41:29 -0700 (PDT) X-Received: by 10.112.212.106 with SMTP id nj10mr38870008lbc.36.1427953289043; Wed, 01 Apr 2015 22:41:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.57.201 with SMTP id k9csp1110341lbq; Wed, 1 Apr 2015 22:41:28 -0700 (PDT) X-Received: by 10.66.55.104 with SMTP id r8mr82450651pap.75.1427953286992; Wed, 01 Apr 2015 22:41:26 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id iu1si5860976pbb.218.2015.04.01.22.41.25; Wed, 01 Apr 2015 22:41:26 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752729AbbDBFlS (ORCPT + 27 others); Thu, 2 Apr 2015 01:41:18 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:35966 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752670AbbDBFlP (ORCPT ); Thu, 2 Apr 2015 01:41:15 -0400 Received: by pdea3 with SMTP id a3so27187172pde.3 for ; Wed, 01 Apr 2015 22:41:15 -0700 (PDT) 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 Cc: christoffer.dall@linaro.org, geoff@infradead.org, broonie@kernel.org, david.griego@linaro.org, freddy77@gmail.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, AKASHI Takahiro 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: takahiro.akashi@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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) {}