From patchwork Thu Mar 26 08:25:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 6096841 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AD6ED9F399 for ; Thu, 26 Mar 2015 08:32:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C42CA2010C for ; Thu, 26 Mar 2015 08:32:31 +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 D7C60203E5 for ; Thu, 26 Mar 2015 08:32:30 +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 1Yb3AP-0002vn-R5; Thu, 26 Mar 2015 08:29:29 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yb38U-0001s9-2R for linux-arm-kernel@bombadil.infradead.org; Thu, 26 Mar 2015 08:27:30 +0000 Received: from mail-pa0-f45.google.com ([209.85.220.45]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yb38R-0004nN-I1 for linux-arm-kernel@lists.infradead.org; Thu, 26 Mar 2015 08:27:28 +0000 Received: by pacwz10 with SMTP id wz10so5274216pac.2 for ; Thu, 26 Mar 2015 01:27:01 -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=hkcjxNLPGO3K+DE0RyfpzlN0HS6gaAK16hn1p789A3D83BtuvDdQ+DT/NDNHgXRHRP yUkL1R2s3b2ungkUvvPeVvG4oY/KbQnCbNYp7BalahG5Bc7DbG9yRVj/pTVxhPKLB4es v3N/PnWb+aRB0FRB8zLqbhoCkbXGZf2Q/682sm4EZFmADM55q9pKpEdvTO8WUldu16g/ kP7WgCMqmsbGF9bnlctRwhpq8LYVF6Q+1g9wrL7qZlnFckMqb0m84YZiHlEEoScU/wHH BchVVuvtNOq16hY5k5Cy0LqWxlWZriVBI7PoyF9jTkGDPBJ2Csiw2Lhs3+nSGnA9g31+ UupQ== X-Gm-Message-State: ALoCoQlQMN1MP8i88e/C4JI6LzSrrjI+Av4BbHL2P2+D5/wVz+DYhOs967Op7Xdba3TRNdrn2Z4z X-Received: by 10.66.101.73 with SMTP id fe9mr24895546pab.156.1427358421011; Thu, 26 Mar 2015 01:27:01 -0700 (PDT) Received: from localhost.localdomain (61-205-2-129m5.grp1.mineo.jp. [61.205.2.129]) by mx.google.com with ESMTPSA id xz1sm4722152pbb.47.2015.03.26.01.26.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Mar 2015 01:27:00 -0700 (PDT) From: AKASHI Takahiro To: catalin.marinas@arm.com, will.deacon@arm.com, marc.zyngier@arm.com, mark.rutland@arm.com Subject: [RFC v2 3/5] arm64: kvm: add cpu reset hook for cpu hotplug Date: Thu, 26 Mar 2015 17:25:24 +0900 Message-Id: <1427358326-3708-4-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427358326-3708-1-git-send-email-takahiro.akashi@linaro.org> References: <1427358326-3708-1-git-send-email-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150326_042727_672623_475B840D X-CRM114-Status: GOOD ( 12.38 ) X-Spam-Score: -2.6 (--) 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) {}