From patchwork Fri Apr 8 09:52:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 65390 Delivered-To: patch@linaro.org Received: by 10.112.43.237 with SMTP id z13csp572459lbl; Fri, 8 Apr 2016 02:54:12 -0700 (PDT) X-Received: by 10.98.72.218 with SMTP id q87mr11483277pfi.117.1460109251715; Fri, 08 Apr 2016 02:54:11 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id v71si32740pfi.22.2016.04.08.02.54.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Apr 2016 02:54:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org 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 1aoT6F-0002P7-QU; Fri, 08 Apr 2016 09:53:11 +0000 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aoT5e-0001yk-P7 for linux-arm-kernel@lists.infradead.org; Fri, 08 Apr 2016 09:52:37 +0000 Received: by mail-wm0-x22d.google.com with SMTP id 191so12748714wmq.0 for ; Fri, 08 Apr 2016 02:52:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/9CeFKJW+TK2ehPSMqh02UCcEaiTbGmg23pFF+uLMjs=; b=HaIrq65E9PNORa7aeyKWKjtfG8hgbgvZ02e/sUbaD0C7BvtffMZMqqX9m9nF/A3Yc7 T92cyMvvCd3bYwOhjKQ8ZAlzpSPjLkxrC/RL0UlES/gMC1nZgX59NDJAOqZyNl2Nvf7n 9uqTiNNZV5AuE2lgerRE5nyQqpfHJmSvcl9Gw= 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=/9CeFKJW+TK2ehPSMqh02UCcEaiTbGmg23pFF+uLMjs=; b=SD+l+4r/TWNIZY+FK4nXNON7aR+FXbu0xzvy4FILUyT8/FPBa7sgZ/AF5joqVb1Xcu GULXbUDTIL42JEOHcKAlaXMmZuXjtpU6MrDzwU+U/pR68C172opDoBQmWc7p0d9bzUS1 Jq2kuOYyf20X5z+ctNV4PR80zmGlvW7+WQw9db/556ramaMV8AhRAzh7Ilm8xSt1L94l ceRLOCUQRSEYAwnF7m+RBXH82lhlVrwzOSgkEjPspfI3yjih8wEg/fLJUPaqiwu7v36V NyKCWpMG760o2MvEeYProTyhKn9xpQl/wI7v8bWEZVth9XTyY2plBRqvFDlzUes2hIT1 SONg== X-Gm-Message-State: AD7BkJKBuLTKCaQ7fawgk6HN1plgcLrf1bZWu1HVZnarWnbPPBGd5Ub5x7v7SYigSgBran0F X-Received: by 10.194.83.134 with SMTP id q6mr8294089wjy.131.1460109134256; Fri, 08 Apr 2016 02:52:14 -0700 (PDT) Received: from localhost.localdomain ([94.18.191.146]) by smtp.gmail.com with ESMTPSA id ys9sm12580276wjc.35.2016.04.08.02.52.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Apr 2016 02:52:13 -0700 (PDT) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PULL 4/4] arm64: KVM: unregister notifiers in hyp mode teardown path Date: Fri, 8 Apr 2016 11:52:15 +0200 Message-Id: <1460109135-6612-5-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.1.2.330.g565301e.dirty In-Reply-To: <1460109135-6612-1-git-send-email-christoffer.dall@linaro.org> References: <1460109135-6612-1-git-send-email-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160408_025235_257367_484E6566 X-CRM114-Status: GOOD ( 13.54 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:22d listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, Marc Zyngier , linux-arm-kernel@lists.infradead.org, Sudeep Holla , kvmarm@lists.cs.columbia.edu, Christoffer Dall MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org From: Sudeep Holla Commit 1e947bad0b63 ("arm64: KVM: Skip HYP setup when already running in HYP") re-organized the hyp init code and ended up leaving the CPU hotplug and PM notifier even if hyp mode initialization fails. Since KVM is not yet supported with ACPI, the above mentioned commit breaks CPU hotplug in ACPI boot. This patch fixes teardown_hyp_mode to properly unregister both CPU hotplug and PM notifiers in the teardown path. Fixes: 1e947bad0b63 ("arm64: KVM: Skip HYP setup when already running in HYP") Cc: Christoffer Dall Cc: Marc Zyngier Signed-off-by: Sudeep Holla Signed-off-by: Christoffer Dall --- arch/arm/kvm/arm.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) -- 2.1.2.330.g565301e.dirty _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index b538431..dded1b7 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -1112,10 +1112,17 @@ static void __init hyp_cpu_pm_init(void) { cpu_pm_register_notifier(&hyp_init_cpu_pm_nb); } +static void __init hyp_cpu_pm_exit(void) +{ + cpu_pm_unregister_notifier(&hyp_init_cpu_pm_nb); +} #else static inline void hyp_cpu_pm_init(void) { } +static inline void hyp_cpu_pm_exit(void) +{ +} #endif static void teardown_common_resources(void) @@ -1141,9 +1148,7 @@ static int init_subsystems(void) /* * Register CPU Hotplug notifier */ - cpu_notifier_register_begin(); - err = __register_cpu_notifier(&hyp_init_cpu_nb); - cpu_notifier_register_done(); + err = register_cpu_notifier(&hyp_init_cpu_nb); if (err) { kvm_err("Cannot register KVM init CPU notifier (%d)\n", err); return err; @@ -1193,6 +1198,8 @@ static void teardown_hyp_mode(void) free_hyp_pgds(); for_each_possible_cpu(cpu) free_page(per_cpu(kvm_arm_hyp_stack_page, cpu)); + unregister_cpu_notifier(&hyp_init_cpu_nb); + hyp_cpu_pm_exit(); } static int init_vhe_mode(void)