From patchwork Sat Aug 5 20:52:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 109492 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp991820qge; Sat, 5 Aug 2017 13:53:39 -0700 (PDT) X-Received: by 10.99.0.17 with SMTP id 17mr102794pga.209.1501966419354; Sat, 05 Aug 2017 13:53:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501966419; cv=none; d=google.com; s=arc-20160816; b=zCB4W1G/VnmMYfelCwvj3OQU5axurnv41RJkYjmUvIkJWwXJ1ImwatLcX32gj1GCuG Ua2zikwiVALCWodImPbbVXxyK3LIq1WAPQKl3Zwgj+nDDL5FhBausSxNebmHRwn1wAmS MwGLYSc6z7tYoU2inIr+4VPp5rhJNkocp+/PEeQ9hVzojEvDzSf/TrHg5R8COabnPo4E mgqKA82owzImOqMh2sHIo3js4L0//6qtH0OO7VT/eKZvgpHvzWa8vr7LtnmeUMRRPG92 vGuccwCnCqc5irIvXGmzshg2+bJYzdnmqbPpY5mYSRyA+Mg6/cICB2Aha+iRIuvkDWB4 U99g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=379LL9WwBHkHGhzs/fMLSmcRM02kyk/ff3XAruVbUQQ=; b=zp9mRRw+kUUx4zxnfxsm2in0e3bV9vk/r3oR5YRL+yjP+/r74EkMiQPOHdyG2K1joo 3CmW1DvKfl8slrH0/gF+PIrWhRqw6VoFOiFw27zG7n8TuwfiKLR+MGJoT7i3QuDH+/Rm J7D9ARfeS/7sPmZNp+0/tBhicp1mdOt9B7ucFT3NGH4FlJl5nTRnZzYbknOL5rdlKF6W quNgCaJGaFPA7gwMUrOMPqaHp2llBhnZxXOKiIZpY3z8U9nZN3NgMarKbf4ahMpF9/pM j/ywmlS6U8uOIFLKsZMNFDD1G007y16Ci0Sg0bTEj4scjvbTM0vLbwC3FIxv+qd7X3Ud A0xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=e74EGa8Y; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si3018685plk.487.2017.08.05.13.53.39; Sat, 05 Aug 2017 13:53:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=e74EGa8Y; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752765AbdHEUxf (ORCPT + 3 others); Sat, 5 Aug 2017 16:53:35 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:35062 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752756AbdHEUxb (ORCPT ); Sat, 5 Aug 2017 16:53:31 -0400 Received: by mail-wm0-f42.google.com with SMTP id m85so42480286wma.0 for ; Sat, 05 Aug 2017 13:53:31 -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=weVne3m08tFNCU5/+ujdM2q3KUTNoztTJxW2gBd+82c=; b=e74EGa8Yfo3zqHXt3YF3lm/MrRzKychI8mImFS/i6am5L8Gy5I0twZ1b6SvsLXCHLA 70zDvjmqiSK3/0f3nRmOkHaGaZsu4hp3ENv/p5QNobGQRHkTCYE697E9McNNHwYDQGp1 UKZBVc/ORPQLQvOcT1LDxrtVtc66Uuocwzruk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=weVne3m08tFNCU5/+ujdM2q3KUTNoztTJxW2gBd+82c=; b=Q4PIttaTnFCbKxfKAg0NJrGla9kMDtlrLmuzDQGzD8BLU3r8MtDwKANnTDJHNbkfDM cmXcC9wwQE4wAY4zzTscpjPjmR8jn7cfsSqODHmIwjOM7ks4Ez+MHtG5Btk2/9T9Wd1k PkC6Vcrxapse4ieiSRE3akiK7WZfyUKyHjtCluthBJwtQnILZ+S59aHTAKWa7JGCtmnn 4T5pXy1PR08JYf6tb1QlNbweR2O18hT/AIhXZ12Mw/hHWPmoTXxFhI8wAWIHP0c6wZox WlfqbMhaMPOKfyV+UQ2ipvBviQpJgJ6wYjt0E8qVFVpsY+ME5LwLKks5mkMXza0qBC8t +nOA== X-Gm-Message-State: AHYfb5hNr8csuq+iunD10/ewN0Y88t512vjrg1uWmdqQ0A1eqrySuWvY cx7JsqFTpTFxMvB0 X-Received: by 10.28.191.157 with SMTP id o29mr4381364wmi.121.1501966410692; Sat, 05 Aug 2017 13:53:30 -0700 (PDT) Received: from localhost.localdomain ([160.77.147.147]) by smtp.gmail.com with ESMTPSA id v62sm2601775wmd.2.2017.08.05.13.53.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Aug 2017 13:53:29 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux@armlinux.org.uk, linux-omap@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, krzk@kernel.org, jason@lakedaemon.net, arm@kernel.org, andrew@lunn.ch, gregory.clement@free-electrons.com, sebastian.hesselbarth@gmail.com, tony@atomide.com, baohua@kernel.org, horms@verge.net.au, magnus.damm@gmail.com, vireshk@kernel.org, shiraz.linux.kernel@gmail.com, patrice.chotard@st.com, nico@linaro.org, dave.martin@arm.com, marc.zyngier@arm.com Cc: Ard Biesheuvel Subject: [PATCH 07/15] ARM: head.S: use PC-relative insn sequences for __fixup_pv_table Date: Sat, 5 Aug 2017 21:52:14 +0100 Message-Id: <20170805205222.19868-8-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170805205222.19868-1-ard.biesheuvel@linaro.org> References: <20170805205222.19868-1-ard.biesheuvel@linaro.org> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Replace the open coded PC relative offset calculations with adr_l and mov_l invocations. Signed-off-by: Ard Biesheuvel --- arch/arm/kernel/head.S | 27 ++++++-------------- 1 file changed, 8 insertions(+), 19 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" 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/kernel/head.S b/arch/arm/kernel/head.S index aed341e0f530..939543e73874 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -578,14 +578,11 @@ ENDPROC(fixup_smp) */ __HEAD __fixup_pv_table: - adr r0, 1f - ldmia r0, {r3-r7} + adr_l r6, __pv_phys_pfn_offset + adr_l r7, __pv_offset @ __pa(__pv_offset) + mov_l r3, __pv_offset @ __va(__pv_offset) mvn ip, #0 - subs r3, r0, r3 @ PHYS_OFFSET - PAGE_OFFSET - add r4, r4, r3 @ adjust table start address - add r5, r5, r3 @ adjust table end address - add r6, r6, r3 @ adjust __pv_phys_pfn_offset address - add r7, r7, r3 @ adjust __pv_offset address + subs r3, r7, r3 @ PHYS_OFFSET - PAGE_OFFSET mov r0, r8, lsr #PAGE_SHIFT @ convert to PFN str r0, [r6] @ save computed PHYS_OFFSET to __pv_phys_pfn_offset strcc ip, [r7, #HIGH_OFFSET] @ save to __pv_offset high bits @@ -594,20 +591,15 @@ __fixup_pv_table: THUMB( it ne @ cross section branch ) bne __error str r3, [r7, #LOW_OFFSET] @ save to __pv_offset low bits + adr_l r4, __pv_table_begin + adr_l r5, __pv_table_end b __fixup_a_pv_table ENDPROC(__fixup_pv_table) - - .align -1: .long . - .long __pv_table_begin - .long __pv_table_end -2: .long __pv_phys_pfn_offset - .long __pv_offset + .ltorg .text __fixup_a_pv_table: - adr r0, 3f - ldr r6, [r0] + mov_l r6, __pv_offset add r6, r6, r3 ldr r0, [r6, #HIGH_OFFSET] @ pv_offset high word ldr r6, [r6, #LOW_OFFSET] @ pv_offset low word @@ -676,9 +668,6 @@ ARM_BE8(rev16 ip, ip) #endif ENDPROC(__fixup_a_pv_table) - .align -3: .long __pv_offset - ENTRY(fixup_pv_table) stmfd sp!, {r4 - r7, lr} mov r3, #0 @ no offset