From patchwork Mon Mar 23 11:53:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 6071661 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 B1FD09F318 for ; Mon, 23 Mar 2015 12:00:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E26442017E for ; Mon, 23 Mar 2015 12:00:35 +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 E855A200CA for ; Mon, 23 Mar 2015 12:00:34 +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 1Ya0za-0003EP-S5; Mon, 23 Mar 2015 11:58:02 +0000 Received: from mail-pa0-f46.google.com ([209.85.220.46]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ya0xI-0001fa-M3 for linux-arm-kernel@lists.infradead.org; Mon, 23 Mar 2015 11:55:41 +0000 Received: by pagv19 with SMTP id v19so14430035pag.2 for ; Mon, 23 Mar 2015 04:55:18 -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=pXvRzMD7PDIYRYAjzoOYjpz2AsIFVpP+APG/CB2VZS8=; b=Sry4sd/2Pcjk9VtKcgjSyb+LNQifTXFeiG1DPVc3+qGe+u+xVlBuU3oWJp4Z0hleSM qlj2uY3zMaayhf+oMyfpoldrBC+bER9CGnStPj00autMoYNjDwtJjEpavY59oDYnbcCG m0ejLn5HP54i6rUKhG90Qoi+XbyvrhnbIiUgdKEtariNcUCPMj4Kg45zWHecAHaj4RSL mKJVy7YXq+zbq106znMzBfJFa2OdryFmvszUhiIf3cV0HBhp3Saq83sOywV7LCi0Q7J4 exZ0iTnlUUILzb2wpAzbocbOnXkepsTSto0qWe1Y+BUgHSOspllNLVpL0buG/4uayxj3 lMWw== X-Gm-Message-State: ALoCoQkTAaPemFZf/k1YQwZh4GoNVHmqSEW1mSkCRYJsxBejakiecs2qlzOiT3Z9eD6LEsSxccjY X-Received: by 10.68.252.69 with SMTP id zq5mr20519655pbc.35.1427111718388; Mon, 23 Mar 2015 04:55:18 -0700 (PDT) Received: from localhost.localdomain (61-205-5-195m5.grp1.mineo.jp. [61.205.5.195]) by mx.google.com with ESMTPSA id ok8sm799377pdb.66.2015.03.23.04.55.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Mar 2015 04:55:17 -0700 (PDT) From: AKASHI Takahiro To: catalin.marinas@arm.com, will.deacon@arm.com, marc.zyngier@arm.com, mark.rutland@arm.com Subject: [RFC 3/4] arm64: kvm: add cpu reset hook for cpu hotplug Date: Mon, 23 Mar 2015 20:53:58 +0900 Message-Id: <1427111639-4575-4-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427111639-4575-1-git-send-email-takahiro.akashi@linaro.org> References: <1427111639-4575-1-git-send-email-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150323_045540_794029_2C289AA6 X-CRM114-Status: GOOD ( 11.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/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) {}