From patchwork Mon Jul 21 17:54:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 4597751 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 20C389F2B8 for ; Mon, 21 Jul 2014 17:57:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 58AE420131 for ; Mon, 21 Jul 2014 17:57:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8C61D20114 for ; Mon, 21 Jul 2014 17:57:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X9Hnl-0001jI-Kt; Mon, 21 Jul 2014 17:55:05 +0000 Received: from mail-wg0-f41.google.com ([74.125.82.41]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X9Hnh-00015P-VZ for linux-arm-kernel@lists.infradead.org; Mon, 21 Jul 2014 17:55:03 +0000 Received: by mail-wg0-f41.google.com with SMTP id z12so6771493wgg.12 for ; Mon, 21 Jul 2014 10:54:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=K68Nb2caPuPoXaQd++JuNMQND9Fvip0NuDdJ4ejMCwk=; b=KsruvyDkcaJOvUiuschmASSDNjvlFzmaiKqoYKiZwj7ZjgFtCGjw8h86ez7GUy8Xsm 8F7Go8y7ZMG6fROKKufVgLnB8Ok3QWaZKkUpJmTm6ivTTqMZyxCB5oDu2W3Tes/69xPi BEoZmC3lcvuR7y715WDx+VUlXf6LsdTlFkzOzOP6d1KBq+UMU62F/0U79xqJ+kkhz4WE xh49X2VgGNO9/FzW0u0zTSmZyvDyt7x8R5/8TPVTbMJqhedpWPwQDGHuTx8OrctJcr9m Rjof0mKyfKOfgEaOZE4KqmsQrM1lS0CXQiDvhM64tjgVMt0w8iuIi+or1xUfH6PGQlba 4I0Q== X-Gm-Message-State: ALoCoQmt3oGpS4hsEg2P4D0g9QAQleQcgqHhhbqQ+uN8qMXYjHNJuxipSKnK/mzXXGYmgzyS8OSy X-Received: by 10.194.89.106 with SMTP id bn10mr25603640wjb.121.1405965275689; Mon, 21 Jul 2014 10:54:35 -0700 (PDT) Received: from bivouac.eciton.net ([2a00:1098:0:86:1000:23:0:2]) by mx.google.com with ESMTPSA id u10sm39210868wjz.43.2014.07.21.10.54.34 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 21 Jul 2014 10:54:34 -0700 (PDT) Date: Mon, 21 Jul 2014 18:54:32 +0100 From: Leif Lindholm To: linux-arm-kernel@lists.infradead.org Subject: [RFC] arm: section split in boot/compressed/head.S Message-ID: <20140721175432.GB4179@bivouac.eciton.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140721_105502_190026_F6AC25E3 X-CRM114-Status: UNSURE ( 9.10 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Reported-by: Roy Franz The current code in boot/compressed/head.S executes pretty much sequentially from "start", all the way until the end of "dtb_check_done". However, shortly after the "not_angel" symbol, there is a section change, in the form of a ".text" directive. This means any literal pools in .start end up getting inserted into the middle of the instruction stream. Would something like the below (pardon the semantic silliness) be an acceptable fix? diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 3a8b32d..8ee05e9 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -149,6 +149,10 @@ start: mov r0, #0x17 @ angel_SWIreason_EnterSVC ARM( swi 0x123456 ) @ angel_SWI_ARM THUMB( svc 0xab ) @ angel_SWI_THUMB + b angel + + .text +angel: not_angel: safe_svcmode_maskall r0 msr spsr_cxsf, r9 @ Save the CPU boot mode in @@ -163,8 +167,6 @@ not_angel: * by the linker here, but it should preserve r7, r8, and r9. */ - .text - #ifdef CONFIG_AUTO_ZRELADDR @ determine final kernel image address mov r4, pc