From patchwork Tue Jul 22 14:42:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 34095 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0CAA320540 for ; Tue, 22 Jul 2014 14:44:59 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id g18sf50418446oah.10 for ; Tue, 22 Jul 2014 07:44:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:subject:message-id :references:mime-version:in-reply-to:user-agent:cc:precedence :list-id:list-unsubscribe:list-archive:list-post:list-help :list-subscribe:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-disposition :content-type:content-transfer-encoding; bh=U5Q/5akBFoQ6qdIzsCkAz6noRoSdkrKMKu/4KsHzh7E=; b=gVlpHiiWG+3U8THOEKBdwk4mlBdzHGZ4Pg0LWW9JcH3xgytWlOa4fqSLV1Bx/Nepa3 56hAcvGJt7EmyHReHPRjwq2myQv0t9smJ54yvb1JcMo7ng1FemioORXwxMEh6V191vPf W5bFs5Xy4sQWRBZ5dPWkIdwKWwBTNV6hnUjuSAlsMDOUxXVF9ttOI9xBKj39r+CECJ8J ZwLolXUIH5AvmDP+3Oi7Dhbu83cXF/rl8bcZ8OGbK7gVsongeYfWDeNGYXr1pN5XHti0 dDTacxPxqxDLUR1HgYOzTEsGp8kxNL4h6nUv9g8z1ZA2dYOpl6cw5QOcmeIdHsa/YZaO gMrw== X-Gm-Message-State: ALoCoQnN7QUa6Uzk4bINxoOEypUt17hrJ3BbyTkGO3RseJ68GGWF8rIyBrTm6v4Bh61xeXZapImB X-Received: by 10.50.109.131 with SMTP id hs3mr5348666igb.8.1406040298549; Tue, 22 Jul 2014 07:44:58 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.50.164.131 with SMTP id yq3ls2235511igb.8.gmail; Tue, 22 Jul 2014 07:44:58 -0700 (PDT) X-Received: by 10.70.0.76 with SMTP id 12mr2315314pdc.44.1406040298303; Tue, 22 Jul 2014 07:44:58 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id df5si1057627vec.75.2014.07.22.07.44.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Jul 2014 07:44:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id im17so15296855vcb.17 for ; Tue, 22 Jul 2014 07:44:57 -0700 (PDT) X-Received: by 10.221.34.13 with SMTP id sq13mr41079831vcb.16.1406040297939; Tue, 22 Jul 2014 07:44:57 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp201998vcb; Tue, 22 Jul 2014 07:44:57 -0700 (PDT) X-Received: by 10.70.125.233 with SMTP id mt9mr2231489pdb.154.1406040296792; Tue, 22 Jul 2014 07:44:56 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id j15si323623pdm.442.2014.07.22.07.44.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jul 2014 07:44:56 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; 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 1X9bHi-0006Gf-2t; Tue, 22 Jul 2014 14:43:18 +0000 Received: from mail-wi0-f179.google.com ([209.85.212.179]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X9bHf-0006Dh-QX for linux-arm-kernel@lists.infradead.org; Tue, 22 Jul 2014 14:43:16 +0000 Received: by mail-wi0-f179.google.com with SMTP id f8so550982wiw.12 for ; Tue, 22 Jul 2014 07:42:51 -0700 (PDT) X-Received: by 10.195.18.8 with SMTP id gi8mr33773947wjd.75.1406040170912; Tue, 22 Jul 2014 07:42:50 -0700 (PDT) Received: from bivouac.eciton.net ([2a00:1098:0:86:1000:23:0:2]) by mx.google.com with ESMTPSA id ey16sm54578567wid.14.2014.07.22.07.42.49 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 22 Jul 2014 07:42:49 -0700 (PDT) Date: Tue, 22 Jul 2014 15:42:47 +0100 From: Leif Lindholm To: Ard Biesheuvel , Dave Martin , Catalin Marinas Subject: Re: [RFC] arm: section split in boot/compressed/head.S Message-ID: <20140722144247.GC4179@bivouac.eciton.net> References: <20140721175432.GB4179@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: 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-20140722_074316_001235_1854AC32 X-CRM114-Status: GOOD ( 17.89 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.179 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.212.179 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: "linux-arm-kernel@lists.infradead.org" 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+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: leif.lindholm@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Content-Disposition: inline On Mon, Jul 21, 2014 at 08:29:54PM +0200, Ard Biesheuvel wrote: > On 21 July 2014 19:54, Leif Lindholm wrote: > > 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 > > > The idea appears to be that code in .start sections from other > platform specific object files gets put there, so it gets executed > extremely early. > Jumping over it kind of defeats the purpose here. Ah, I got the impression something magic was going on, but failed to spot that bit... > Instead, adding an explicit .ltorg and jumping over /that/ should do > the trick, I think, but perhaps it's better just to open code the > literal pool in this case. The current state seems fragile, so: ? / Leif diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 3a8b32d..8fded53 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -149,6 +149,11 @@ start: mov r0, #0x17 @ angel_SWIreason_EnterSVC ARM( swi 0x123456 ) @ angel_SWI_ARM THUMB( svc 0xab ) @ angel_SWI_THUMB + b angel + + .ltorg + +angel: not_angel: safe_svcmode_maskall r0 msr spsr_cxsf, r9 @ Save the CPU boot mode in