From patchwork Tue Sep 20 14:13:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 9341761 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 317066077A for ; Tue, 20 Sep 2016 14:16:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22D93296C2 for ; Tue, 20 Sep 2016 14:16:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17A0D296F4; Tue, 20 Sep 2016 14:16:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5699B296C2 for ; Tue, 20 Sep 2016 14:16:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bmLpG-00052t-OO; Tue, 20 Sep 2016 14:15:10 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bmLoW-0004Nw-LW for linux-arm-kernel@lists.infradead.org; Tue, 20 Sep 2016 14:14:34 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5D10914F; Tue, 20 Sep 2016 07:14:05 -0700 (PDT) Received: from approximate.cambridge.arm.com (approximate.cambridge.arm.com [10.1.207.16]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9F8813F21A; Tue, 20 Sep 2016 07:14:04 -0700 (PDT) From: Marc Zyngier To: arm@kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] ARM: vexpress: Do not enable MCPM if booted from HYP Date: Tue, 20 Sep 2016 15:13:52 +0100 Message-Id: <1474380833-30121-2-git-send-email-marc.zyngier@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1474380833-30121-1-git-send-email-marc.zyngier@arm.com> References: <1474380833-30121-1-git-send-email-marc.zyngier@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160920_071424_816417_34D8DA36 X-CRM114-Status: GOOD ( 11.98 ) 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: Lorenzo Pieralisi , Sudeep Holla MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Using MCPM implies being able to tweak the CCI at runtime, which is impossible to do when running non-secure. Since HYP implies running non-secure, let's not enable MCPM in that case. Signed-off-by: Marc Zyngier --- arch/arm/mach-vexpress/platsmp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c index 8b8d072..09819f1 100644 --- a/arch/arm/mach-vexpress/platsmp.c +++ b/arch/arm/mach-vexpress/platsmp.c @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -29,11 +30,14 @@ bool __init vexpress_smp_init_ops(void) /* * The best way to detect a multi-cluster configuration at the moment * is to look for the presence of a CCI in the system. - * Override the default vexpress_smp_ops if so. + * Override the default vexpress_smp_ops if so, but only if + * the kernel is not booted from HYP mode (which indicates + * that we're running in non-secure mode, where the CCI is not + * accessible). */ struct device_node *node; node = of_find_compatible_node(NULL, NULL, "arm,cci-400"); - if (node && of_device_is_available(node)) { + if (node && of_device_is_available(node) && !is_hyp_mode_available()) { mcpm_smp_set_ops(); return true; }