From patchwork Tue Dec 19 10:23:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Murzin X-Patchwork-Id: 10122951 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 A6D76603B5 for ; Tue, 19 Dec 2017 10:24:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 959B4291D2 for ; Tue, 19 Dec 2017 10:24:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 875622920F; Tue, 19 Dec 2017 10:24:32 +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,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0C9F5291D2 for ; Tue, 19 Dec 2017 10:24:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=WPfzNEGcU2dx71vEJk4GpsA9WwVloTnDpF5q7GUVigM=; b=Cl+ lEx4XZAJgOZfReHjvse03dF0YE6M2mTfuBcqGersNIN7JWM0cpiEgyWld3RVM7ErJkNYyU+4t0Ljx ZymrL0Wi9vJNtyzaoKgK6cm2AJrWA8kJGmmO5+SSvxXAeHZEhZWDBFF/LkaImeuLOIt/InCiW/Dem Hj+W6qeaK6tKBAPqKJ1GFN3tmb7MtjZbgIpOChghSPv0lmWO2zS4JQFIsyOefphAaXOLXdF/U04H+ 3siFIaBOBaZ0l121L9Y13H0+14JH1aaAP7m5EWpK4iPuOwiF7H5rwHrDhOpsp7w5dxdqgWpZY8YJ5 LIKuyObleSUMHyVghdh7RgJU21UrcIA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eRF4W-0006sK-S0; Tue, 19 Dec 2017 10:24:28 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eRF4L-0006l8-Lm for linux-arm-kernel@lists.infradead.org; Tue, 19 Dec 2017 10:24:27 +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 5248780D; Tue, 19 Dec 2017 02:24:07 -0800 (PST) Received: from bc-b3-1-13.euhpc.arm.com. (bc-b3-1-13.euhpc.arm.com [10.6.4.104]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8A3D93F41F; Tue, 19 Dec 2017 02:24:06 -0800 (PST) From: Vladimir Murzin To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: NOMMU: Setup VBAR/Hivecs for secondaries cores Date: Tue, 19 Dec 2017 10:23:49 +0000 Message-Id: <1513679029-5915-1-git-send-email-vladimir.murzin@arm.com> X-Mailer: git-send-email 2.0.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171219_022417_994772_969C3E0F X-CRM114-Status: UNSURE ( 8.87 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: afzal.mohd.ma@gmail.com, linux@armlinux.org.uk 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 With switch to dynamic exception base address setting, VBAR/Hivecs set only for boot CPU, but secondaries stay unaware of that. That might lead to weird effects when trying up to bring up secondaries. Fixes: ad475117d201 ("ARM: 8649/2: nommu: remove Hivecs configuration is asm") Signed-off-by: Vladimir Murzin --- arch/arm/include/asm/memory.h | 9 +++++++++ arch/arm/kernel/smp.c | 2 ++ arch/arm/mm/nommu.c | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 1f54e4e..65c52ac 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -165,6 +165,15 @@ extern unsigned long vectors_base; #ifndef __ASSEMBLY__ +#ifndef CONFIG_MMU +extern unsigned long setup_vectors_base(void); +#else +static inline unsigned long setup_vectors_base(void) +{ + return 0; +} +#endif + /* * Physical vs virtual RAM address space conversion. These are * private definitions which should NOT be used outside memory.h diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index b4fbf00..248e33f 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -379,6 +379,8 @@ asmlinkage void secondary_start_kernel(void) cpu_init(); + setup_vectors_base(); + pr_debug("CPU%u: Booted secondary processor\n", cpu); preempt_disable(); diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c index 885b106..c8beaab 100644 --- a/arch/arm/mm/nommu.c +++ b/arch/arm/mm/nommu.c @@ -31,7 +31,7 @@ struct mpu_rgn_info mpu_rgn_info; #ifdef CONFIG_CPU_CP15 #ifdef CONFIG_CPU_HIGH_VECTOR -static unsigned long __init setup_vectors_base(void) +unsigned long setup_vectors_base(void) { unsigned long reg = get_cr(); @@ -58,7 +58,7 @@ static inline bool security_extensions_enabled(void) return 0; } -static unsigned long __init setup_vectors_base(void) +unsigned long setup_vectors_base(void) { unsigned long base = 0, reg = get_cr();