From patchwork Wed Nov 18 03:58:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 7644491 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4AE209F2E2 for ; Wed, 18 Nov 2015 03:58:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5EDAB2053C for ; Wed, 18 Nov 2015 03:58:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 58C9B20340 for ; Wed, 18 Nov 2015 03:58:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752986AbbKRD6m (ORCPT ); Tue, 17 Nov 2015 22:58:42 -0500 Received: from relais.videotron.ca ([24.201.245.36]:53947 "EHLO relais.videotron.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752148AbbKRD6m (ORCPT ); Tue, 17 Nov 2015 22:58:42 -0500 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from yoda.home ([96.23.157.65]) by VL-VM-MR003.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0NXZ009ZOSDTZ8A0@VL-VM-MR003.ip.videotron.ca> for linux-sh@vger.kernel.org; Tue, 17 Nov 2015 22:58:41 -0500 (EST) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTPSA id EBCDD2DA03FF; Tue, 17 Nov 2015 22:58:40 -0500 (EST) Date: Tue, 17 Nov 2015 22:58:40 -0500 (EST) From: Nicolas Pitre To: Chris Brandt Cc: "linux@arm.linux.org.uk" , "linux-arm-kernel@lists.infradead.org" , "linux-sh@vger.kernel.org" Subject: RE: [PATCH v3] ARM: xip: Use correct symbol for end of ROM marker In-reply-to: Message-id: References: <1447362108-4333-1-git-send-email-chris.brandt@renesas.com> <1447697140-4099-1-git-send-email-chris.brandt@renesas.com> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, 17 Nov 2015, Chris Brandt wrote: > I think this one is more of a coding issue. > These were the attempts to fix the temporary stack issue: > > My first patch: > http://lists.infradead.org/pipermail/linux-arm-kernel/2015-July/357106.html > > Magnus's try: > http://lists.infradead.org/pipermail/linux-arm-kernel/2015-November/383394.html Here's my proposal: --- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index de2b246fed..2d0ac32320 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S @@ -274,10 +274,12 @@ __v7_ca15mp_setup: __v7_b15mp_setup: __v7_ca17mp_setup: mov r10, #0 -1: adr r12, __v7_setup_stack @ the local stack - stmia r12, {r0-r5, lr} @ v7_invalidate_l1 touches r0-r6 +1: adr r0, __v7_setup_stack_ptr + ldr r12, [r0] + add r12, r12, r0 @ the local stack + stmia r12, {r1-r6, lr} @ v7_invalidate_l1 touches r0-r6 bl v7_invalidate_l1 - ldmia r12, {r0-r5, lr} + ldmia r12, {r1-r6, lr} #ifdef CONFIG_SMP ALT_SMP(mrc p15, 0, r0, c1, c0, 1) ALT_UP(mov r0, #(1 << 6)) @ fake it for UP @@ -415,10 +417,12 @@ __v7_pj4b_setup: #endif /* CONFIG_CPU_PJ4B */ __v7_setup: - adr r12, __v7_setup_stack @ the local stack - stmia r12, {r0-r5, lr} @ v7_invalidate_l1 touches r0-r6 + adr r0, __v7_setup_stack_ptr + ldr r12, [r0] + add r12, r12, r0 @ the local stack + stmia r12, {r1-r6, lr} @ v7_invalidate_l1 touches r0-r6 bl v7_invalidate_l1 - ldmia r12, {r0-r5, lr} + ldmia r12, {r1-r6, lr} __v7_setup_cont: and r0, r9, #0xff000000 @ ARM? @@ -480,11 +484,16 @@ __errata_finish: orr r0, r0, r6 @ set them THUMB( orr r0, r0, #1 << 30 ) @ Thumb exceptions ret lr @ return to head.S:__ret + + .align 2 +__v7_setup_stack_ptr: + .word __v7_setup_stack - . ENDPROC(__v7_setup) + .bss .align 2 __v7_setup_stack: - .space 4 * 7 @ 12 registers + .space 4 * 7 @ 7 registers __INITDATA diff --git a/arch/arm/mm/proc-v7m.S b/arch/arm/mm/proc-v7m.S index 67d9209077..8cd465927a 100644 --- a/arch/arm/mm/proc-v7m.S +++ b/arch/arm/mm/proc-v7m.S @@ -123,10 +123,12 @@ __v7m_setup: ret lr ENDPROC(__v7m_setup) + .pushsection .bss .align 2 __v7m_setup_stack: .space 4 * 8 @ 8 registers __v7m_setup_stack_top: + .previous define_processor_functions v7m, dabort=nommu_early_abort, pabort=legacy_pabort, nommu=1