From patchwork Mon Feb 12 11:19:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vladimir Murzin X-Patchwork-Id: 10212215 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 98C1960329 for ; Mon, 12 Feb 2018 11:29:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8979128B60 for ; Mon, 12 Feb 2018 11:29:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C30D28B0B; Mon, 12 Feb 2018 11:29:18 +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 casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 49F2228B0B for ; Mon, 12 Feb 2018 11:29:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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=B2BeeXrNs8CFB7kjiNe73sYgWDdqLNkp0+k9bhxpR/o=; b=fLuqZwVg5ZgNv1D42yOcMjEh2 axncaw5COlBfxU4cYWXxrGimqkIb5UyFH3G/BwUiKKQcuErlrKj5sPOMDGyTw+kAxLb+OSAWeD0bu 8/i4JQMJ8ZmPEb0Nozj61EN7P05ZJq9us1yJzo9P+4v4xfg1xLaTNm1DuFJqDyuyEAOKnjKBB5iIw wW8ZCBFFmnSzIEJBe2/ZdU1ZHxhtnSgWpj+I8Cx6B7qiF2H+WZ0xRJSuQSapsRDWPiB/VhdxO09Kv QesV4ukaYVPDdtcS/Ma74nrdZFg/5sr1AXWqd8o28bKl1ur3RNKlxriALu1kfKIxbou5jhCf8xoEp xOxMGsGzA==; Received: from [198.137.202.133] (helo=bombadil.infradead.org) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1elCID-00085G-CG for patchwork-linux-arm@patchwork.kernel.org; Mon, 12 Feb 2018 11:29:05 +0000 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=B2BeeXrNs8CFB7kjiNe73sYgWDdqLNkp0+k9bhxpR/o=; b=pZ4OfNFXSA5TZw yF8PcQOY+XENLgWtMa9FyoNsjU+nN9jvqugNl4SKOzZhyKlcvS1dtj9w5/SnwXkE1bCyWAtYNP2m4 +PTz/83CK3p90s5H+xH8aIiDqZ6RhonrQtqG2vPvgG7LS6mgRLrt/+JoZO1y1UDqQyCo6I2dgUj+L M3OK3NMvaqxTC7MrsOzTS4Zcgf3VwucULLR+GQlAHVkTA6WEdMPkliXsuYTS5F/KwQ90MIubBCenc Xptpu+t2iy7Esrze5TO57oRuaQW0emg0x4FY4doq1IwgBL9Yju3hM+86vtxwq250TMmhRYifSl4Ql /onUpWGUnZrGf2s1IPag==; 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 1elCAv-0007uu-8B; Mon, 12 Feb 2018 11:21:33 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1elC9f-00050g-Sc for linux-arm-kernel@lists.infradead.org; Mon, 12 Feb 2018 11:20:18 +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 D63B2164F; Mon, 12 Feb 2018 03:20:02 -0800 (PST) Received: from bc-e10-1-11.euhpc.arm.com. (bc-e10-1-11.euhpc.arm.com [10.6.12.88]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9B7F63F487; Mon, 12 Feb 2018 03:20:01 -0800 (PST) From: Vladimir Murzin To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/4] ARM: NOMMU: Reorganise __setup_mpu Date: Mon, 12 Feb 2018 11:19:30 +0000 Message-Id: <1518434373-27907-2-git-send-email-vladimir.murzin@arm.com> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1518434373-27907-1-git-send-email-vladimir.murzin@arm.com> References: <1518434373-27907-1-git-send-email-vladimir.murzin@arm.com> MIME-Version: 1.0 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 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. Tested-by: Szemző András 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