From patchwork Wed Dec 13 17:02:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Murzin X-Patchwork-Id: 10110395 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 4B06960352 for ; Wed, 13 Dec 2017 17:02:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3ACBE28D1E for ; Wed, 13 Dec 2017 17:02:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E21728D2F; Wed, 13 Dec 2017 17:02:55 +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 8DC1E28D1E for ; Wed, 13 Dec 2017 17:02:54 +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:References: In-Reply-To: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:List-Owner; bh=nHF3cpky4CCLMb5Vh4bcZL+Mb71SJl6Y0qrxSiqv93E=; b=URiyioFx4arjIMAo/eTh/qL0PM MVVKMefMbuqbdcFwH0QAZSEuql2i7fR0TymJ3vI5bfVRItLPGI075h9QKRmbJoAUzjXkMpN8mKynK 701IW1qoQ9Sa2GsZNN2MCbYk5bG2/Ka3Yu79yIP/XXzIEme9FDeMrB9S+uDGaIaceQBMKB+RsFRF5 GmYRoke/Ct5NprWrM7/0HUyxf2+FE82x3gHbcRRrHpR+NanYR3qxcE+Gdy8rL4RJtOK5GDHBRo2kA pIsfpOt18bfvMuHW8A0ej4tZMZJWk/K1h5lcUxsa/zcu2pbHu5vGBT08wVfaGEnJSt6bCucRh3YtW HhkANn2A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ePAQm-0005Lv-Tu; Wed, 13 Dec 2017 17:02:52 +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.87 #1 (Red Hat Linux)) id 1ePAQg-0005JZ-7l for linux-arm-kernel@lists.infradead.org; Wed, 13 Dec 2017 17:02:50 +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 B863815BE; Wed, 13 Dec 2017 09:02:28 -0800 (PST) Received: from login2.euhpc.arm.com (login2.euhpc.arm.com [10.6.26.144]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 86E8A3F246; Wed, 13 Dec 2017 09:02:27 -0800 (PST) From: Vladimir Murzin To: linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 2/5] ARM: NOMMU: Reorganise __setup_mpu Date: Wed, 13 Dec 2017 17:02:04 +0000 Message-Id: <1513184527-44120-3-git-send-email-vladimir.murzin@arm.com> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1513184527-44120-1-git-send-email-vladimir.murzin@arm.com> References: <1513184527-44120-1-git-send-email-vladimir.murzin@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171213_090246_348578_F8B99E8F X-CRM114-Status: UNSURE ( 7.02 ) 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: kbuild-all@01.org, alexandre.torgue@st.com, linux@armlinux.org.uk, arnd@arndb.de, sza@esh.hu 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 Currently, we have mixed code placement between .head.text and .text depends on configuration we are building: _text M R(UP) R(SMP) ====================================================== __setup_mpu __HEAD __HEAD text __after_proc_init __HEAD __HEAD text __mmap_switched text text text We are going to support another variant of MPU which is different to PMSAv7 in sense overlapping MPU regions are not allowed, so this patch makes boundaries between these sections precise and consistent: _text M R(UP) R(SMP) ====================================================== __setup_mpu __HEAD __HEAD __HEAD __after_proc_init text text text __mmap_switched text text text Additionally, it paves a path to postpone MPU activation till __after_proc_init where we do set SCTLR anyway and can return directly to __mmap_switched. Signed-off-by: Vladimir Murzin --- arch/arm/kernel/head-nommu.S | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S index 0d17187..aaa25a6 100644 --- a/arch/arm/kernel/head-nommu.S +++ b/arch/arm/kernel/head-nommu.S @@ -75,8 +75,8 @@ ENTRY(stext) ldr r12, [r10, #PROCINFO_INITFUNC] add r12, r12, r10 ret r12 -1: bl __after_proc_init - b __mmap_switched +1: ldr lr, =__mmap_switched + b __after_proc_init ENDPROC(stext) #ifdef CONFIG_SMP @@ -123,6 +123,7 @@ __secondary_data: /* * Set the Control Register and Read the process ID. */ + .text __after_proc_init: #ifdef CONFIG_CPU_CP15 /* @@ -202,6 +203,7 @@ ENDPROC(__after_proc_init) * * r6: Value to be written to DRSR (and IRSR if required) for PMSAv7_RAM_REGION */ + __HEAD ENTRY(__setup_mpu) @@ -301,6 +303,7 @@ ENDPROC(__setup_pmsa_v7) * r6: pointer at mpu_rgn_info */ + .text ENTRY(__secondary_setup_mpu) /* Use MPU region info supplied by __cpu_up */ ldr r6, [r7] @ get secondary_data.mpu_rgn_info