From patchwork Wed Aug 3 15:38:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 73214 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp923603qga; Wed, 3 Aug 2016 08:41:52 -0700 (PDT) X-Received: by 10.66.189.104 with SMTP id gh8mr115757736pac.125.1470238912858; Wed, 03 Aug 2016 08:41:52 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id h2si9336833pfe.212.2016.08.03.08.41.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Aug 2016 08:41:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bUyHb-0006rx-RB; Wed, 03 Aug 2016 15:40:35 +0000 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bUyGS-00054L-7r for linux-arm-kernel@lists.infradead.org; Wed, 03 Aug 2016 15:39:28 +0000 Received: by mail-wm0-x231.google.com with SMTP id q128so453393087wma.1 for ; Wed, 03 Aug 2016 08:39:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VCcz6mPlGkwaD9o64gZmyLLorajkxos8xco7HQnflK8=; b=TbYHn/BEjezwQ9zNXSy4+OAV2lDI/F/EyKZ9H14NwTq1j7u4QfCVvQe3YrdQDjku3a XvDpDvlPtFGJQKQVP/f/tTUWmP6cnTMkwGnmR3jfbB7GJWbHNRhIbeuPq3LJV6OofxxV Pdiy2+/i/krClQqcinHINJbh7c8SEzBaIGPCc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VCcz6mPlGkwaD9o64gZmyLLorajkxos8xco7HQnflK8=; b=KgEFM1CAQhRJo/O6/8LE4uAhskLkyCwDu62O/uE5XzORGhxPE2c6wHtIYZPUTBrnGH /0rXpGakOhUA4yOF0yE4X9mIeB4R6RLyn85sUBDUMb+8rqNZrn1RZ4Fn14JMn1T4/8jW dUdbqAXkdwQkq//RXpeeBGkk/hLlBYB9B+eKyowxXzLuS3rKiAbKAGag1n4K8cZwD0Bh QLoiw7Y2W9Zmzj6WZ8KYspdAIhT5Vw5LoW7xG9fdGcimETmbjf+Q6b/Ffe9NGPWwIbmG 8sqVdkQlRUUWsGuZujcfauadLzF+3MHSWs/Mreh0DBeArwQE9Nw4v7KDqhCh7FvbFvJ5 CHXA== X-Gm-Message-State: AEkoouuKYcm66rG6X4o3n8EthxfCOLh8ZXn/0Gi9N9Vz+9W3dJHgzLeYlbWXGQlfzdeUjORJ X-Received: by 10.28.191.14 with SMTP id p14mr24098190wmf.39.1470238742442; Wed, 03 Aug 2016 08:39:02 -0700 (PDT) Received: from localhost.localdomain (3.red-81-34-118.dynamicip.rima-tde.net. [81.34.118.3]) by smtp.gmail.com with ESMTPSA id uo4sm8291402wjc.36.2016.08.03.08.39.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Aug 2016 08:39:01 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux@arm.linux.org.uk, nico@linaro.org, arnd@arndb.de, dave.martin@arm.com Subject: [PATCH 4/8] ARM: head.S: use PC-relative insn sequence for secondary_data Date: Wed, 3 Aug 2016 17:38:46 +0200 Message-Id: <1470238730-30038-5-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1470238730-30038-1-git-send-email-ard.biesheuvel@linaro.org> References: <1470238730-30038-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160803_083924_482245_9F6C5672 X-CRM114-Status: GOOD ( 10.08 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:231 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Replace the open coded PC relative offset calculations with adr_l and ldr_l invocations. Signed-off-by: Ard Biesheuvel --- arch/arm/kernel/head.S | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index f99360e5b004..7a14622582de 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -386,40 +386,28 @@ ENTRY(secondary_startup) /* * Use the page tables supplied from __cpu_up. */ - adr r4, __secondary_data - ldmia r4, {r5, r7, r12} @ address to jump to after - sub lr, r4, r5 @ mmu has been enabled - add r3, r7, lr + adr_l r3, secondary_data ldrd r4, [r3, #0] @ get secondary_data.pgdir ARM_BE8(eor r4, r4, r5) @ Swap r5 and r4 in BE: ARM_BE8(eor r5, r4, r5) @ it can be done in 3 steps ARM_BE8(eor r4, r4, r5) @ without using a temp reg. ldr r8, [r3, #8] @ get secondary_data.swapper_pg_dir badr lr, __enable_mmu @ return address - mov r13, r12 @ __secondary_switched address + ldr r13, =__secondary_switched @ __secondary_switched address ldr r12, [r10, #PROCINFO_INITFUNC] add r12, r12, r10 @ initialise processor @ (return control reg) ret r12 ENDPROC(secondary_startup) ENDPROC(secondary_startup_arm) + .ltorg - /* - * r6 = &secondary_data - */ ENTRY(__secondary_switched) - ldr sp, [r7, #12] @ get secondary_data.stack + ldr_l sp, secondary_data + 12, ip @ get secondary_data.stack mov fp, #0 b secondary_start_kernel ENDPROC(__secondary_switched) - .align - - .type __secondary_data, %object -__secondary_data: - .long . - .long secondary_data - .long __secondary_switched #endif /* defined(CONFIG_SMP) */